Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- C++ -*--===// | 1 //===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 Xor, | 142 Xor, |
| 143 Xorps, | 143 Xorps, |
| 144 XorRMW, | 144 XorRMW, |
| 145 | 145 |
| 146 /// Intel Architecture Code Analyzer markers. These are not executable so | 146 /// Intel Architecture Code Analyzer markers. These are not executable so |
| 147 /// must only be used for analysis. | 147 /// must only be used for analysis. |
| 148 IacaStart, | 148 IacaStart, |
| 149 IacaEnd | 149 IacaEnd |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 enum SseSuffix { None, Packed, Scalar, Integral }; | |
| 153 | |
| 152 static const char *getWidthString(Type Ty); | 154 static const char *getWidthString(Type Ty); |
| 153 static const char *getFldString(Type Ty); | 155 static const char *getFldString(Type Ty); |
| 154 static typename Traits::Cond::BrCond | 156 static typename Traits::Cond::BrCond |
| 155 getOppositeCondition(typename Traits::Cond::BrCond Cond); | 157 getOppositeCondition(typename Traits::Cond::BrCond Cond); |
| 156 void dump(const Cfg *Func) const override; | 158 void dump(const Cfg *Func) const override; |
| 157 | 159 |
| 158 // Shared emit routines for common forms of instructions. | 160 // Shared emit routines for common forms of instructions. |
| 159 static void emitTwoAddress(const char *Opcode, const Inst *Inst, | 161 void emitTwoAddress(const Cfg *Func, const char *Opcode, |
| 160 const Cfg *Func); | 162 const char *Suffix = nullptr) const; |
|
John
2015/12/17 21:07:51
optional: Suffix = "", then you can just
Str << O
sehr
2015/12/17 23:06:05
Done.
| |
| 161 | 163 |
| 162 static void | 164 static void |
| 163 emitIASGPRShift(const Cfg *Func, Type Ty, const Variable *Var, | 165 emitIASGPRShift(const Cfg *Func, Type Ty, const Variable *Var, |
| 164 const Operand *Src, | 166 const Operand *Src, |
| 165 const typename Traits::Assembler::GPREmitterShiftOp &Emitter); | 167 const typename Traits::Assembler::GPREmitterShiftOp &Emitter); |
| 166 | 168 |
| 167 static X86TargetLowering *getTarget(const Cfg *Func) { | 169 static X86TargetLowering *getTarget(const Cfg *Func) { |
| 168 return static_cast<X86TargetLowering *>(Func->getTarget()); | 170 return static_cast<X86TargetLowering *>(Func->getTarget()); |
| 169 } | 171 } |
| 170 | 172 |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 621 InstX86BaseBinopGPRShift(const InstX86BaseBinopGPRShift &) = delete; | 623 InstX86BaseBinopGPRShift(const InstX86BaseBinopGPRShift &) = delete; |
| 622 InstX86BaseBinopGPRShift & | 624 InstX86BaseBinopGPRShift & |
| 623 operator=(const InstX86BaseBinopGPRShift &) = delete; | 625 operator=(const InstX86BaseBinopGPRShift &) = delete; |
| 624 | 626 |
| 625 public: | 627 public: |
| 626 using Base = InstX86BaseBinopGPRShift<Machine, K>; | 628 using Base = InstX86BaseBinopGPRShift<Machine, K>; |
| 627 | 629 |
| 628 void emit(const Cfg *Func) const override { | 630 void emit(const Cfg *Func) const override { |
| 629 if (!BuildDefs::dump()) | 631 if (!BuildDefs::dump()) |
| 630 return; | 632 return; |
| 631 this->emitTwoAddress(Opcode, this, Func); | 633 this->emitTwoAddress(Func, Opcode); |
| 632 } | 634 } |
| 633 void emitIAS(const Cfg *Func) const override { | 635 void emitIAS(const Cfg *Func) const override { |
| 634 Type Ty = this->getDest()->getType(); | 636 Type Ty = this->getDest()->getType(); |
| 635 assert(this->getSrcSize() == 2); | 637 assert(this->getSrcSize() == 2); |
| 636 this->emitIASGPRShift(Func, Ty, this->getDest(), this->getSrc(1), Emitter); | 638 this->emitIASGPRShift(Func, Ty, this->getDest(), this->getSrc(1), Emitter); |
| 637 } | 639 } |
| 638 void dump(const Cfg *Func) const override { | 640 void dump(const Cfg *Func) const override { |
| 639 if (!BuildDefs::dump()) | 641 if (!BuildDefs::dump()) |
| 640 return; | 642 return; |
| 641 Ostream &Str = Func->getContext()->getStrDump(); | 643 Ostream &Str = Func->getContext()->getStrDump(); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 664 InstX86BaseBinopGPR() = delete; | 666 InstX86BaseBinopGPR() = delete; |
| 665 InstX86BaseBinopGPR(const InstX86BaseBinopGPR &) = delete; | 667 InstX86BaseBinopGPR(const InstX86BaseBinopGPR &) = delete; |
| 666 InstX86BaseBinopGPR &operator=(const InstX86BaseBinopGPR &) = delete; | 668 InstX86BaseBinopGPR &operator=(const InstX86BaseBinopGPR &) = delete; |
| 667 | 669 |
| 668 public: | 670 public: |
| 669 using Base = InstX86BaseBinopGPR<Machine, K>; | 671 using Base = InstX86BaseBinopGPR<Machine, K>; |
| 670 | 672 |
| 671 void emit(const Cfg *Func) const override { | 673 void emit(const Cfg *Func) const override { |
| 672 if (!BuildDefs::dump()) | 674 if (!BuildDefs::dump()) |
| 673 return; | 675 return; |
| 674 this->emitTwoAddress(Opcode, this, Func); | 676 this->emitTwoAddress(Func, Opcode); |
| 675 } | 677 } |
| 676 void emitIAS(const Cfg *Func) const override { | 678 void emitIAS(const Cfg *Func) const override { |
| 677 Type Ty = this->getDest()->getType(); | 679 Type Ty = this->getDest()->getType(); |
| 678 assert(this->getSrcSize() == 2); | 680 assert(this->getSrcSize() == 2); |
| 679 emitIASRegOpTyGPR<Machine>(Func, Ty, this->getDest(), this->getSrc(1), | 681 emitIASRegOpTyGPR<Machine>(Func, Ty, this->getDest(), this->getSrc(1), |
| 680 Emitter); | 682 Emitter); |
| 681 } | 683 } |
| 682 void dump(const Cfg *Func) const override { | 684 void dump(const Cfg *Func) const override { |
| 683 if (!BuildDefs::dump()) | 685 if (!BuildDefs::dump()) |
| 684 return; | 686 return; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 708 InstX86BaseBinopRMW() = delete; | 710 InstX86BaseBinopRMW() = delete; |
| 709 InstX86BaseBinopRMW(const InstX86BaseBinopRMW &) = delete; | 711 InstX86BaseBinopRMW(const InstX86BaseBinopRMW &) = delete; |
| 710 InstX86BaseBinopRMW &operator=(const InstX86BaseBinopRMW &) = delete; | 712 InstX86BaseBinopRMW &operator=(const InstX86BaseBinopRMW &) = delete; |
| 711 | 713 |
| 712 public: | 714 public: |
| 713 using Base = InstX86BaseBinopRMW<Machine, K>; | 715 using Base = InstX86BaseBinopRMW<Machine, K>; |
| 714 | 716 |
| 715 void emit(const Cfg *Func) const override { | 717 void emit(const Cfg *Func) const override { |
| 716 if (!BuildDefs::dump()) | 718 if (!BuildDefs::dump()) |
| 717 return; | 719 return; |
| 718 this->emitTwoAddress(Opcode, this, Func); | 720 this->emitTwoAddress(Func, Opcode); |
| 719 } | 721 } |
| 720 void emitIAS(const Cfg *Func) const override { | 722 void emitIAS(const Cfg *Func) const override { |
| 721 Type Ty = this->getSrc(0)->getType(); | 723 Type Ty = this->getSrc(0)->getType(); |
| 722 assert(this->getSrcSize() == 2); | 724 assert(this->getSrcSize() == 2); |
| 723 emitIASAsAddrOpTyGPR<Machine>(Func, Ty, this->getSrc(0), this->getSrc(1), | 725 emitIASAsAddrOpTyGPR<Machine>(Func, Ty, this->getSrc(0), this->getSrc(1), |
| 724 Emitter); | 726 Emitter); |
| 725 } | 727 } |
| 726 void dump(const Cfg *Func) const override { | 728 void dump(const Cfg *Func) const override { |
| 727 if (!BuildDefs::dump()) | 729 if (!BuildDefs::dump()) |
| 728 return; | 730 return; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 742 this->addSource(DestSrc0); | 744 this->addSource(DestSrc0); |
| 743 this->addSource(Src1); | 745 this->addSource(Src1); |
| 744 } | 746 } |
| 745 | 747 |
| 746 static const char *Opcode; | 748 static const char *Opcode; |
| 747 static const typename InstX86Base< | 749 static const typename InstX86Base< |
| 748 Machine>::Traits::Assembler::GPREmitterAddrOp Emitter; | 750 Machine>::Traits::Assembler::GPREmitterAddrOp Emitter; |
| 749 }; | 751 }; |
| 750 | 752 |
| 751 template <class Machine, typename InstX86Base<Machine>::InstKindX86 K, | 753 template <class Machine, typename InstX86Base<Machine>::InstKindX86 K, |
| 752 bool NeedsElementType> | 754 bool NeedsElementType, |
| 755 typename InstX86Base<Machine>::SseSuffix Suffix> | |
| 753 class InstX86BaseBinopXmm : public InstX86Base<Machine> { | 756 class InstX86BaseBinopXmm : public InstX86Base<Machine> { |
| 754 InstX86BaseBinopXmm() = delete; | 757 InstX86BaseBinopXmm() = delete; |
| 755 InstX86BaseBinopXmm(const InstX86BaseBinopXmm &) = delete; | 758 InstX86BaseBinopXmm(const InstX86BaseBinopXmm &) = delete; |
| 756 InstX86BaseBinopXmm &operator=(const InstX86BaseBinopXmm &) = delete; | 759 InstX86BaseBinopXmm &operator=(const InstX86BaseBinopXmm &) = delete; |
| 757 | 760 |
| 758 public: | 761 public: |
| 759 using Base = InstX86BaseBinopXmm<Machine, K, NeedsElementType>; | 762 using Base = InstX86BaseBinopXmm<Machine, K, NeedsElementType, Suffix>; |
| 760 | 763 |
| 761 void emit(const Cfg *Func) const override { | 764 void emit(const Cfg *Func) const override { |
| 762 if (!BuildDefs::dump()) | 765 if (!BuildDefs::dump()) |
| 763 return; | 766 return; |
| 764 this->validateVectorAddrMode(); | 767 this->validateVectorAddrMode(); |
| 765 this->emitTwoAddress(Opcode, this, Func); | 768 switch (Suffix) { |
| 769 case InstX86Base<Machine>::SseSuffix::None: | |
| 770 this->emitTwoAddress(Func, Opcode); | |
| 771 break; | |
| 772 case InstX86Base<Machine>::SseSuffix::Packed: { | |
| 773 const Type DestTy = this->getDest()->getType(); | |
| 774 this->emitTwoAddress( | |
| 775 Func, this->Opcode, | |
| 776 InstX86Base<Machine>::Traits::TypeAttributes[DestTy].PdPsString); | |
| 777 } break; | |
| 778 case InstX86Base<Machine>::SseSuffix::Scalar: { | |
| 779 const Type DestTy = this->getDest()->getType(); | |
| 780 this->emitTwoAddress( | |
| 781 Func, this->Opcode, | |
| 782 InstX86Base<Machine>::Traits::TypeAttributes[DestTy].SdSsString); | |
| 783 } break; | |
| 784 case InstX86Base<Machine>::SseSuffix::Integral: { | |
| 785 const Type DestTy = this->getDest()->getType(); | |
| 786 this->emitTwoAddress( | |
| 787 Func, this->Opcode, | |
| 788 InstX86Base<Machine>::Traits::TypeAttributes[DestTy].PackString); | |
| 789 } break; | |
| 790 } | |
| 766 } | 791 } |
| 767 void emitIAS(const Cfg *Func) const override { | 792 void emitIAS(const Cfg *Func) const override { |
| 768 this->validateVectorAddrMode(); | 793 this->validateVectorAddrMode(); |
| 769 Type Ty = this->getDest()->getType(); | 794 Type Ty = this->getDest()->getType(); |
| 770 if (NeedsElementType) | 795 if (NeedsElementType) |
| 771 Ty = typeElementType(Ty); | 796 Ty = typeElementType(Ty); |
| 772 assert(this->getSrcSize() == 2); | 797 assert(this->getSrcSize() == 2); |
| 773 emitIASRegOpTyXMM<Machine>(Func, Ty, this->getDest(), this->getSrc(1), | 798 emitIASRegOpTyXMM<Machine>(Func, Ty, this->getDest(), this->getSrc(1), |
| 774 Emitter); | 799 Emitter); |
| 775 } | 800 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 InstX86BaseBinopXmmShift & | 836 InstX86BaseBinopXmmShift & |
| 812 operator=(const InstX86BaseBinopXmmShift &) = delete; | 837 operator=(const InstX86BaseBinopXmmShift &) = delete; |
| 813 | 838 |
| 814 public: | 839 public: |
| 815 using Base = InstX86BaseBinopXmmShift<Machine, K, AllowAllTypes>; | 840 using Base = InstX86BaseBinopXmmShift<Machine, K, AllowAllTypes>; |
| 816 | 841 |
| 817 void emit(const Cfg *Func) const override { | 842 void emit(const Cfg *Func) const override { |
| 818 if (!BuildDefs::dump()) | 843 if (!BuildDefs::dump()) |
| 819 return; | 844 return; |
| 820 this->validateVectorAddrMode(); | 845 this->validateVectorAddrMode(); |
| 821 this->emitTwoAddress(Opcode, this, Func); | 846 // Shift operations are always integral, and hence always need a suffix. |
| 847 const Type DestTy = this->getDest()->getType(); | |
| 848 this->emitTwoAddress( | |
| 849 Func, this->Opcode, | |
| 850 InstX86Base<Machine>::Traits::TypeAttributes[DestTy].PackString); | |
| 822 } | 851 } |
| 823 void emitIAS(const Cfg *Func) const override { | 852 void emitIAS(const Cfg *Func) const override { |
| 824 this->validateVectorAddrMode(); | 853 this->validateVectorAddrMode(); |
| 825 Type Ty = this->getDest()->getType(); | 854 Type Ty = this->getDest()->getType(); |
| 826 assert(AllowAllTypes || isVectorType(Ty)); | 855 assert(AllowAllTypes || isVectorType(Ty)); |
| 827 Type ElementTy = typeElementType(Ty); | 856 Type ElementTy = typeElementType(Ty); |
| 828 assert(this->getSrcSize() == 2); | 857 assert(this->getSrcSize() == 2); |
| 829 emitIASXmmShift<Machine>(Func, ElementTy, this->getDest(), this->getSrc(1), | 858 emitIASXmmShift<Machine>(Func, ElementTy, this->getDest(), this->getSrc(1), |
| 830 Emitter); | 859 Emitter); |
| 831 } | 860 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1247 private: | 1276 private: |
| 1248 InstX86AddRMW(Cfg *Func, | 1277 InstX86AddRMW(Cfg *Func, |
| 1249 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1278 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1250 Operand *Src1) | 1279 Operand *Src1) |
| 1251 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AddRMW>( | 1280 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AddRMW>( |
| 1252 Func, DestSrc0, Src1) {} | 1281 Func, DestSrc0, Src1) {} |
| 1253 }; | 1282 }; |
| 1254 | 1283 |
| 1255 template <class Machine> | 1284 template <class Machine> |
| 1256 class InstX86Addps | 1285 class InstX86Addps |
| 1257 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addps, true> { | 1286 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addps, true, |
| 1287 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1258 public: | 1288 public: |
| 1259 static InstX86Addps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1289 static InstX86Addps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1260 return new (Func->allocate<InstX86Addps>()) | 1290 return new (Func->allocate<InstX86Addps>()) |
| 1261 InstX86Addps(Func, Dest, Source); | 1291 InstX86Addps(Func, Dest, Source); |
| 1262 } | 1292 } |
| 1263 | 1293 |
| 1264 private: | 1294 private: |
| 1265 InstX86Addps(Cfg *Func, Variable *Dest, Operand *Source) | 1295 InstX86Addps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1266 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addps, true>( | 1296 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addps, true, |
| 1267 Func, Dest, Source) {} | 1297 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1298 Source) {} | |
| 1268 }; | 1299 }; |
| 1269 | 1300 |
| 1270 template <class Machine> | 1301 template <class Machine> |
| 1271 class InstX86Adc | 1302 class InstX86Adc |
| 1272 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Adc> { | 1303 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Adc> { |
| 1273 public: | 1304 public: |
| 1274 static InstX86Adc *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1305 static InstX86Adc *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1275 return new (Func->allocate<InstX86Adc>()) InstX86Adc(Func, Dest, Source); | 1306 return new (Func->allocate<InstX86Adc>()) InstX86Adc(Func, Dest, Source); |
| 1276 } | 1307 } |
| 1277 | 1308 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1296 private: | 1327 private: |
| 1297 InstX86AdcRMW(Cfg *Func, | 1328 InstX86AdcRMW(Cfg *Func, |
| 1298 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1329 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1299 Operand *Src1) | 1330 Operand *Src1) |
| 1300 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AdcRMW>( | 1331 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AdcRMW>( |
| 1301 Func, DestSrc0, Src1) {} | 1332 Func, DestSrc0, Src1) {} |
| 1302 }; | 1333 }; |
| 1303 | 1334 |
| 1304 template <class Machine> | 1335 template <class Machine> |
| 1305 class InstX86Addss | 1336 class InstX86Addss |
| 1306 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addss, false> { | 1337 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addss, false, |
| 1338 InstX86Base<Machine>::SseSuffix::Scalar> { | |
| 1307 public: | 1339 public: |
| 1308 static InstX86Addss *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1340 static InstX86Addss *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1309 return new (Func->allocate<InstX86Addss>()) | 1341 return new (Func->allocate<InstX86Addss>()) |
| 1310 InstX86Addss(Func, Dest, Source); | 1342 InstX86Addss(Func, Dest, Source); |
| 1311 } | 1343 } |
| 1312 | 1344 |
| 1313 void emit(const Cfg *Func) const override; | |
| 1314 | |
| 1315 private: | 1345 private: |
| 1316 InstX86Addss(Cfg *Func, Variable *Dest, Operand *Source) | 1346 InstX86Addss(Cfg *Func, Variable *Dest, Operand *Source) |
| 1317 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addss, false>( | 1347 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Addss, false, |
| 1318 Func, Dest, Source) {} | 1348 InstX86Base<Machine>::SseSuffix::Scalar>(Func, Dest, |
| 1349 Source) {} | |
| 1319 }; | 1350 }; |
| 1320 | 1351 |
| 1321 template <class Machine> | 1352 template <class Machine> |
| 1322 class InstX86Padd | 1353 class InstX86Padd |
| 1323 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Padd, true> { | 1354 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Padd, true, |
| 1355 InstX86Base<Machine>::SseSuffix::Integral> { | |
| 1324 public: | 1356 public: |
| 1325 static InstX86Padd *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1357 static InstX86Padd *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1326 return new (Func->allocate<InstX86Padd>()) InstX86Padd(Func, Dest, Source); | 1358 return new (Func->allocate<InstX86Padd>()) InstX86Padd(Func, Dest, Source); |
| 1327 } | 1359 } |
| 1328 | 1360 |
| 1329 void emit(const Cfg *Func) const override; | |
| 1330 | |
| 1331 private: | 1361 private: |
| 1332 InstX86Padd(Cfg *Func, Variable *Dest, Operand *Source) | 1362 InstX86Padd(Cfg *Func, Variable *Dest, Operand *Source) |
| 1333 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Padd, true>( | 1363 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Padd, true, |
| 1364 InstX86Base<Machine>::SseSuffix::Integral>( | |
| 1334 Func, Dest, Source) {} | 1365 Func, Dest, Source) {} |
| 1335 }; | 1366 }; |
| 1336 | 1367 |
| 1337 template <class Machine> | 1368 template <class Machine> |
| 1338 class InstX86Sub | 1369 class InstX86Sub |
| 1339 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Sub> { | 1370 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Sub> { |
| 1340 public: | 1371 public: |
| 1341 static InstX86Sub *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1372 static InstX86Sub *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1342 return new (Func->allocate<InstX86Sub>()) InstX86Sub(Func, Dest, Source); | 1373 return new (Func->allocate<InstX86Sub>()) InstX86Sub(Func, Dest, Source); |
| 1343 } | 1374 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1363 private: | 1394 private: |
| 1364 InstX86SubRMW(Cfg *Func, | 1395 InstX86SubRMW(Cfg *Func, |
| 1365 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1396 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1366 Operand *Src1) | 1397 Operand *Src1) |
| 1367 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::SubRMW>( | 1398 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::SubRMW>( |
| 1368 Func, DestSrc0, Src1) {} | 1399 Func, DestSrc0, Src1) {} |
| 1369 }; | 1400 }; |
| 1370 | 1401 |
| 1371 template <class Machine> | 1402 template <class Machine> |
| 1372 class InstX86Subps | 1403 class InstX86Subps |
| 1373 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subps, true> { | 1404 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subps, true, |
| 1405 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1374 public: | 1406 public: |
| 1375 static InstX86Subps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1407 static InstX86Subps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1376 return new (Func->allocate<InstX86Subps>()) | 1408 return new (Func->allocate<InstX86Subps>()) |
| 1377 InstX86Subps(Func, Dest, Source); | 1409 InstX86Subps(Func, Dest, Source); |
| 1378 } | 1410 } |
| 1379 | 1411 |
| 1380 private: | 1412 private: |
| 1381 InstX86Subps(Cfg *Func, Variable *Dest, Operand *Source) | 1413 InstX86Subps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1382 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subps, true>( | 1414 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subps, true, |
| 1383 Func, Dest, Source) {} | 1415 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1416 Source) {} | |
| 1384 }; | 1417 }; |
| 1385 | 1418 |
| 1386 template <class Machine> | 1419 template <class Machine> |
| 1387 class InstX86Subss | 1420 class InstX86Subss |
| 1388 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subss, false> { | 1421 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subss, false, |
| 1422 InstX86Base<Machine>::SseSuffix::Scalar> { | |
| 1389 public: | 1423 public: |
| 1390 static InstX86Subss *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1424 static InstX86Subss *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1391 return new (Func->allocate<InstX86Subss>()) | 1425 return new (Func->allocate<InstX86Subss>()) |
| 1392 InstX86Subss(Func, Dest, Source); | 1426 InstX86Subss(Func, Dest, Source); |
| 1393 } | 1427 } |
| 1394 | 1428 |
| 1395 void emit(const Cfg *Func) const override; | |
| 1396 | |
| 1397 private: | 1429 private: |
| 1398 InstX86Subss(Cfg *Func, Variable *Dest, Operand *Source) | 1430 InstX86Subss(Cfg *Func, Variable *Dest, Operand *Source) |
| 1399 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subss, false>( | 1431 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Subss, false, |
| 1400 Func, Dest, Source) {} | 1432 InstX86Base<Machine>::SseSuffix::Scalar>(Func, Dest, |
| 1433 Source) {} | |
| 1401 }; | 1434 }; |
| 1402 | 1435 |
| 1403 template <class Machine> | 1436 template <class Machine> |
| 1404 class InstX86Sbb | 1437 class InstX86Sbb |
| 1405 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Sbb> { | 1438 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Sbb> { |
| 1406 public: | 1439 public: |
| 1407 static InstX86Sbb *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1440 static InstX86Sbb *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1408 return new (Func->allocate<InstX86Sbb>()) InstX86Sbb(Func, Dest, Source); | 1441 return new (Func->allocate<InstX86Sbb>()) InstX86Sbb(Func, Dest, Source); |
| 1409 } | 1442 } |
| 1410 | 1443 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1429 private: | 1462 private: |
| 1430 InstX86SbbRMW(Cfg *Func, | 1463 InstX86SbbRMW(Cfg *Func, |
| 1431 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1464 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1432 Operand *Src1) | 1465 Operand *Src1) |
| 1433 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::SbbRMW>( | 1466 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::SbbRMW>( |
| 1434 Func, DestSrc0, Src1) {} | 1467 Func, DestSrc0, Src1) {} |
| 1435 }; | 1468 }; |
| 1436 | 1469 |
| 1437 template <class Machine> | 1470 template <class Machine> |
| 1438 class InstX86Psub | 1471 class InstX86Psub |
| 1439 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Psub, true> { | 1472 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Psub, true, |
| 1473 InstX86Base<Machine>::SseSuffix::Integral> { | |
| 1440 public: | 1474 public: |
| 1441 static InstX86Psub *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1475 static InstX86Psub *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1442 return new (Func->allocate<InstX86Psub>()) InstX86Psub(Func, Dest, Source); | 1476 return new (Func->allocate<InstX86Psub>()) InstX86Psub(Func, Dest, Source); |
| 1443 } | 1477 } |
| 1444 | 1478 |
| 1445 void emit(const Cfg *Func) const override; | |
| 1446 | |
| 1447 private: | 1479 private: |
| 1448 InstX86Psub(Cfg *Func, Variable *Dest, Operand *Source) | 1480 InstX86Psub(Cfg *Func, Variable *Dest, Operand *Source) |
| 1449 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Psub, true>( | 1481 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Psub, true, |
| 1482 InstX86Base<Machine>::SseSuffix::Integral>( | |
| 1450 Func, Dest, Source) {} | 1483 Func, Dest, Source) {} |
| 1451 }; | 1484 }; |
| 1452 | 1485 |
| 1453 template <class Machine> | 1486 template <class Machine> |
| 1454 class InstX86And | 1487 class InstX86And |
| 1455 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::And> { | 1488 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::And> { |
| 1456 public: | 1489 public: |
| 1457 static InstX86And *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1490 static InstX86And *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1458 return new (Func->allocate<InstX86And>()) InstX86And(Func, Dest, Source); | 1491 return new (Func->allocate<InstX86And>()) InstX86And(Func, Dest, Source); |
| 1459 } | 1492 } |
| 1460 | 1493 |
| 1461 private: | 1494 private: |
| 1462 InstX86And(Cfg *Func, Variable *Dest, Operand *Source) | 1495 InstX86And(Cfg *Func, Variable *Dest, Operand *Source) |
| 1463 : InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::And>(Func, Dest, | 1496 : InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::And>(Func, Dest, |
| 1464 Source) {} | 1497 Source) {} |
| 1465 }; | 1498 }; |
| 1466 | 1499 |
| 1467 template <class Machine> | 1500 template <class Machine> |
| 1468 class InstX86Andnps | 1501 class InstX86Andnps |
| 1469 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andnps, true> { | 1502 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andnps, true, |
| 1503 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1470 public: | 1504 public: |
| 1471 static InstX86Andnps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1505 static InstX86Andnps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1472 return new (Func->allocate<InstX86Andnps>()) | 1506 return new (Func->allocate<InstX86Andnps>()) |
| 1473 InstX86Andnps(Func, Dest, Source); | 1507 InstX86Andnps(Func, Dest, Source); |
| 1474 } | 1508 } |
| 1475 | 1509 |
| 1476 void emit(const Cfg *Func) const override; | |
| 1477 | |
| 1478 private: | 1510 private: |
| 1479 InstX86Andnps(Cfg *Func, Variable *Dest, Operand *Source) | 1511 InstX86Andnps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1480 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andnps, true>( | 1512 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andnps, true, |
| 1481 Func, Dest, Source) {} | 1513 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1514 Source) {} | |
| 1482 }; | 1515 }; |
| 1483 | 1516 |
| 1484 template <class Machine> | 1517 template <class Machine> |
| 1485 class InstX86Andps | 1518 class InstX86Andps |
| 1486 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andps, true> { | 1519 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andps, true, |
| 1520 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1487 public: | 1521 public: |
| 1488 static InstX86Andps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1522 static InstX86Andps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1489 return new (Func->allocate<InstX86Andps>()) | 1523 return new (Func->allocate<InstX86Andps>()) |
| 1490 InstX86Andps(Func, Dest, Source); | 1524 InstX86Andps(Func, Dest, Source); |
| 1491 } | 1525 } |
| 1492 | 1526 |
| 1493 void emit(const Cfg *Func) const override; | |
| 1494 | |
| 1495 private: | 1527 private: |
| 1496 InstX86Andps(Cfg *Func, Variable *Dest, Operand *Source) | 1528 InstX86Andps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1497 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andps, true>( | 1529 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Andps, true, |
| 1498 Func, Dest, Source) {} | 1530 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1531 Source) {} | |
| 1499 }; | 1532 }; |
| 1500 | 1533 |
| 1501 template <class Machine> | 1534 template <class Machine> |
| 1502 class InstX86AndRMW | 1535 class InstX86AndRMW |
| 1503 : public InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AndRMW> { | 1536 : public InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AndRMW> { |
| 1504 public: | 1537 public: |
| 1505 static InstX86AndRMW * | 1538 static InstX86AndRMW * |
| 1506 create(Cfg *Func, | 1539 create(Cfg *Func, |
| 1507 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1540 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1508 Operand *Src1) { | 1541 Operand *Src1) { |
| 1509 return new (Func->allocate<InstX86AndRMW>()) | 1542 return new (Func->allocate<InstX86AndRMW>()) |
| 1510 InstX86AndRMW(Func, DestSrc0, Src1); | 1543 InstX86AndRMW(Func, DestSrc0, Src1); |
| 1511 } | 1544 } |
| 1512 | 1545 |
| 1513 private: | 1546 private: |
| 1514 InstX86AndRMW(Cfg *Func, | 1547 InstX86AndRMW(Cfg *Func, |
| 1515 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1548 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1516 Operand *Src1) | 1549 Operand *Src1) |
| 1517 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AndRMW>( | 1550 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::AndRMW>( |
| 1518 Func, DestSrc0, Src1) {} | 1551 Func, DestSrc0, Src1) {} |
| 1519 }; | 1552 }; |
| 1520 | 1553 |
| 1521 template <class Machine> | 1554 template <class Machine> |
| 1522 class InstX86Pand | 1555 class InstX86Pand |
| 1523 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pand, false> { | 1556 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pand, false, |
| 1557 InstX86Base<Machine>::SseSuffix::None> { | |
| 1524 public: | 1558 public: |
| 1525 static InstX86Pand *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1559 static InstX86Pand *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1526 return new (Func->allocate<InstX86Pand>()) InstX86Pand(Func, Dest, Source); | 1560 return new (Func->allocate<InstX86Pand>()) InstX86Pand(Func, Dest, Source); |
| 1527 } | 1561 } |
| 1528 | 1562 |
| 1529 private: | 1563 private: |
| 1530 InstX86Pand(Cfg *Func, Variable *Dest, Operand *Source) | 1564 InstX86Pand(Cfg *Func, Variable *Dest, Operand *Source) |
| 1531 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pand, false>( | 1565 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pand, false, |
| 1532 Func, Dest, Source) {} | 1566 InstX86Base<Machine>::SseSuffix::None>(Func, Dest, |
| 1567 Source) {} | |
| 1533 }; | 1568 }; |
| 1534 | 1569 |
| 1535 template <class Machine> | 1570 template <class Machine> |
| 1536 class InstX86Pandn | 1571 class InstX86Pandn |
| 1537 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pandn, false> { | 1572 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pandn, false, |
| 1573 InstX86Base<Machine>::SseSuffix::None> { | |
| 1538 public: | 1574 public: |
| 1539 static InstX86Pandn *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1575 static InstX86Pandn *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1540 return new (Func->allocate<InstX86Pandn>()) | 1576 return new (Func->allocate<InstX86Pandn>()) |
| 1541 InstX86Pandn(Func, Dest, Source); | 1577 InstX86Pandn(Func, Dest, Source); |
| 1542 } | 1578 } |
| 1543 | 1579 |
| 1544 private: | 1580 private: |
| 1545 InstX86Pandn(Cfg *Func, Variable *Dest, Operand *Source) | 1581 InstX86Pandn(Cfg *Func, Variable *Dest, Operand *Source) |
| 1546 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pandn, false>( | 1582 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pandn, false, |
| 1547 Func, Dest, Source) {} | 1583 InstX86Base<Machine>::SseSuffix::None>(Func, Dest, |
| 1584 Source) {} | |
| 1548 }; | 1585 }; |
| 1549 | 1586 |
| 1550 template <class Machine> | 1587 template <class Machine> |
| 1551 class InstX86Maxss | 1588 class InstX86Maxss |
| 1552 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Maxss, true> { | 1589 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Maxss, true, |
| 1590 InstX86Base<Machine>::SseSuffix::Scalar> { | |
| 1553 public: | 1591 public: |
| 1554 static InstX86Maxss *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1592 static InstX86Maxss *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1555 return new (Func->allocate<InstX86Maxss>()) | 1593 return new (Func->allocate<InstX86Maxss>()) |
| 1556 InstX86Maxss(Func, Dest, Source); | 1594 InstX86Maxss(Func, Dest, Source); |
| 1557 } | 1595 } |
| 1558 | 1596 |
| 1559 void emit(const Cfg *Func) const override; | |
| 1560 | |
| 1561 private: | 1597 private: |
| 1562 InstX86Maxss(Cfg *Func, Variable *Dest, Operand *Source) | 1598 InstX86Maxss(Cfg *Func, Variable *Dest, Operand *Source) |
| 1563 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Maxss, true>( | 1599 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Maxss, true, |
| 1564 Func, Dest, Source) {} | 1600 InstX86Base<Machine>::SseSuffix::Scalar>(Func, Dest, |
| 1601 Source) {} | |
| 1565 }; | 1602 }; |
| 1566 | 1603 |
| 1567 template <class Machine> | 1604 template <class Machine> |
| 1568 class InstX86Minss | 1605 class InstX86Minss |
| 1569 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Minss, true> { | 1606 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Minss, true, |
| 1607 InstX86Base<Machine>::SseSuffix::Scalar> { | |
| 1570 public: | 1608 public: |
| 1571 static InstX86Minss *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1609 static InstX86Minss *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1572 return new (Func->allocate<InstX86Minss>()) | 1610 return new (Func->allocate<InstX86Minss>()) |
| 1573 InstX86Minss(Func, Dest, Source); | 1611 InstX86Minss(Func, Dest, Source); |
| 1574 } | 1612 } |
| 1575 | 1613 |
| 1576 void emit(const Cfg *Func) const override; | |
| 1577 | |
| 1578 private: | 1614 private: |
| 1579 InstX86Minss(Cfg *Func, Variable *Dest, Operand *Source) | 1615 InstX86Minss(Cfg *Func, Variable *Dest, Operand *Source) |
| 1580 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Minss, true>( | 1616 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Minss, true, |
| 1581 Func, Dest, Source) {} | 1617 InstX86Base<Machine>::SseSuffix::Scalar>(Func, Dest, |
| 1618 Source) {} | |
| 1582 }; | 1619 }; |
| 1583 | 1620 |
| 1584 template <class Machine> | 1621 template <class Machine> |
| 1585 class InstX86Or | 1622 class InstX86Or |
| 1586 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Or> { | 1623 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Or> { |
| 1587 public: | 1624 public: |
| 1588 static InstX86Or *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1625 static InstX86Or *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1589 return new (Func->allocate<InstX86Or>()) InstX86Or(Func, Dest, Source); | 1626 return new (Func->allocate<InstX86Or>()) InstX86Or(Func, Dest, Source); |
| 1590 } | 1627 } |
| 1591 | 1628 |
| 1592 private: | 1629 private: |
| 1593 InstX86Or(Cfg *Func, Variable *Dest, Operand *Source) | 1630 InstX86Or(Cfg *Func, Variable *Dest, Operand *Source) |
| 1594 : InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Or>(Func, Dest, | 1631 : InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Or>(Func, Dest, |
| 1595 Source) {} | 1632 Source) {} |
| 1596 }; | 1633 }; |
| 1597 | 1634 |
| 1598 template <class Machine> | 1635 template <class Machine> |
| 1599 class InstX86Orps | 1636 class InstX86Orps |
| 1600 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Orps, true> { | 1637 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Orps, true, |
| 1638 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1601 public: | 1639 public: |
| 1602 static InstX86Orps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1640 static InstX86Orps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1603 return new (Func->allocate<InstX86Orps>()) InstX86Orps(Func, Dest, Source); | 1641 return new (Func->allocate<InstX86Orps>()) InstX86Orps(Func, Dest, Source); |
| 1604 } | 1642 } |
| 1605 | 1643 |
| 1606 void emit(const Cfg *Func) const override; | |
| 1607 | |
| 1608 private: | 1644 private: |
| 1609 InstX86Orps(Cfg *Func, Variable *Dest, Operand *Source) | 1645 InstX86Orps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1610 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Orps, true>( | 1646 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Orps, true, |
| 1611 Func, Dest, Source) {} | 1647 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1648 Source) {} | |
| 1612 }; | 1649 }; |
| 1613 | 1650 |
| 1614 template <class Machine> | 1651 template <class Machine> |
| 1615 class InstX86OrRMW | 1652 class InstX86OrRMW |
| 1616 : public InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::OrRMW> { | 1653 : public InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::OrRMW> { |
| 1617 public: | 1654 public: |
| 1618 static InstX86OrRMW * | 1655 static InstX86OrRMW * |
| 1619 create(Cfg *Func, | 1656 create(Cfg *Func, |
| 1620 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1657 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1621 Operand *Src1) { | 1658 Operand *Src1) { |
| 1622 return new (Func->allocate<InstX86OrRMW>()) | 1659 return new (Func->allocate<InstX86OrRMW>()) |
| 1623 InstX86OrRMW(Func, DestSrc0, Src1); | 1660 InstX86OrRMW(Func, DestSrc0, Src1); |
| 1624 } | 1661 } |
| 1625 | 1662 |
| 1626 private: | 1663 private: |
| 1627 InstX86OrRMW(Cfg *Func, | 1664 InstX86OrRMW(Cfg *Func, |
| 1628 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1665 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1629 Operand *Src1) | 1666 Operand *Src1) |
| 1630 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::OrRMW>( | 1667 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::OrRMW>( |
| 1631 Func, DestSrc0, Src1) {} | 1668 Func, DestSrc0, Src1) {} |
| 1632 }; | 1669 }; |
| 1633 | 1670 |
| 1634 template <class Machine> | 1671 template <class Machine> |
| 1635 class InstX86Por | 1672 class InstX86Por |
| 1636 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Por, false> { | 1673 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Por, false, |
| 1674 InstX86Base<Machine>::SseSuffix::None> { | |
| 1637 public: | 1675 public: |
| 1638 static InstX86Por *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1676 static InstX86Por *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1639 return new (Func->allocate<InstX86Por>()) InstX86Por(Func, Dest, Source); | 1677 return new (Func->allocate<InstX86Por>()) InstX86Por(Func, Dest, Source); |
| 1640 } | 1678 } |
| 1641 | 1679 |
| 1642 private: | 1680 private: |
| 1643 InstX86Por(Cfg *Func, Variable *Dest, Operand *Source) | 1681 InstX86Por(Cfg *Func, Variable *Dest, Operand *Source) |
| 1644 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Por, false>( | 1682 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Por, false, |
| 1645 Func, Dest, Source) {} | 1683 InstX86Base<Machine>::SseSuffix::None>(Func, Dest, |
| 1684 Source) {} | |
| 1646 }; | 1685 }; |
| 1647 | 1686 |
| 1648 template <class Machine> | 1687 template <class Machine> |
| 1649 class InstX86Xor | 1688 class InstX86Xor |
| 1650 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Xor> { | 1689 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Xor> { |
| 1651 public: | 1690 public: |
| 1652 static InstX86Xor *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1691 static InstX86Xor *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1653 return new (Func->allocate<InstX86Xor>()) InstX86Xor(Func, Dest, Source); | 1692 return new (Func->allocate<InstX86Xor>()) InstX86Xor(Func, Dest, Source); |
| 1654 } | 1693 } |
| 1655 | 1694 |
| 1656 private: | 1695 private: |
| 1657 InstX86Xor(Cfg *Func, Variable *Dest, Operand *Source) | 1696 InstX86Xor(Cfg *Func, Variable *Dest, Operand *Source) |
| 1658 : InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Xor>(Func, Dest, | 1697 : InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Xor>(Func, Dest, |
| 1659 Source) {} | 1698 Source) {} |
| 1660 }; | 1699 }; |
| 1661 | 1700 |
| 1662 template <class Machine> | 1701 template <class Machine> |
| 1663 class InstX86Xorps | 1702 class InstX86Xorps |
| 1664 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Xorps, true> { | 1703 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Xorps, true, |
| 1704 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1665 public: | 1705 public: |
| 1666 static InstX86Xorps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1706 static InstX86Xorps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1667 return new (Func->allocate<InstX86Xorps>()) | 1707 return new (Func->allocate<InstX86Xorps>()) |
| 1668 InstX86Xorps(Func, Dest, Source); | 1708 InstX86Xorps(Func, Dest, Source); |
| 1669 } | 1709 } |
| 1670 | 1710 |
| 1671 void emit(const Cfg *Func) const override; | |
| 1672 | |
| 1673 private: | 1711 private: |
| 1674 InstX86Xorps(Cfg *Func, Variable *Dest, Operand *Source) | 1712 InstX86Xorps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1675 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Xorps, true>( | 1713 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Xorps, true, |
| 1676 Func, Dest, Source) {} | 1714 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1715 Source) {} | |
| 1677 }; | 1716 }; |
| 1678 | 1717 |
| 1679 template <class Machine> | 1718 template <class Machine> |
| 1680 class InstX86XorRMW | 1719 class InstX86XorRMW |
| 1681 : public InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::XorRMW> { | 1720 : public InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::XorRMW> { |
| 1682 public: | 1721 public: |
| 1683 static InstX86XorRMW * | 1722 static InstX86XorRMW * |
| 1684 create(Cfg *Func, | 1723 create(Cfg *Func, |
| 1685 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1724 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1686 Operand *Src1) { | 1725 Operand *Src1) { |
| 1687 return new (Func->allocate<InstX86XorRMW>()) | 1726 return new (Func->allocate<InstX86XorRMW>()) |
| 1688 InstX86XorRMW(Func, DestSrc0, Src1); | 1727 InstX86XorRMW(Func, DestSrc0, Src1); |
| 1689 } | 1728 } |
| 1690 | 1729 |
| 1691 private: | 1730 private: |
| 1692 InstX86XorRMW(Cfg *Func, | 1731 InstX86XorRMW(Cfg *Func, |
| 1693 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, | 1732 typename InstX86Base<Machine>::Traits::X86OperandMem *DestSrc0, |
| 1694 Operand *Src1) | 1733 Operand *Src1) |
| 1695 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::XorRMW>( | 1734 : InstX86BaseBinopRMW<Machine, InstX86Base<Machine>::XorRMW>( |
| 1696 Func, DestSrc0, Src1) {} | 1735 Func, DestSrc0, Src1) {} |
| 1697 }; | 1736 }; |
| 1698 | 1737 |
| 1699 template <class Machine> | 1738 template <class Machine> |
| 1700 class InstX86Pxor | 1739 class InstX86Pxor |
| 1701 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pxor, false> { | 1740 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pxor, false, |
| 1741 InstX86Base<Machine>::SseSuffix::None> { | |
| 1702 public: | 1742 public: |
| 1703 static InstX86Pxor *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1743 static InstX86Pxor *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1704 return new (Func->allocate<InstX86Pxor>()) InstX86Pxor(Func, Dest, Source); | 1744 return new (Func->allocate<InstX86Pxor>()) InstX86Pxor(Func, Dest, Source); |
| 1705 } | 1745 } |
| 1706 | 1746 |
| 1707 private: | 1747 private: |
| 1708 InstX86Pxor(Cfg *Func, Variable *Dest, Operand *Source) | 1748 InstX86Pxor(Cfg *Func, Variable *Dest, Operand *Source) |
| 1709 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pxor, false>( | 1749 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pxor, false, |
| 1710 Func, Dest, Source) {} | 1750 InstX86Base<Machine>::SseSuffix::None>(Func, Dest, |
| 1751 Source) {} | |
| 1711 }; | 1752 }; |
| 1712 | 1753 |
| 1713 template <class Machine> | 1754 template <class Machine> |
| 1714 class InstX86Imul | 1755 class InstX86Imul |
| 1715 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Imul> { | 1756 : public InstX86BaseBinopGPR<Machine, InstX86Base<Machine>::Imul> { |
| 1716 public: | 1757 public: |
| 1717 static InstX86Imul *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1758 static InstX86Imul *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1718 return new (Func->allocate<InstX86Imul>()) InstX86Imul(Func, Dest, Source); | 1759 return new (Func->allocate<InstX86Imul>()) InstX86Imul(Func, Dest, Source); |
| 1719 } | 1760 } |
| 1720 | 1761 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1741 void emitIAS(const Cfg *Func) const override; | 1782 void emitIAS(const Cfg *Func) const override; |
| 1742 | 1783 |
| 1743 private: | 1784 private: |
| 1744 InstX86ImulImm(Cfg *Func, Variable *Dest, Operand *Source0, Operand *Source1) | 1785 InstX86ImulImm(Cfg *Func, Variable *Dest, Operand *Source0, Operand *Source1) |
| 1745 : InstX86BaseThreeAddressop<Machine, InstX86Base<Machine>::ImulImm>( | 1786 : InstX86BaseThreeAddressop<Machine, InstX86Base<Machine>::ImulImm>( |
| 1746 Func, Dest, Source0, Source1) {} | 1787 Func, Dest, Source0, Source1) {} |
| 1747 }; | 1788 }; |
| 1748 | 1789 |
| 1749 template <class Machine> | 1790 template <class Machine> |
| 1750 class InstX86Mulps | 1791 class InstX86Mulps |
| 1751 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulps, true> { | 1792 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulps, true, |
| 1793 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1752 public: | 1794 public: |
| 1753 static InstX86Mulps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1795 static InstX86Mulps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1754 return new (Func->allocate<InstX86Mulps>()) | 1796 return new (Func->allocate<InstX86Mulps>()) |
| 1755 InstX86Mulps(Func, Dest, Source); | 1797 InstX86Mulps(Func, Dest, Source); |
| 1756 } | 1798 } |
| 1757 | 1799 |
| 1758 private: | 1800 private: |
| 1759 InstX86Mulps(Cfg *Func, Variable *Dest, Operand *Source) | 1801 InstX86Mulps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1760 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulps, true>( | 1802 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulps, true, |
| 1761 Func, Dest, Source) {} | 1803 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1804 Source) {} | |
| 1762 }; | 1805 }; |
| 1763 | 1806 |
| 1764 template <class Machine> | 1807 template <class Machine> |
| 1765 class InstX86Mulss | 1808 class InstX86Mulss |
| 1766 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulss, false> { | 1809 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulss, false, |
| 1810 InstX86Base<Machine>::SseSuffix::Scalar> { | |
| 1767 public: | 1811 public: |
| 1768 static InstX86Mulss *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1812 static InstX86Mulss *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1769 return new (Func->allocate<InstX86Mulss>()) | 1813 return new (Func->allocate<InstX86Mulss>()) |
| 1770 InstX86Mulss(Func, Dest, Source); | 1814 InstX86Mulss(Func, Dest, Source); |
| 1771 } | 1815 } |
| 1772 | 1816 |
| 1773 void emit(const Cfg *Func) const override; | |
| 1774 | |
| 1775 private: | 1817 private: |
| 1776 InstX86Mulss(Cfg *Func, Variable *Dest, Operand *Source) | 1818 InstX86Mulss(Cfg *Func, Variable *Dest, Operand *Source) |
| 1777 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulss, false>( | 1819 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Mulss, false, |
| 1778 Func, Dest, Source) {} | 1820 InstX86Base<Machine>::SseSuffix::Scalar>(Func, Dest, |
| 1821 Source) {} | |
| 1779 }; | 1822 }; |
| 1780 | 1823 |
| 1781 template <class Machine> | 1824 template <class Machine> |
| 1782 class InstX86Pmull | 1825 class InstX86Pmull |
| 1783 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmull, true> { | 1826 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmull, true, |
| 1827 InstX86Base<Machine>::SseSuffix::Integral> { | |
| 1784 public: | 1828 public: |
| 1785 static InstX86Pmull *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1829 static InstX86Pmull *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1830 bool TypesAreValid = | |
| 1831 Dest->getType() == IceType_v4i32 || Dest->getType() == IceType_v8i16; | |
| 1832 auto *Target = InstX86Base<Machine>::getTarget(Func); | |
| 1833 bool InstructionSetIsValid = | |
| 1834 Dest->getType() == IceType_v8i16 || | |
| 1835 Target->getInstructionSet() >= InstX86Base<Machine>::Traits::SSE4_1; | |
| 1836 (void)TypesAreValid; | |
| 1837 (void)InstructionSetIsValid; | |
| 1838 assert(TypesAreValid); | |
| 1839 assert(InstructionSetIsValid); | |
| 1786 return new (Func->allocate<InstX86Pmull>()) | 1840 return new (Func->allocate<InstX86Pmull>()) |
| 1787 InstX86Pmull(Func, Dest, Source); | 1841 InstX86Pmull(Func, Dest, Source); |
| 1788 } | 1842 } |
| 1789 | 1843 |
| 1790 void emit(const Cfg *Func) const override; | |
| 1791 void emitIAS(const Cfg *Func) const override; | |
| 1792 | |
| 1793 private: | 1844 private: |
| 1794 InstX86Pmull(Cfg *Func, Variable *Dest, Operand *Source) | 1845 InstX86Pmull(Cfg *Func, Variable *Dest, Operand *Source) |
| 1795 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmull, true>( | 1846 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmull, true, |
| 1847 InstX86Base<Machine>::SseSuffix::Integral>( | |
| 1796 Func, Dest, Source) {} | 1848 Func, Dest, Source) {} |
| 1797 }; | 1849 }; |
| 1798 | 1850 |
| 1799 template <class Machine> | 1851 template <class Machine> |
| 1800 class InstX86Pmuludq | 1852 class InstX86Pmuludq |
| 1801 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmuludq, | 1853 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmuludq, false, |
| 1802 false> { | 1854 InstX86Base<Machine>::SseSuffix::None> { |
| 1803 public: | 1855 public: |
| 1804 static InstX86Pmuludq *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1856 static InstX86Pmuludq *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1857 assert(Dest->getType() == IceType_v4i32 && | |
| 1858 Source->getType() == IceType_v4i32); | |
| 1805 return new (Func->allocate<InstX86Pmuludq>()) | 1859 return new (Func->allocate<InstX86Pmuludq>()) |
| 1806 InstX86Pmuludq(Func, Dest, Source); | 1860 InstX86Pmuludq(Func, Dest, Source); |
| 1807 } | 1861 } |
| 1808 | 1862 |
| 1809 void emit(const Cfg *Func) const override; | |
| 1810 | |
| 1811 private: | 1863 private: |
| 1812 InstX86Pmuludq(Cfg *Func, Variable *Dest, Operand *Source) | 1864 InstX86Pmuludq(Cfg *Func, Variable *Dest, Operand *Source) |
| 1813 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmuludq, false>( | 1865 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pmuludq, false, |
| 1814 Func, Dest, Source) {} | 1866 InstX86Base<Machine>::SseSuffix::None>(Func, Dest, |
| 1867 Source) {} | |
| 1815 }; | 1868 }; |
| 1816 | 1869 |
| 1817 template <class Machine> | 1870 template <class Machine> |
| 1818 class InstX86Divps | 1871 class InstX86Divps |
| 1819 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divps, true> { | 1872 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divps, true, |
| 1873 InstX86Base<Machine>::SseSuffix::Packed> { | |
| 1820 public: | 1874 public: |
| 1821 static InstX86Divps *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1875 static InstX86Divps *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1822 return new (Func->allocate<InstX86Divps>()) | 1876 return new (Func->allocate<InstX86Divps>()) |
| 1823 InstX86Divps(Func, Dest, Source); | 1877 InstX86Divps(Func, Dest, Source); |
| 1824 } | 1878 } |
| 1825 | 1879 |
| 1826 private: | 1880 private: |
| 1827 InstX86Divps(Cfg *Func, Variable *Dest, Operand *Source) | 1881 InstX86Divps(Cfg *Func, Variable *Dest, Operand *Source) |
| 1828 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divps, true>( | 1882 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divps, true, |
| 1829 Func, Dest, Source) {} | 1883 InstX86Base<Machine>::SseSuffix::Packed>(Func, Dest, |
| 1884 Source) {} | |
| 1830 }; | 1885 }; |
| 1831 | 1886 |
| 1832 template <class Machine> | 1887 template <class Machine> |
| 1833 class InstX86Divss | 1888 class InstX86Divss |
| 1834 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divss, false> { | 1889 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divss, false, |
| 1890 InstX86Base<Machine>::SseSuffix::Scalar> { | |
| 1835 public: | 1891 public: |
| 1836 static InstX86Divss *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1892 static InstX86Divss *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1837 return new (Func->allocate<InstX86Divss>()) | 1893 return new (Func->allocate<InstX86Divss>()) |
| 1838 InstX86Divss(Func, Dest, Source); | 1894 InstX86Divss(Func, Dest, Source); |
| 1839 } | 1895 } |
| 1840 | 1896 |
| 1841 void emit(const Cfg *Func) const override; | |
| 1842 | |
| 1843 private: | 1897 private: |
| 1844 InstX86Divss(Cfg *Func, Variable *Dest, Operand *Source) | 1898 InstX86Divss(Cfg *Func, Variable *Dest, Operand *Source) |
| 1845 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divss, false>( | 1899 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Divss, false, |
| 1846 Func, Dest, Source) {} | 1900 InstX86Base<Machine>::SseSuffix::Scalar>(Func, Dest, |
| 1901 Source) {} | |
| 1847 }; | 1902 }; |
| 1848 | 1903 |
| 1849 template <class Machine> | 1904 template <class Machine> |
| 1850 class InstX86Rol | 1905 class InstX86Rol |
| 1851 : public InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Rol> { | 1906 : public InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Rol> { |
| 1852 public: | 1907 public: |
| 1853 static InstX86Rol *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1908 static InstX86Rol *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1854 return new (Func->allocate<InstX86Rol>()) InstX86Rol(Func, Dest, Source); | 1909 return new (Func->allocate<InstX86Rol>()) InstX86Rol(Func, Dest, Source); |
| 1855 } | 1910 } |
| 1856 | 1911 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 1872 InstX86Shl(Cfg *Func, Variable *Dest, Operand *Source) | 1927 InstX86Shl(Cfg *Func, Variable *Dest, Operand *Source) |
| 1873 : InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Shl>(Func, Dest, | 1928 : InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Shl>(Func, Dest, |
| 1874 Source) {} | 1929 Source) {} |
| 1875 }; | 1930 }; |
| 1876 | 1931 |
| 1877 template <class Machine> | 1932 template <class Machine> |
| 1878 class InstX86Psll | 1933 class InstX86Psll |
| 1879 : public InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psll> { | 1934 : public InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psll> { |
| 1880 public: | 1935 public: |
| 1881 static InstX86Psll *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1936 static InstX86Psll *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1937 assert(Dest->getType() == IceType_v8i16 || | |
| 1938 Dest->getType() == IceType_v8i1 || | |
| 1939 Dest->getType() == IceType_v4i32 || Dest->getType() == IceType_v4i1); | |
| 1882 return new (Func->allocate<InstX86Psll>()) InstX86Psll(Func, Dest, Source); | 1940 return new (Func->allocate<InstX86Psll>()) InstX86Psll(Func, Dest, Source); |
| 1883 } | 1941 } |
| 1884 | 1942 |
| 1885 void emit(const Cfg *Func) const override; | |
| 1886 | |
| 1887 private: | 1943 private: |
| 1888 InstX86Psll(Cfg *Func, Variable *Dest, Operand *Source) | 1944 InstX86Psll(Cfg *Func, Variable *Dest, Operand *Source) |
| 1889 : InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psll>( | 1945 : InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psll>( |
| 1890 Func, Dest, Source) {} | 1946 Func, Dest, Source) {} |
| 1891 }; | 1947 }; |
| 1892 | 1948 |
| 1893 template <class Machine> | 1949 template <class Machine> |
| 1894 class InstX86Psrl | 1950 class InstX86Psrl |
| 1895 : public InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psrl, | 1951 : public InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psrl, |
| 1896 true> { | 1952 true> { |
| 1897 public: | 1953 public: |
| 1898 static InstX86Psrl *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1954 static InstX86Psrl *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1899 return new (Func->allocate<InstX86Psrl>()) InstX86Psrl(Func, Dest, Source); | 1955 return new (Func->allocate<InstX86Psrl>()) InstX86Psrl(Func, Dest, Source); |
| 1900 } | 1956 } |
| 1901 | 1957 |
| 1902 void emit(const Cfg *Func) const override; | |
| 1903 | |
| 1904 private: | 1958 private: |
| 1905 InstX86Psrl(Cfg *Func, Variable *Dest, Operand *Source) | 1959 InstX86Psrl(Cfg *Func, Variable *Dest, Operand *Source) |
| 1906 : InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psrl, true>( | 1960 : InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psrl, true>( |
| 1907 Func, Dest, Source) {} | 1961 Func, Dest, Source) {} |
| 1908 }; | 1962 }; |
| 1909 | 1963 |
| 1910 template <class Machine> | 1964 template <class Machine> |
| 1911 class InstX86Shr | 1965 class InstX86Shr |
| 1912 : public InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Shr> { | 1966 : public InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Shr> { |
| 1913 public: | 1967 public: |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1933 InstX86Sar(Cfg *Func, Variable *Dest, Operand *Source) | 1987 InstX86Sar(Cfg *Func, Variable *Dest, Operand *Source) |
| 1934 : InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Sar>(Func, Dest, | 1988 : InstX86BaseBinopGPRShift<Machine, InstX86Base<Machine>::Sar>(Func, Dest, |
| 1935 Source) {} | 1989 Source) {} |
| 1936 }; | 1990 }; |
| 1937 | 1991 |
| 1938 template <class Machine> | 1992 template <class Machine> |
| 1939 class InstX86Psra | 1993 class InstX86Psra |
| 1940 : public InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psra> { | 1994 : public InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psra> { |
| 1941 public: | 1995 public: |
| 1942 static InstX86Psra *create(Cfg *Func, Variable *Dest, Operand *Source) { | 1996 static InstX86Psra *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1997 assert(Dest->getType() == IceType_v8i16 || | |
| 1998 Dest->getType() == IceType_v8i1 || | |
| 1999 Dest->getType() == IceType_v4i32 || Dest->getType() == IceType_v4i1); | |
| 1943 return new (Func->allocate<InstX86Psra>()) InstX86Psra(Func, Dest, Source); | 2000 return new (Func->allocate<InstX86Psra>()) InstX86Psra(Func, Dest, Source); |
| 1944 } | 2001 } |
| 1945 | 2002 |
| 1946 void emit(const Cfg *Func) const override; | |
| 1947 | |
| 1948 private: | 2003 private: |
| 1949 InstX86Psra(Cfg *Func, Variable *Dest, Operand *Source) | 2004 InstX86Psra(Cfg *Func, Variable *Dest, Operand *Source) |
| 1950 : InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psra>( | 2005 : InstX86BaseBinopXmmShift<Machine, InstX86Base<Machine>::Psra>( |
| 1951 Func, Dest, Source) {} | 2006 Func, Dest, Source) {} |
| 1952 }; | 2007 }; |
| 1953 | 2008 |
| 1954 template <class Machine> | 2009 template <class Machine> |
| 1955 class InstX86Pcmpeq | 2010 class InstX86Pcmpeq |
| 1956 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpeq, true> { | 2011 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpeq, true, |
| 2012 InstX86Base<Machine>::SseSuffix::Integral> { | |
| 1957 public: | 2013 public: |
| 1958 static InstX86Pcmpeq *create(Cfg *Func, Variable *Dest, Operand *Source) { | 2014 static InstX86Pcmpeq *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1959 return new (Func->allocate<InstX86Pcmpeq>()) | 2015 return new (Func->allocate<InstX86Pcmpeq>()) |
| 1960 InstX86Pcmpeq(Func, Dest, Source); | 2016 InstX86Pcmpeq(Func, Dest, Source); |
| 1961 } | 2017 } |
| 1962 | 2018 |
| 1963 void emit(const Cfg *Func) const override; | |
| 1964 | |
| 1965 private: | 2019 private: |
| 1966 InstX86Pcmpeq(Cfg *Func, Variable *Dest, Operand *Source) | 2020 InstX86Pcmpeq(Cfg *Func, Variable *Dest, Operand *Source) |
| 1967 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpeq, true>( | 2021 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpeq, true, |
| 2022 InstX86Base<Machine>::SseSuffix::Integral>( | |
| 1968 Func, Dest, Source) {} | 2023 Func, Dest, Source) {} |
| 1969 }; | 2024 }; |
| 1970 | 2025 |
| 1971 template <class Machine> | 2026 template <class Machine> |
| 1972 class InstX86Pcmpgt | 2027 class InstX86Pcmpgt |
| 1973 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpgt, true> { | 2028 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpgt, true, |
| 2029 InstX86Base<Machine>::SseSuffix::Integral> { | |
| 1974 public: | 2030 public: |
| 1975 static InstX86Pcmpgt *create(Cfg *Func, Variable *Dest, Operand *Source) { | 2031 static InstX86Pcmpgt *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 1976 return new (Func->allocate<InstX86Pcmpgt>()) | 2032 return new (Func->allocate<InstX86Pcmpgt>()) |
| 1977 InstX86Pcmpgt(Func, Dest, Source); | 2033 InstX86Pcmpgt(Func, Dest, Source); |
| 1978 } | 2034 } |
| 1979 | 2035 |
| 1980 void emit(const Cfg *Func) const override; | |
| 1981 | |
| 1982 private: | 2036 private: |
| 1983 InstX86Pcmpgt(Cfg *Func, Variable *Dest, Operand *Source) | 2037 InstX86Pcmpgt(Cfg *Func, Variable *Dest, Operand *Source) |
| 1984 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpgt, true>( | 2038 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::Pcmpgt, true, |
| 2039 InstX86Base<Machine>::SseSuffix::Integral>( | |
| 1985 Func, Dest, Source) {} | 2040 Func, Dest, Source) {} |
| 1986 }; | 2041 }; |
| 1987 | 2042 |
| 1988 /// movss is only a binary operation when the source and dest operands are both | 2043 /// movss is only a binary operation when the source and dest operands are both |
| 1989 /// registers (the high bits of dest are left untouched). In other cases, it | 2044 /// registers (the high bits of dest are left untouched). In other cases, it |
| 1990 /// behaves like a copy (mov-like) operation (and the high bits of dest are | 2045 /// behaves like a copy (mov-like) operation (and the high bits of dest are |
| 1991 /// cleared). InstX86Movss will assert that both its source and dest operands | 2046 /// cleared). InstX86Movss will assert that both its source and dest operands |
| 1992 /// are registers, so the lowering code should use _mov instead of _movss in | 2047 /// are registers, so the lowering code should use _mov instead of _movss in |
| 1993 /// cases where a copy operation is intended. | 2048 /// cases where a copy operation is intended. |
| 1994 template <class Machine> | 2049 template <class Machine> |
| 1995 class InstX86MovssRegs | 2050 class InstX86MovssRegs |
| 1996 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::MovssRegs, | 2051 : public InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::MovssRegs, |
| 1997 false> { | 2052 false, InstX86Base<Machine>::SseSuffix::None> { |
| 1998 public: | 2053 public: |
| 1999 static InstX86MovssRegs *create(Cfg *Func, Variable *Dest, Operand *Source) { | 2054 static InstX86MovssRegs *create(Cfg *Func, Variable *Dest, Operand *Source) { |
| 2000 return new (Func->allocate<InstX86MovssRegs>()) | 2055 return new (Func->allocate<InstX86MovssRegs>()) |
| 2001 InstX86MovssRegs(Func, Dest, Source); | 2056 InstX86MovssRegs(Func, Dest, Source); |
| 2002 } | 2057 } |
| 2003 | 2058 |
| 2004 void emitIAS(const Cfg *Func) const override; | 2059 void emitIAS(const Cfg *Func) const override; |
| 2005 | 2060 |
| 2006 private: | 2061 private: |
| 2007 InstX86MovssRegs(Cfg *Func, Variable *Dest, Operand *Source) | 2062 InstX86MovssRegs(Cfg *Func, Variable *Dest, Operand *Source) |
| 2008 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::MovssRegs, false>( | 2063 : InstX86BaseBinopXmm<Machine, InstX86Base<Machine>::MovssRegs, false, |
| 2009 Func, Dest, Source) {} | 2064 InstX86Base<Machine>::SseSuffix::None>(Func, Dest, |
| 2065 Source) {} | |
| 2010 }; | 2066 }; |
| 2011 | 2067 |
| 2012 template <class Machine> | 2068 template <class Machine> |
| 2013 class InstX86Idiv | 2069 class InstX86Idiv |
| 2014 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Idiv> { | 2070 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Idiv> { |
| 2015 public: | 2071 public: |
| 2016 static InstX86Idiv *create(Cfg *Func, Variable *Dest, Operand *Source1, | 2072 static InstX86Idiv *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 2017 Operand *Source2) { | 2073 Operand *Source2) { |
| 2018 return new (Func->allocate<InstX86Idiv>()) | 2074 return new (Func->allocate<InstX86Idiv>()) |
| 2019 InstX86Idiv(Func, Dest, Source1, Source2); | 2075 InstX86Idiv(Func, Dest, Source1, Source2); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2064 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Insertps>( | 2120 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Insertps>( |
| 2065 Func, Dest, Source1, Source2) {} | 2121 Func, Dest, Source1, Source2) {} |
| 2066 }; | 2122 }; |
| 2067 | 2123 |
| 2068 template <class Machine> | 2124 template <class Machine> |
| 2069 class InstX86Pinsr | 2125 class InstX86Pinsr |
| 2070 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Pinsr> { | 2126 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Pinsr> { |
| 2071 public: | 2127 public: |
| 2072 static InstX86Pinsr *create(Cfg *Func, Variable *Dest, Operand *Source1, | 2128 static InstX86Pinsr *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 2073 Operand *Source2) { | 2129 Operand *Source2) { |
| 2130 // pinsrb and pinsrd are SSE4.1 instructions. | |
| 2131 assert(Dest->getType() == IceType_v8i16 || | |
| 2132 Dest->getType() == IceType_v8i1 || | |
| 2133 InstX86Base<Machine>::getTarget(Func)->getInstructionSet() >= | |
| 2134 InstX86Base<Machine>::Traits::SSE4_1); | |
| 2074 return new (Func->allocate<InstX86Pinsr>()) | 2135 return new (Func->allocate<InstX86Pinsr>()) |
| 2075 InstX86Pinsr(Func, Dest, Source1, Source2); | 2136 InstX86Pinsr(Func, Dest, Source1, Source2); |
| 2076 } | 2137 } |
| 2077 | 2138 |
| 2078 void emit(const Cfg *Func) const override; | 2139 void emit(const Cfg *Func) const override; |
| 2079 void emitIAS(const Cfg *Func) const override; | 2140 void emitIAS(const Cfg *Func) const override; |
| 2080 | 2141 |
| 2081 private: | 2142 private: |
| 2082 InstX86Pinsr(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) | 2143 InstX86Pinsr(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) |
| 2083 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Pinsr>( | 2144 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Pinsr>( |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 2101 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Shufps>( | 2162 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Shufps>( |
| 2102 Func, Dest, Source1, Source2) {} | 2163 Func, Dest, Source1, Source2) {} |
| 2103 }; | 2164 }; |
| 2104 | 2165 |
| 2105 template <class Machine> | 2166 template <class Machine> |
| 2106 class InstX86Blendvps | 2167 class InstX86Blendvps |
| 2107 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Blendvps> { | 2168 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Blendvps> { |
| 2108 public: | 2169 public: |
| 2109 static InstX86Blendvps *create(Cfg *Func, Variable *Dest, Operand *Source1, | 2170 static InstX86Blendvps *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 2110 Operand *Source2) { | 2171 Operand *Source2) { |
| 2172 assert(InstX86Base<Machine>::getTarget(Func)->getInstructionSet() >= | |
| 2173 InstX86Base<Machine>::Traits::SSE4_1); | |
| 2111 return new (Func->allocate<InstX86Blendvps>()) | 2174 return new (Func->allocate<InstX86Blendvps>()) |
| 2112 InstX86Blendvps(Func, Dest, Source1, Source2); | 2175 InstX86Blendvps(Func, Dest, Source1, Source2); |
| 2113 } | 2176 } |
| 2114 | 2177 |
| 2115 void emit(const Cfg *Func) const override; | 2178 void emit(const Cfg *Func) const override; |
| 2116 void emitIAS(const Cfg *Fund) const override; | 2179 void emitIAS(const Cfg *Fund) const override; |
| 2117 | 2180 |
| 2118 private: | 2181 private: |
| 2119 InstX86Blendvps(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) | 2182 InstX86Blendvps(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) |
| 2120 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Blendvps>( | 2183 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Blendvps>( |
| 2121 Func, Dest, Source1, Source2) {} | 2184 Func, Dest, Source1, Source2) {} |
| 2122 }; | 2185 }; |
| 2123 | 2186 |
| 2124 template <class Machine> | 2187 template <class Machine> |
| 2125 class InstX86Pblendvb | 2188 class InstX86Pblendvb |
| 2126 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Pblendvb> { | 2189 : public InstX86BaseTernop<Machine, InstX86Base<Machine>::Pblendvb> { |
| 2127 public: | 2190 public: |
| 2128 static InstX86Pblendvb *create(Cfg *Func, Variable *Dest, Operand *Source1, | 2191 static InstX86Pblendvb *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 2129 Operand *Source2) { | 2192 Operand *Source2) { |
| 2193 assert(InstX86Base<Machine>::getTarget(Func)->getInstructionSet() >= | |
| 2194 InstX86Base<Machine>::Traits::SSE4_1); | |
| 2130 return new (Func->allocate<InstX86Pblendvb>()) | 2195 return new (Func->allocate<InstX86Pblendvb>()) |
| 2131 InstX86Pblendvb(Func, Dest, Source1, Source2); | 2196 InstX86Pblendvb(Func, Dest, Source1, Source2); |
| 2132 } | 2197 } |
| 2133 | 2198 |
| 2134 void emit(const Cfg *Func) const override; | 2199 void emit(const Cfg *Func) const override; |
| 2135 void emitIAS(const Cfg *Func) const override; | 2200 void emitIAS(const Cfg *Func) const override; |
| 2136 | 2201 |
| 2137 private: | 2202 private: |
| 2138 InstX86Pblendvb(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) | 2203 InstX86Pblendvb(Cfg *Func, Variable *Dest, Operand *Source1, Operand *Source2) |
| 2139 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Pblendvb>( | 2204 : InstX86BaseTernop<Machine, InstX86Base<Machine>::Pblendvb>( |
| 2140 Func, Dest, Source1, Source2) {} | 2205 Func, Dest, Source1, Source2) {} |
| 2141 }; | 2206 }; |
| 2142 | 2207 |
| 2143 template <class Machine> | 2208 template <class Machine> |
| 2144 class InstX86Pextr | 2209 class InstX86Pextr |
| 2145 : public InstX86BaseThreeAddressop<Machine, InstX86Base<Machine>::Pextr> { | 2210 : public InstX86BaseThreeAddressop<Machine, InstX86Base<Machine>::Pextr> { |
| 2146 public: | 2211 public: |
| 2147 static InstX86Pextr *create(Cfg *Func, Variable *Dest, Operand *Source0, | 2212 static InstX86Pextr *create(Cfg *Func, Variable *Dest, Operand *Source0, |
| 2148 Operand *Source1) { | 2213 Operand *Source1) { |
| 2214 assert(Source0->getType() == IceType_v8i16 || | |
| 2215 Source0->getType() == IceType_v8i1 || | |
| 2216 InstX86Base<Machine>::getTarget(Func)->getInstructionSet() >= | |
| 2217 InstX86Base<Machine>::Traits::SSE4_1); | |
| 2149 return new (Func->allocate<InstX86Pextr>()) | 2218 return new (Func->allocate<InstX86Pextr>()) |
| 2150 InstX86Pextr(Func, Dest, Source0, Source1); | 2219 InstX86Pextr(Func, Dest, Source0, Source1); |
| 2151 } | 2220 } |
| 2152 | 2221 |
| 2153 void emit(const Cfg *Func) const override; | 2222 void emit(const Cfg *Func) const override; |
| 2154 void emitIAS(const Cfg *Func) const override; | 2223 void emitIAS(const Cfg *Func) const override; |
| 2155 | 2224 |
| 2156 private: | 2225 private: |
| 2157 InstX86Pextr(Cfg *Func, Variable *Dest, Operand *Source0, Operand *Source1) | 2226 InstX86Pextr(Cfg *Func, Variable *Dest, Operand *Source0, Operand *Source1) |
| 2158 : InstX86BaseThreeAddressop<Machine, InstX86Base<Machine>::Pextr>( | 2227 : InstX86BaseThreeAddressop<Machine, InstX86Base<Machine>::Pextr>( |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3365 &InstX86Base<Machine>::Traits::Assembler::psrl}; \ | 3434 &InstX86Base<Machine>::Traits::Assembler::psrl}; \ |
| 3366 } \ | 3435 } \ |
| 3367 } | 3436 } |
| 3368 | 3437 |
| 3369 } // end of namespace X86Internal | 3438 } // end of namespace X86Internal |
| 3370 } // end of namespace Ice | 3439 } // end of namespace Ice |
| 3371 | 3440 |
| 3372 #include "IceInstX86BaseImpl.h" | 3441 #include "IceInstX86BaseImpl.h" |
| 3373 | 3442 |
| 3374 #endif // SUBZERO_SRC_ICEINSTX86BASE_H | 3443 #endif // SUBZERO_SRC_ICEINSTX86BASE_H |
| OLD | NEW |