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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 k__Start = Inst::Target, | 120 k__Start = Inst::Target, |
121 Add, | 121 Add, |
122 Add_d, | 122 Add_d, |
123 Add_s, | 123 Add_s, |
124 Addiu, | 124 Addiu, |
125 Addu, | 125 Addu, |
126 And, | 126 And, |
127 Andi, | 127 Andi, |
128 Br, | 128 Br, |
129 Call, | 129 Call, |
| 130 Cvt_d_l, |
| 131 Cvt_d_s, |
| 132 Cvt_d_w, |
| 133 Cvt_s_d, |
| 134 Cvt_s_l, |
| 135 Cvt_s_w, |
130 Div, | 136 Div, |
131 Div_d, | 137 Div_d, |
132 Div_s, | 138 Div_s, |
133 Divu, | 139 Divu, |
134 La, | 140 La, |
135 Label, | 141 Label, |
| 142 Ldc1, |
136 Lui, | 143 Lui, |
| 144 Lw, |
| 145 Lwc1, |
137 Mfc1, | 146 Mfc1, |
138 Mfhi, | 147 Mfhi, |
139 Mflo, | 148 Mflo, |
140 Mov, // actually a pseudo op for addi rd, rs, 0 | 149 Mov, // actually a pseudo op for addi rd, rs, 0 |
141 Mov_d, | 150 Mov_d, |
142 Mov_s, | 151 Mov_s, |
143 Mtc1, | 152 Mtc1, |
144 Mthi, | 153 Mthi, |
145 Mtlo, | 154 Mtlo, |
146 Mul, | 155 Mul, |
147 Mul_d, | 156 Mul_d, |
148 Mul_s, | 157 Mul_s, |
149 Mult, | 158 Mult, |
150 Multu, | 159 Multu, |
151 Or, | 160 Or, |
152 Ori, | 161 Ori, |
153 Ret, | 162 Ret, |
| 163 Sdc1, |
154 Sll, | 164 Sll, |
155 Sllv, | 165 Sllv, |
156 Slt, | 166 Slt, |
157 Slti, | 167 Slti, |
158 Sltiu, | 168 Sltiu, |
159 Sltu, | 169 Sltu, |
160 Sra, | 170 Sra, |
161 Srav, | 171 Srav, |
162 Srl, | 172 Srl, |
163 Srlv, | 173 Srlv, |
164 Sub, | 174 Sub, |
165 Sub_d, | 175 Sub_d, |
166 Sub_s, | 176 Sub_s, |
167 Subu, | 177 Subu, |
168 Sw, | 178 Sw, |
| 179 Swc1, |
| 180 Trunc_l_d, |
| 181 Trunc_l_s, |
| 182 Trunc_w_d, |
| 183 Trunc_w_s, |
169 Xor, | 184 Xor, |
170 Xori | 185 Xori |
171 }; | 186 }; |
172 | 187 |
173 static const char *getWidthString(Type Ty); | 188 static const char *getWidthString(Type Ty); |
174 | 189 |
175 void dump(const Cfg *Func) const override; | 190 void dump(const Cfg *Func) const override; |
176 | 191 |
177 void dumpOpcode(Ostream &Str, const char *Opcode, Type Ty) const { | 192 void dumpOpcode(Ostream &Str, const char *Opcode, Type Ty) const { |
178 Str << Opcode << "." << Ty; | 193 Str << Opcode << "." << Ty; |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 const uint32_t Imm; | 716 const uint32_t Imm; |
702 }; | 717 }; |
703 | 718 |
704 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; | 719 using InstMIPS32Add = InstMIPS32ThreeAddrGPR<InstMIPS32::Add>; |
705 using InstMIPS32Add_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_d>; | 720 using InstMIPS32Add_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_d>; |
706 using InstMIPS32Add_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_s>; | 721 using InstMIPS32Add_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Add_s>; |
707 using InstMIPS32Addu = InstMIPS32ThreeAddrGPR<InstMIPS32::Addu>; | 722 using InstMIPS32Addu = InstMIPS32ThreeAddrGPR<InstMIPS32::Addu>; |
708 using InstMIPS32Addiu = InstMIPS32Imm16<InstMIPS32::Addiu, true>; | 723 using InstMIPS32Addiu = InstMIPS32Imm16<InstMIPS32::Addiu, true>; |
709 using InstMIPS32And = InstMIPS32ThreeAddrGPR<InstMIPS32::And>; | 724 using InstMIPS32And = InstMIPS32ThreeAddrGPR<InstMIPS32::And>; |
710 using InstMIPS32Andi = InstMIPS32Imm16<InstMIPS32::Andi>; | 725 using InstMIPS32Andi = InstMIPS32Imm16<InstMIPS32::Andi>; |
| 726 using InstMIPS32Cvt_d_s = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_s>; |
| 727 using InstMIPS32Cvt_d_l = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_l>; |
| 728 using InstMIPS32Cvt_d_w = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_d_w>; |
| 729 using InstMIPS32Cvt_s_d = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_s_d>; |
| 730 using InstMIPS32Cvt_s_l = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_s_l>; |
| 731 using InstMIPS32Cvt_s_w = InstMIPS32TwoAddrFPR<InstMIPS32::Cvt_s_w>; |
711 using InstMIPS32Div = InstMIPS32ThreeAddrGPR<InstMIPS32::Div>; | 732 using InstMIPS32Div = InstMIPS32ThreeAddrGPR<InstMIPS32::Div>; |
712 using InstMIPS32Div_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Div_d>; | 733 using InstMIPS32Div_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Div_d>; |
713 using InstMIPS32Div_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Div_s>; | 734 using InstMIPS32Div_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Div_s>; |
714 using InstMIPS32Divu = InstMIPS32ThreeAddrGPR<InstMIPS32::Divu>; | 735 using InstMIPS32Divu = InstMIPS32ThreeAddrGPR<InstMIPS32::Divu>; |
| 736 using InstMIPS32La = InstMIPS32UnaryopGPR<InstMIPS32::La>; |
| 737 using InstMIPS32Ldc1 = InstMIPS32Memory<InstMIPS32::Ldc1>; |
715 using InstMIPS32Lui = InstMIPS32Imm16<InstMIPS32::Lui>; | 738 using InstMIPS32Lui = InstMIPS32Imm16<InstMIPS32::Lui>; |
716 using InstMIPS32La = InstMIPS32UnaryopGPR<InstMIPS32::La>; | 739 using InstMIPS32Lw = InstMIPS32Memory<InstMIPS32::Lwc1>; |
| 740 using InstMIPS32Lwc1 = InstMIPS32Memory<InstMIPS32::Lwc1>; |
717 using InstMIPS32Mfc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mfc1>; | 741 using InstMIPS32Mfc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mfc1>; |
718 using InstMIPS32Mfhi = InstMIPS32UnaryopGPR<InstMIPS32::Mfhi>; | 742 using InstMIPS32Mfhi = InstMIPS32UnaryopGPR<InstMIPS32::Mfhi>; |
719 using InstMIPS32Mflo = InstMIPS32UnaryopGPR<InstMIPS32::Mflo>; | 743 using InstMIPS32Mflo = InstMIPS32UnaryopGPR<InstMIPS32::Mflo>; |
720 using InstMIPS32Mov_d = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_d>; | 744 using InstMIPS32Mov_d = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_d>; |
721 using InstMIPS32Mov_s = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_s>; | 745 using InstMIPS32Mov_s = InstMIPS32TwoAddrFPR<InstMIPS32::Mov_s>; |
722 using InstMIPS32Mtc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mtc1>; | 746 using InstMIPS32Mtc1 = InstMIPS32TwoAddrGPR<InstMIPS32::Mtc1>; |
723 using InstMIPS32Mthi = InstMIPS32UnaryopGPR<InstMIPS32::Mthi>; | 747 using InstMIPS32Mthi = InstMIPS32UnaryopGPR<InstMIPS32::Mthi>; |
724 using InstMIPS32Mtlo = InstMIPS32UnaryopGPR<InstMIPS32::Mtlo>; | 748 using InstMIPS32Mtlo = InstMIPS32UnaryopGPR<InstMIPS32::Mtlo>; |
725 using InstMIPS32Mul = InstMIPS32ThreeAddrGPR<InstMIPS32::Mul>; | 749 using InstMIPS32Mul = InstMIPS32ThreeAddrGPR<InstMIPS32::Mul>; |
726 using InstMIPS32Mul_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_d>; | 750 using InstMIPS32Mul_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_d>; |
727 using InstMIPS32Mul_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_s>; | 751 using InstMIPS32Mul_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Mul_s>; |
728 using InstMIPS32Mult = InstMIPS32ThreeAddrGPR<InstMIPS32::Mult>; | 752 using InstMIPS32Mult = InstMIPS32ThreeAddrGPR<InstMIPS32::Mult>; |
729 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>; | 753 using InstMIPS32Multu = InstMIPS32ThreeAddrGPR<InstMIPS32::Multu>; |
730 using InstMIPS32Or = InstMIPS32ThreeAddrGPR<InstMIPS32::Or>; | 754 using InstMIPS32Or = InstMIPS32ThreeAddrGPR<InstMIPS32::Or>; |
731 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; | 755 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; |
| 756 using InstMIPS32Sdc1 = InstMIPS32Memory<InstMIPS32::Sdc1>; |
732 using InstMIPS32Sll = InstMIPS32Imm16<InstMIPS32::Sll>; | 757 using InstMIPS32Sll = InstMIPS32Imm16<InstMIPS32::Sll>; |
733 using InstMIPS32Sllv = InstMIPS32ThreeAddrGPR<InstMIPS32::Sllv>; | 758 using InstMIPS32Sllv = InstMIPS32ThreeAddrGPR<InstMIPS32::Sllv>; |
734 using InstMIPS32Slt = InstMIPS32ThreeAddrGPR<InstMIPS32::Slt>; | 759 using InstMIPS32Slt = InstMIPS32ThreeAddrGPR<InstMIPS32::Slt>; |
735 using InstMIPS32Slti = InstMIPS32Imm16<InstMIPS32::Slti>; | 760 using InstMIPS32Slti = InstMIPS32Imm16<InstMIPS32::Slti>; |
736 using InstMIPS32Sltiu = InstMIPS32Imm16<InstMIPS32::Sltiu>; | 761 using InstMIPS32Sltiu = InstMIPS32Imm16<InstMIPS32::Sltiu>; |
737 using InstMIPS32Sltu = InstMIPS32ThreeAddrGPR<InstMIPS32::Sltu>; | 762 using InstMIPS32Sltu = InstMIPS32ThreeAddrGPR<InstMIPS32::Sltu>; |
738 using InstMIPS32Sra = InstMIPS32Imm16<InstMIPS32::Sra>; | 763 using InstMIPS32Sra = InstMIPS32Imm16<InstMIPS32::Sra>; |
739 using InstMIPS32Srav = InstMIPS32ThreeAddrGPR<InstMIPS32::Srav>; | 764 using InstMIPS32Srav = InstMIPS32ThreeAddrGPR<InstMIPS32::Srav>; |
740 using InstMIPS32Srl = InstMIPS32Imm16<InstMIPS32::Srl>; | 765 using InstMIPS32Srl = InstMIPS32Imm16<InstMIPS32::Srl>; |
741 using InstMIPS32Srlv = InstMIPS32ThreeAddrGPR<InstMIPS32::Srlv>; | 766 using InstMIPS32Srlv = InstMIPS32ThreeAddrGPR<InstMIPS32::Srlv>; |
742 using InstMIPS32Sub = InstMIPS32ThreeAddrGPR<InstMIPS32::Sub>; | 767 using InstMIPS32Sub = InstMIPS32ThreeAddrGPR<InstMIPS32::Sub>; |
743 using InstMIPS32Sub_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_d>; | 768 using InstMIPS32Sub_d = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_d>; |
744 using InstMIPS32Sub_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_s>; | 769 using InstMIPS32Sub_s = InstMIPS32ThreeAddrFPR<InstMIPS32::Sub_s>; |
745 using InstMIPS32Subu = InstMIPS32ThreeAddrGPR<InstMIPS32::Subu>; | 770 using InstMIPS32Subu = InstMIPS32ThreeAddrGPR<InstMIPS32::Subu>; |
746 using InstMIPS32Sw = InstMIPS32Memory<InstMIPS32::Sw>; | 771 using InstMIPS32Sw = InstMIPS32Memory<InstMIPS32::Sw>; |
| 772 using InstMIPS32Swc1 = InstMIPS32Memory<InstMIPS32::Swc1>; |
| 773 using InstMIPS32Trunc_l_d = InstMIPS32TwoAddrFPR<InstMIPS32::Trunc_l_d>; |
| 774 using InstMIPS32Trunc_l_s = InstMIPS32TwoAddrFPR<InstMIPS32::Trunc_l_s>; |
| 775 using InstMIPS32Trunc_w_d = InstMIPS32TwoAddrFPR<InstMIPS32::Trunc_w_d>; |
| 776 using InstMIPS32Trunc_w_s = InstMIPS32TwoAddrFPR<InstMIPS32::Trunc_w_s>; |
747 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; | 777 using InstMIPS32Ori = InstMIPS32Imm16<InstMIPS32::Ori>; |
748 using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>; | 778 using InstMIPS32Xor = InstMIPS32ThreeAddrGPR<InstMIPS32::Xor>; |
749 using InstMIPS32Xori = InstMIPS32Imm16<InstMIPS32::Xori>; | 779 using InstMIPS32Xori = InstMIPS32Imm16<InstMIPS32::Xori>; |
750 | 780 |
751 /// Handles (some of) vmov's various formats. | 781 /// Handles (some of) vmov's various formats. |
752 class InstMIPS32Mov final : public InstMIPS32 { | 782 class InstMIPS32Mov final : public InstMIPS32 { |
753 InstMIPS32Mov() = delete; | 783 InstMIPS32Mov() = delete; |
754 InstMIPS32Mov(const InstMIPS32Mov &) = delete; | 784 InstMIPS32Mov(const InstMIPS32Mov &) = delete; |
755 InstMIPS32Mov &operator=(const InstMIPS32Mov &) = delete; | 785 InstMIPS32Mov &operator=(const InstMIPS32Mov &) = delete; |
756 | 786 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; | 825 template <> void InstMIPS32Mfhi::emit(const Cfg *Func) const; |
796 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; | 826 template <> void InstMIPS32Mtlo::emit(const Cfg *Func) const; |
797 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; | 827 template <> void InstMIPS32Mthi::emit(const Cfg *Func) const; |
798 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; | 828 template <> void InstMIPS32Mult::emit(const Cfg *Func) const; |
799 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; | 829 template <> void InstMIPS32Multu::emit(const Cfg *Func) const; |
800 | 830 |
801 } // end of namespace MIPS32 | 831 } // end of namespace MIPS32 |
802 } // end of namespace Ice | 832 } // end of namespace Ice |
803 | 833 |
804 #endif // SUBZERO_SRC_ICEINSTMIPS32_H | 834 #endif // SUBZERO_SRC_ICEINSTMIPS32_H |
OLD | NEW |