decoder.isa (2706:d88c27f75121) | decoder.isa (2742:47e405ea4da8) |
---|---|
1// -*- mode:c++ -*- 2 3// Copyright (c) 2003-2006 The Regents of The University of Michigan 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 144 unchanged lines hidden (view full) --- 153 154 0x3: decode FUNCTION_LO { 155 format HiLoOp { 156 0x0: mult({{ val = Rs.sd * Rt.sd; }}); 157 0x1: multu({{ val = Rs.ud * Rt.ud; }}); 158 } 159 160 format HiLoMiscOp { | 1// -*- mode:c++ -*- 2 3// Copyright (c) 2003-2006 The Regents of The University of Michigan 4// All rights reserved. 5// 6// Redistribution and use in source and binary forms, with or without 7// modification, are permitted provided that the following conditions are 8// met: redistributions of source code must retain the above copyright --- 144 unchanged lines hidden (view full) --- 153 154 0x3: decode FUNCTION_LO { 155 format HiLoOp { 156 0x0: mult({{ val = Rs.sd * Rt.sd; }}); 157 0x1: multu({{ val = Rs.ud * Rt.ud; }}); 158 } 159 160 format HiLoMiscOp { |
161 0x2: div({{ 162 HI = Rs.sd % Rt.sd; 163 LO = Rs.sd / Rt.sd; 164 }}); 165 0x3: divu({{ 166 HI = Rs.ud % Rt.ud; 167 LO = Rs.ud / Rt.ud; 168 }}); | 161 0x2: div({{ if (Rt.sd != 0) { 162 HI = Rs.sd % Rt.sd; 163 LO = Rs.sd / Rt.sd; 164 } 165 }}); 166 0x3: divu({{ if (Rt.ud != 0) { 167 HI = Rs.ud % Rt.ud; 168 LO = Rs.ud / Rt.ud; 169 } 170 }}); |
169 } 170 } 171 172 0x4: decode HINT { 173 0x0: decode FUNCTION_LO { 174 format IntOp { 175 0x0: add({{ Rd.sw = Rs.sw + Rt.sw; /*Trap on Overflow*/}}); 176 0x1: addu({{ Rd.sw = Rs.sw + Rt.sw;}}); --- 151 unchanged lines hidden (view full) --- 328 } 329 330 //Table A-13 MIPS32 COP1 Encoding of rs Field 331 0x1: decode RS_MSB { 332 333 0x0: decode RS_HI { 334 0x0: decode RS_LO { 335 format CP1Control { | 171 } 172 } 173 174 0x4: decode HINT { 175 0x0: decode FUNCTION_LO { 176 format IntOp { 177 0x0: add({{ Rd.sw = Rs.sw + Rt.sw; /*Trap on Overflow*/}}); 178 0x1: addu({{ Rd.sw = Rs.sw + Rt.sw;}}); --- 151 unchanged lines hidden (view full) --- 330 } 331 332 //Table A-13 MIPS32 COP1 Encoding of rs Field 333 0x1: decode RS_MSB { 334 335 0x0: decode RS_HI { 336 0x0: decode RS_LO { 337 format CP1Control { |
336 0x0: mfc1 ({{ Rt.uw = Fs.uw<31:0>; }}); | 338 0x0: mfc1 ({{ Rt.uw = Fs.uw; }}); |
337 338 0x2: cfc1({{ 339 switch (FS) 340 { 341 case 0: 342 Rt = FIR; 343 break; 344 case 25: --- 88 unchanged lines hidden (view full) --- 433 0x0: decode FUNCTION_LO { 434 format FloatOp { 435 0x0: add_s({{ Fd.sf = Fs.sf + Ft.sf;}}); 436 0x1: sub_s({{ Fd.sf = Fs.sf - Ft.sf;}}); 437 0x2: mul_s({{ Fd.sf = Fs.sf * Ft.sf;}}); 438 0x3: div_s({{ Fd.sf = Fs.sf / Ft.sf;}}); 439 0x4: sqrt_s({{ Fd.sf = sqrt(Fs.sf);}}); 440 0x5: abs_s({{ Fd.sf = fabs(Fs.sf);}}); | 339 340 0x2: cfc1({{ 341 switch (FS) 342 { 343 case 0: 344 Rt = FIR; 345 break; 346 case 25: --- 88 unchanged lines hidden (view full) --- 435 0x0: decode FUNCTION_LO { 436 format FloatOp { 437 0x0: add_s({{ Fd.sf = Fs.sf + Ft.sf;}}); 438 0x1: sub_s({{ Fd.sf = Fs.sf - Ft.sf;}}); 439 0x2: mul_s({{ Fd.sf = Fs.sf * Ft.sf;}}); 440 0x3: div_s({{ Fd.sf = Fs.sf / Ft.sf;}}); 441 0x4: sqrt_s({{ Fd.sf = sqrt(Fs.sf);}}); 442 0x5: abs_s({{ Fd.sf = fabs(Fs.sf);}}); |
441 0x6: mov_s({{ Fd.sf = Fs.sf;}}); | |
442 0x7: neg_s({{ Fd.sf = -Fs.sf;}}); 443 } | 443 0x7: neg_s({{ Fd.sf = -Fs.sf;}}); 444 } |
445 446 0x6: BasicOp::mov_s({{ Fd.sf = Fs.sf;}}); |
|
444 } 445 446 0x1: decode FUNCTION_LO { 447 format FloatConvertOp { 448 0x0: round_l_s({{ val = Fs.sf; }}, ToLong, 449 Round); 450 0x1: trunc_l_s({{ val = Fs.sf; }}, ToLong, 451 Trunc); --- 92 unchanged lines hidden (view full) --- 544 0x0: decode FUNCTION_LO { 545 format FloatOp { 546 0x0: add_d({{ Fd.df = Fs.df + Ft.df; }}); 547 0x1: sub_d({{ Fd.df = Fs.df - Ft.df; }}); 548 0x2: mul_d({{ Fd.df = Fs.df * Ft.df; }}); 549 0x3: div_d({{ Fd.df = Fs.df / Ft.df; }}); 550 0x4: sqrt_d({{ Fd.df = sqrt(Fs.df); }}); 551 0x5: abs_d({{ Fd.df = fabs(Fs.df); }}); | 447 } 448 449 0x1: decode FUNCTION_LO { 450 format FloatConvertOp { 451 0x0: round_l_s({{ val = Fs.sf; }}, ToLong, 452 Round); 453 0x1: trunc_l_s({{ val = Fs.sf; }}, ToLong, 454 Trunc); --- 92 unchanged lines hidden (view full) --- 547 0x0: decode FUNCTION_LO { 548 format FloatOp { 549 0x0: add_d({{ Fd.df = Fs.df + Ft.df; }}); 550 0x1: sub_d({{ Fd.df = Fs.df - Ft.df; }}); 551 0x2: mul_d({{ Fd.df = Fs.df * Ft.df; }}); 552 0x3: div_d({{ Fd.df = Fs.df / Ft.df; }}); 553 0x4: sqrt_d({{ Fd.df = sqrt(Fs.df); }}); 554 0x5: abs_d({{ Fd.df = fabs(Fs.df); }}); |
552 0x6: mov_d({{ Fd.df = Fs.df; }}); | |
553 0x7: neg_d({{ Fd.df = -1 * Fs.df; }}); 554 } | 555 0x7: neg_d({{ Fd.df = -1 * Fs.df; }}); 556 } |
557 558 0x6: BasicOp::mov_d({{ Fd.df = Fs.df; }}); |
|
555 } 556 557 0x1: decode FUNCTION_LO { 558 format FloatConvertOp { 559 0x0: round_l_d({{ val = Fs.df; }}, ToLong, 560 Round); 561 0x1: trunc_l_d({{ val = Fs.df; }}, ToLong, 562 Trunc); --- 285 unchanged lines hidden (view full) --- 848 } 849 850 //Table A-20 MIPS64 COP1X Encoding of Function Field 1 851 //Note: "COP1X instructions are legal only if 64-bit floating point 852 //operations are enabled." 853 0x3: decode FUNCTION_HI { 854 0x0: decode FUNCTION_LO { 855 format LoadIndexedMemory { | 559 } 560 561 0x1: decode FUNCTION_LO { 562 format FloatConvertOp { 563 0x0: round_l_d({{ val = Fs.df; }}, ToLong, 564 Round); 565 0x1: trunc_l_d({{ val = Fs.df; }}, ToLong, 566 Trunc); --- 285 unchanged lines hidden (view full) --- 852 } 853 854 //Table A-20 MIPS64 COP1X Encoding of Function Field 1 855 //Note: "COP1X instructions are legal only if 64-bit floating point 856 //operations are enabled." 857 0x3: decode FUNCTION_HI { 858 0x0: decode FUNCTION_LO { 859 format LoadIndexedMemory { |
856 0x0: lwxc1({{ Ft.uw = Mem.uw;}}); 857 0x1: ldxc1({{ Ft.ud = Mem.ud;}}); 858 0x5: luxc1({{ Ft.uw = Mem.ud;}}); | 860 0x0: lwxc1({{ Fd.uw = Mem.uw;}}); 861 0x1: ldxc1({{ Fd.ud = Mem.ud;}}); 862 0x5: luxc1({{ Fd.uw = Mem.ud;}}, 863 {{ EA = (Rs + Rt) & ~7; }}); |
859 } 860 } 861 862 0x1: decode FUNCTION_LO { 863 format StoreIndexedMemory { | 864 } 865 } 866 867 0x1: decode FUNCTION_LO { 868 format StoreIndexedMemory { |
864 0x0: swxc1({{ Mem.uw = Ft.uw;}}); 865 0x1: sdxc1({{ Mem.ud = Ft.ud;}}); 866 0x5: suxc1({{ Mem.ud = Ft.ud;}}); | 869 0x0: swxc1({{ Mem.uw = Fs.uw;}}); 870 0x1: sdxc1({{ Mem.ud = Fs.ud;}}); 871 0x5: suxc1({{ Mem.ud = Fs.ud;}}, 872 {{ EA = (Rs + Rt) & ~7; }}); |
867 } 868 869 0x7: Prefetch::prefx({{ EA = Rs + Rt; }}); 870 } 871 872 0x3: decode FUNCTION_LO { 873 0x6: Float64Op::alnv_ps({{ if (Rs<2:0> == 0) { 874 Fd.ud = Fs.ud; --- 111 unchanged lines hidden (view full) --- 986 } 987 } 988 989 //Table A-6 MIPS32 SPECIAL3 Encoding of Function Field for Release 2 990 //of the Architecture 991 0x7: decode FUNCTION_HI { 992 0x0: decode FUNCTION_LO { 993 format BasicOp { | 873 } 874 875 0x7: Prefetch::prefx({{ EA = Rs + Rt; }}); 876 } 877 878 0x3: decode FUNCTION_LO { 879 0x6: Float64Op::alnv_ps({{ if (Rs<2:0> == 0) { 880 Fd.ud = Fs.ud; --- 111 unchanged lines hidden (view full) --- 992 } 993 } 994 995 //Table A-6 MIPS32 SPECIAL3 Encoding of Function Field for Release 2 996 //of the Architecture 997 0x7: decode FUNCTION_HI { 998 0x0: decode FUNCTION_LO { 999 format BasicOp { |
994 0x1: ext({{ Rt.uw = bits(Rs.uw, MSB+LSB, LSB); }}); | 1000 0x0: ext({{ Rt.uw = bits(Rs.uw, MSB+LSB, LSB); }}); |
995 0x4: ins({{ Rt.uw = bits(Rt.uw, 31, MSB+1) << (MSB+1) | 996 bits(Rs.uw, MSB-LSB, 0) << LSB | 997 bits(Rt.uw, LSB-1, 0); 998 }}); 999 } 1000 } 1001 1002 0x1: decode FUNCTION_LO { --- 6 unchanged lines hidden (view full) --- 1009 //Table A-10 MIPS32 BSHFL Encoding of sa Field 1010 0x4: decode SA { 1011 format BasicOp { 1012 0x02: wsbh({{ Rd.uw = Rt.uw<23:16> << 24 | 1013 Rt.uw<31:24> << 16 | 1014 Rt.uw<7:0> << 8 | 1015 Rt.uw<15:8>; 1016 }}); | 1001 0x4: ins({{ Rt.uw = bits(Rt.uw, 31, MSB+1) << (MSB+1) | 1002 bits(Rs.uw, MSB-LSB, 0) << LSB | 1003 bits(Rt.uw, LSB-1, 0); 1004 }}); 1005 } 1006 } 1007 1008 0x1: decode FUNCTION_LO { --- 6 unchanged lines hidden (view full) --- 1015 //Table A-10 MIPS32 BSHFL Encoding of sa Field 1016 0x4: decode SA { 1017 format BasicOp { 1018 0x02: wsbh({{ Rd.uw = Rt.uw<23:16> << 24 | 1019 Rt.uw<31:24> << 16 | 1020 Rt.uw<7:0> << 8 | 1021 Rt.uw<15:8>; 1022 }}); |
1017 0x10: seb({{ Rd.sw = Rt.sw<7:0>}}); 1018 0x18: seh({{ Rd.sw = Rt.sw<15:0>}}); | 1023 0x10: seb({{ Rd.sw = Rt.sb; }}); 1024 0x18: seh({{ Rd.sw = Rt.sh; }}); |
1019 } 1020 } 1021 1022 0x6: decode FUNCTION_LO { 1023 0x7: FailUnimpl::rdhwr(); 1024 } 1025 } 1026 } --- 69 unchanged lines hidden --- | 1025 } 1026 } 1027 1028 0x6: decode FUNCTION_LO { 1029 0x7: FailUnimpl::rdhwr(); 1030 } 1031 } 1032 } --- 69 unchanged lines hidden --- |