| OLD | NEW |
| 1 //===- subzero/src/IceInstMIPS32.h - MIPS32 machine instrs --*- C++ -*-----===// | 1 //===- subzero/src/IceInstMIPS32.h - MIPS32 machine instrs --*- C++ -*-----===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 /// Base class for Mips instructions. | 139 /// Base class for Mips instructions. |
| 140 class InstMIPS32 : public InstTarget { | 140 class InstMIPS32 : public InstTarget { |
| 141 InstMIPS32() = delete; | 141 InstMIPS32() = delete; |
| 142 InstMIPS32(const InstMIPS32 &) = delete; | 142 InstMIPS32(const InstMIPS32 &) = delete; |
| 143 InstMIPS32 &operator=(const InstMIPS32 &) = delete; | 143 InstMIPS32 &operator=(const InstMIPS32 &) = delete; |
| 144 | 144 |
| 145 public: | 145 public: |
| 146 enum InstKindMIPS32 { | 146 enum InstKindMIPS32 { |
| 147 k__Start = Inst::Target, | 147 k__Start = Inst::Target, |
| 148 Abs_d, |
| 149 Abs_s, |
| 148 Add, | 150 Add, |
| 149 Add_d, | 151 Add_d, |
| 150 Add_s, | 152 Add_s, |
| 151 Addiu, | 153 Addiu, |
| 152 Addu, | 154 Addu, |
| 153 And, | 155 And, |
| 154 Andi, | 156 Andi, |
| 155 Br, | 157 Br, |
| 156 Call, | 158 Call, |
| 157 Cvt_d_l, | 159 Cvt_d_l, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 Sll, | 193 Sll, |
| 192 Sllv, | 194 Sllv, |
| 193 Slt, | 195 Slt, |
| 194 Slti, | 196 Slti, |
| 195 Sltiu, | 197 Sltiu, |
| 196 Sltu, | 198 Sltu, |
| 197 Sra, | 199 Sra, |
| 198 Srav, | 200 Srav, |
| 199 Srl, | 201 Srl, |
| 200 Srlv, | 202 Srlv, |
| 203 Sqrt_d, |
| 204 Sqrt_s, |
| 201 Sub, | 205 Sub, |
| 202 Sub_d, | 206 Sub_d, |
| 203 Sub_s, | 207 Sub_s, |
| 204 Subu, | 208 Subu, |
| 205 Sw, | 209 Sw, |
| 206 Swc1, | 210 Swc1, |
| 207 Trunc_l_d, | 211 Trunc_l_d, |
| 208 Trunc_l_s, | 212 Trunc_l_s, |
| 209 Trunc_w_d, | 213 Trunc_w_d, |
| 210 Trunc_w_s, | 214 Trunc_w_s, |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 } | 870 } |
| 867 | 871 |
| 868 InstMIPS32Imm16(Cfg *Func, Variable *Dest, uint32_t Imm) | 872 InstMIPS32Imm16(Cfg *Func, Variable *Dest, uint32_t Imm) |
| 869 : InstMIPS32(Func, K, 0, Dest), Imm(Imm) {} | 873 : InstMIPS32(Func, K, 0, Dest), Imm(Imm) {} |
| 870 | 874 |
| 871 static const char *Opcode; | 875 static const char *Opcode; |
| 872 | 876 |
| 873 const uint32_t Imm; | 877 const uint32_t Imm; |
| 874 }; | 878 }; |
| 875 | 879 |
| 880 using InstMIPS32Abs_d = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_d>; |
| 881 using InstMIPS32Abs_s = InstMIPS32TwoAddrFPR<InstMIPS32::Abs_s>; |
| 876 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; | 882 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; |
| 877 using InstMIPS32Add_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_d>; | 883 using InstMIPS32Add_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_d>; |
| 878 using InstMIPS32Add_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_s>; | 884 using InstMIPS32Add_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_s>; |
| 879 using InstMIPS32Addu = InstMIPS32ThreeAddrGPR<InstMIPS32::Addu>; | 885 using InstMIPS32Addu = InstMIPS32ThreeAddrGPR<InstMIPS32::Addu>; |
| 880 using InstMIPS32Addiu = InstMIPS32Imm16<InstMIPS32::Addiu, true>; | 886 using InstMIPS32Addiu = InstMIPS32Imm16<InstMIPS32::Addiu, true>; |
| 881 using InstMIPS32And = InstMIPS32ThreeAddrGPR<InstMIPS32::And>; | 887 using InstMIPS32And = InstMIPS32ThreeAddrGPR<InstMIPS32::And>; |
| 882 using InstMIPS32Andi = InstMIPS32Imm16<InstMIPS32::Andi>; | 888 using InstMIPS32Andi = InstMIPS32Imm16<InstMIPS32::Andi>; |
| 883 using InstMIPS32Cvt_d_s = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_s>; | 889 using InstMIPS32Cvt_d_s = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_s>; |
| 884 using InstMIPS32Cvt_d_l = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_l>; | 890 using InstMIPS32Cvt_d_l = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_l>; |
| 885 using InstMIPS32Cvt_d_w = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_w>; | 891 using InstMIPS32Cvt_d_w = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_w>; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 910 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>; | 916 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>; |
| 911 using InstMIPS32Or = InstMIPS32ThreeAddrGPR<InstMIPS32::Or>; | 917 using InstMIPS32Or = InstMIPS32ThreeAddrGPR<InstMIPS32::Or>; |
| 912 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; | 918 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; |
| 913 using InstMIPS32Sdc1 = InstMIPS32Store<InstMIPS32::Sdc1>; | 919 using InstMIPS32Sdc1 = InstMIPS32Store<InstMIPS32::Sdc1>; |
| 914 using InstMIPS32Sll = InstMIPS32Imm16<InstMIPS32::Sll>; | 920 using InstMIPS32Sll = InstMIPS32Imm16<InstMIPS32::Sll>; |
| 915 using InstMIPS32Sllv = InstMIPS32ThreeAddrGPR<InstMIPS32::Sllv>; | 921 using InstMIPS32Sllv = InstMIPS32ThreeAddrGPR<InstMIPS32::Sllv>; |
| 916 using InstMIPS32Slt = InstMIPS32ThreeAddrGPR<InstMIPS32::Slt>; | 922 using InstMIPS32Slt = InstMIPS32ThreeAddrGPR<InstMIPS32::Slt>; |
| 917 using InstMIPS32Slti = InstMIPS32Imm16<InstMIPS32::Slti>; | 923 using InstMIPS32Slti = InstMIPS32Imm16<InstMIPS32::Slti>; |
| 918 using InstMIPS32Sltiu = InstMIPS32Imm16<InstMIPS32::Sltiu>; | 924 using InstMIPS32Sltiu = InstMIPS32Imm16<InstMIPS32::Sltiu>; |
| 919 using InstMIPS32Sltu = InstMIPS32ThreeAddrGPR<InstMIPS32::Sltu>; | 925 using InstMIPS32Sltu = InstMIPS32ThreeAddrGPR<InstMIPS32::Sltu>; |
| 926 using InstMIPS32Sqrt_d = InstMIPS32TwoAddrFPR<InstMIPS32::Sqrt_d>; |
| 927 using InstMIPS32Sqrt_s = InstMIPS32TwoAddrFPR<InstMIPS32::Sqrt_s>; |
| 920 using InstMIPS32Sra = InstMIPS32Imm16<InstMIPS32::Sra>; | 928 using InstMIPS32Sra = InstMIPS32Imm16<InstMIPS32::Sra>; |
| 921 using InstMIPS32Srav = InstMIPS32ThreeAddrGPR<InstMIPS32::Srav>; | 929 using InstMIPS32Srav = InstMIPS32ThreeAddrGPR<InstMIPS32::Srav>; |
| 922 using InstMIPS32Srl = InstMIPS32Imm16<InstMIPS32::Srl>; | 930 using InstMIPS32Srl = InstMIPS32Imm16<InstMIPS32::Srl>; |
| 923 using InstMIPS32Srlv = InstMIPS32ThreeAddrGPR<InstMIPS32::Srlv>; | 931 using InstMIPS32Srlv = InstMIPS32ThreeAddrGPR<InstMIPS32::Srlv>; |
| 924 using InstMIPS32Sub = InstMIPS32ThreeAddrGPR<InstMIPS32::Sub>; | 932 using InstMIPS32Sub = InstMIPS32ThreeAddrGPR<InstMIPS32::Sub>; |
| 925 using InstMIPS32Sub_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_d>; | 933 using InstMIPS32Sub_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_d>; |
| 926 using InstMIPS32Sub_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_s>; | 934 using InstMIPS32Sub_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_s>; |
| 927 using InstMIPS32Subu = InstMIPS32ThreeAddrGPR<InstMIPS32::Subu>; | 935 using InstMIPS32Subu = InstMIPS32ThreeAddrGPR<InstMIPS32::Subu>; |
| 928 using InstMIPS32Sw = InstMIPS32Store<InstMIPS32::Sw>; | 936 using InstMIPS32Sw = InstMIPS32Store<InstMIPS32::Sw>; |
| 929 using InstMIPS32Swc1 = InstMIPS32Store<InstMIPS32::Swc1>; | 937 using InstMIPS32Swc1 = InstMIPS32Store<InstMIPS32::Swc1>; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; | 991 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; |
| 984 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; | 992 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; |
| 985 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; | 993 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; |
| 986 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; | 994 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; |
| 987 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; | 995 template <> void InstMIPS32Lui::emit(const Cfg *Func) const; |
| 988 | 996 |
| 989 } // end of namespace MIPS32 | 997 } // end of namespace MIPS32 |
| 990 } // end of namespace Ice | 998 } // end of namespace Ice |
| 991 | 999 |
| 992 #endif // SUBZERO_SRC_ICEINSTMIPS32_H | 1000 #endif // SUBZERO_SRC_ICEINSTMIPS32_H |
| OLD | NEW |