OLD | NEW |
1 //===- subzero/src/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===// | 1 //===- subzero/src/IceInstX8632.h - Low-level 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 // This file declares the InstX8632 and OperandX8632 classes and | 10 // This file declares the InstX8632 and OperandX8632 classes and |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Mov, | 161 Mov, |
162 Movp, | 162 Movp, |
163 Movq, | 163 Movq, |
164 Movsx, | 164 Movsx, |
165 Movzx, | 165 Movzx, |
166 Mul, | 166 Mul, |
167 Mulps, | 167 Mulps, |
168 Mulss, | 168 Mulss, |
169 Neg, | 169 Neg, |
170 Or, | 170 Or, |
| 171 Padd, |
171 Pand, | 172 Pand, |
172 Pcmpeq, | 173 Pcmpeq, |
173 Pcmpgt, | 174 Pcmpgt, |
| 175 Pmullw, |
| 176 Pmuludq, |
174 Pop, | 177 Pop, |
175 Push, | 178 Por, |
| 179 Pshufd, |
176 Psll, | 180 Psll, |
177 Psra, | 181 Psra, |
178 Psub, | 182 Psub, |
| 183 Push, |
179 Pxor, | 184 Pxor, |
180 Ret, | 185 Ret, |
181 Sar, | 186 Sar, |
182 Sbb, | 187 Sbb, |
183 Shl, | 188 Shl, |
184 Shld, | 189 Shld, |
185 Shr, | 190 Shr, |
186 Shrd, | 191 Shrd, |
| 192 Shufps, |
187 Sqrtss, | 193 Sqrtss, |
188 Store, | 194 Store, |
189 StoreQ, | 195 StoreQ, |
190 Sub, | 196 Sub, |
191 Subps, | 197 Subps, |
192 Subss, | 198 Subss, |
193 Test, | 199 Test, |
194 Ucomiss, | 200 Ucomiss, |
195 UD2, | 201 UD2, |
196 Xadd, | 202 Xadd, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 static const char *Opcode; | 454 static const char *Opcode; |
449 }; | 455 }; |
450 | 456 |
451 typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf; | 457 typedef InstX8632Unaryop<InstX8632::Bsf> InstX8632Bsf; |
452 typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr; | 458 typedef InstX8632Unaryop<InstX8632::Bsr> InstX8632Bsr; |
453 typedef InstX8632Unaryop<InstX8632::Sqrtss> InstX8632Sqrtss; | 459 typedef InstX8632Unaryop<InstX8632::Sqrtss> InstX8632Sqrtss; |
454 typedef InstX8632Binop<InstX8632::Add> InstX8632Add; | 460 typedef InstX8632Binop<InstX8632::Add> InstX8632Add; |
455 typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps; | 461 typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps; |
456 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc; | 462 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc; |
457 typedef InstX8632Binop<InstX8632::Addss> InstX8632Addss; | 463 typedef InstX8632Binop<InstX8632::Addss> InstX8632Addss; |
| 464 typedef InstX8632Binop<InstX8632::Padd> InstX8632Padd; |
458 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub; | 465 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub; |
459 typedef InstX8632Binop<InstX8632::Subps> InstX8632Subps; | 466 typedef InstX8632Binop<InstX8632::Subps> InstX8632Subps; |
460 typedef InstX8632Binop<InstX8632::Subss> InstX8632Subss; | 467 typedef InstX8632Binop<InstX8632::Subss> InstX8632Subss; |
461 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb; | 468 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb; |
462 typedef InstX8632Binop<InstX8632::Psub> InstX8632Psub; | 469 typedef InstX8632Binop<InstX8632::Psub> InstX8632Psub; |
463 typedef InstX8632Binop<InstX8632::And> InstX8632And; | 470 typedef InstX8632Binop<InstX8632::And> InstX8632And; |
464 typedef InstX8632Binop<InstX8632::Pand> InstX8632Pand; | 471 typedef InstX8632Binop<InstX8632::Pand> InstX8632Pand; |
465 typedef InstX8632Binop<InstX8632::Or> InstX8632Or; | 472 typedef InstX8632Binop<InstX8632::Or> InstX8632Or; |
| 473 typedef InstX8632Binop<InstX8632::Por> InstX8632Por; |
466 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor; | 474 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor; |
467 typedef InstX8632Binop<InstX8632::Pxor> InstX8632Pxor; | 475 typedef InstX8632Binop<InstX8632::Pxor> InstX8632Pxor; |
468 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul; | 476 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul; |
469 typedef InstX8632Binop<InstX8632::Mulps> InstX8632Mulps; | 477 typedef InstX8632Binop<InstX8632::Mulps> InstX8632Mulps; |
470 typedef InstX8632Binop<InstX8632::Mulss> InstX8632Mulss; | 478 typedef InstX8632Binop<InstX8632::Mulss> InstX8632Mulss; |
| 479 typedef InstX8632Binop<InstX8632::Pmullw> InstX8632Pmullw; |
| 480 typedef InstX8632Binop<InstX8632::Pmuludq> InstX8632Pmuludq; |
471 typedef InstX8632Binop<InstX8632::Divps> InstX8632Divps; | 481 typedef InstX8632Binop<InstX8632::Divps> InstX8632Divps; |
472 typedef InstX8632Binop<InstX8632::Divss> InstX8632Divss; | 482 typedef InstX8632Binop<InstX8632::Divss> InstX8632Divss; |
473 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl; | 483 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl; |
474 typedef InstX8632Binop<InstX8632::Psll> InstX8632Psll; | 484 typedef InstX8632Binop<InstX8632::Psll> InstX8632Psll; |
475 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr; | 485 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr; |
476 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar; | 486 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar; |
477 typedef InstX8632Binop<InstX8632::Psra> InstX8632Psra; | 487 typedef InstX8632Binop<InstX8632::Psra> InstX8632Psra; |
478 typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq; | 488 typedef InstX8632Binop<InstX8632::Pcmpeq> InstX8632Pcmpeq; |
479 typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt; | 489 typedef InstX8632Binop<InstX8632::Pcmpgt> InstX8632Pcmpgt; |
480 typedef InstX8632Ternop<InstX8632::Idiv> InstX8632Idiv; | 490 typedef InstX8632Ternop<InstX8632::Idiv> InstX8632Idiv; |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } | 987 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } |
978 | 988 |
979 private: | 989 private: |
980 InstX8632Push(Cfg *Func, Operand *Source, bool SuppressStackAdjustment); | 990 InstX8632Push(Cfg *Func, Operand *Source, bool SuppressStackAdjustment); |
981 InstX8632Push(const InstX8632Push &) LLVM_DELETED_FUNCTION; | 991 InstX8632Push(const InstX8632Push &) LLVM_DELETED_FUNCTION; |
982 InstX8632Push &operator=(const InstX8632Push &) LLVM_DELETED_FUNCTION; | 992 InstX8632Push &operator=(const InstX8632Push &) LLVM_DELETED_FUNCTION; |
983 bool SuppressStackAdjustment; | 993 bool SuppressStackAdjustment; |
984 virtual ~InstX8632Push() {} | 994 virtual ~InstX8632Push() {} |
985 }; | 995 }; |
986 | 996 |
| 997 // Pshufd - shuffle a vector of doublewords |
| 998 class InstX8632Pshufd : public InstX8632 { |
| 999 public: |
| 1000 static InstX8632Pshufd *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 1001 Operand *Source2) { |
| 1002 return new (Func->allocate<InstX8632Pshufd>()) |
| 1003 InstX8632Pshufd(Func, Dest, Source1, Source2); |
| 1004 } |
| 1005 virtual void emit(const Cfg *Func) const; |
| 1006 virtual void dump(const Cfg *Func) const; |
| 1007 static bool classof(const Inst *Inst) { return isClassof(Inst, Pshufd); } |
| 1008 |
| 1009 private: |
| 1010 InstX8632Pshufd(Cfg *Func, Variable *Dest, Operand *Source1, |
| 1011 Operand *Source2); |
| 1012 InstX8632Pshufd(const InstX8632Pshufd &) LLVM_DELETED_FUNCTION; |
| 1013 InstX8632Pshufd &operator=(const InstX8632Pshufd &) LLVM_DELETED_FUNCTION; |
| 1014 virtual ~InstX8632Pshufd() {} |
| 1015 static const char *Opcode; |
| 1016 }; |
| 1017 |
987 // Ret instruction. Currently only supports the "ret" version that | 1018 // Ret instruction. Currently only supports the "ret" version that |
988 // does not pop arguments. This instruction takes a Source operand | 1019 // does not pop arguments. This instruction takes a Source operand |
989 // (for non-void returning functions) for liveness analysis, though | 1020 // (for non-void returning functions) for liveness analysis, though |
990 // a FakeUse before the ret would do just as well. | 1021 // a FakeUse before the ret would do just as well. |
991 class InstX8632Ret : public InstX8632 { | 1022 class InstX8632Ret : public InstX8632 { |
992 public: | 1023 public: |
993 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { | 1024 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { |
994 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); | 1025 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); |
995 } | 1026 } |
996 virtual void emit(const Cfg *Func) const; | 1027 virtual void emit(const Cfg *Func) const; |
997 virtual void dump(const Cfg *Func) const; | 1028 virtual void dump(const Cfg *Func) const; |
998 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } | 1029 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } |
999 | 1030 |
1000 private: | 1031 private: |
1001 InstX8632Ret(Cfg *Func, Variable *Source); | 1032 InstX8632Ret(Cfg *Func, Variable *Source); |
1002 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; | 1033 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; |
1003 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; | 1034 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; |
1004 virtual ~InstX8632Ret() {} | 1035 virtual ~InstX8632Ret() {} |
1005 }; | 1036 }; |
1006 | 1037 |
| 1038 // Shufps - select from two vectors of floating point values |
| 1039 class InstX8632Shufps : public InstX8632 { |
| 1040 public: |
| 1041 static InstX8632Shufps *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 1042 Operand *Source2) { |
| 1043 return new (Func->allocate<InstX8632Shufps>()) |
| 1044 InstX8632Shufps(Func, Dest, Source1, Source2); |
| 1045 } |
| 1046 virtual void emit(const Cfg *Func) const; |
| 1047 virtual void dump(const Cfg *Func) const; |
| 1048 static bool classof(const Inst *Inst) { return isClassof(Inst, Shufps); } |
| 1049 |
| 1050 private: |
| 1051 InstX8632Shufps(Cfg *Func, Variable *Dest, Operand *Source1, |
| 1052 Operand *Source2); |
| 1053 InstX8632Shufps(const InstX8632Shufps &) LLVM_DELETED_FUNCTION; |
| 1054 InstX8632Shufps &operator=(const InstX8632Shufps &) LLVM_DELETED_FUNCTION; |
| 1055 virtual ~InstX8632Shufps() {} |
| 1056 static const char *Opcode; |
| 1057 }; |
| 1058 |
1007 // Exchanging Add instruction. Exchanges the first operand (destination | 1059 // Exchanging Add instruction. Exchanges the first operand (destination |
1008 // operand) with the second operand (source operand), then loads the sum | 1060 // operand) with the second operand (source operand), then loads the sum |
1009 // of the two values into the destination operand. The destination may be | 1061 // of the two values into the destination operand. The destination may be |
1010 // a register or memory, while the source must be a register. | 1062 // a register or memory, while the source must be a register. |
1011 // | 1063 // |
1012 // Both the dest and source are updated. The caller should then insert a | 1064 // Both the dest and source are updated. The caller should then insert a |
1013 // FakeDef to reflect the second udpate. | 1065 // FakeDef to reflect the second udpate. |
1014 class InstX8632Xadd : public InstX8632Lockable { | 1066 class InstX8632Xadd : public InstX8632Lockable { |
1015 public: | 1067 public: |
1016 static InstX8632Xadd *create(Cfg *Func, Operand *Dest, Variable *Source, | 1068 static InstX8632Xadd *create(Cfg *Func, Operand *Dest, Variable *Source, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 private: | 1100 private: |
1049 InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source); | 1101 InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source); |
1050 InstX8632Xchg(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; | 1102 InstX8632Xchg(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; |
1051 InstX8632Xchg &operator=(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; | 1103 InstX8632Xchg &operator=(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; |
1052 virtual ~InstX8632Xchg() {} | 1104 virtual ~InstX8632Xchg() {} |
1053 }; | 1105 }; |
1054 | 1106 |
1055 } // end of namespace Ice | 1107 } // end of namespace Ice |
1056 | 1108 |
1057 #endif // SUBZERO_SRC_ICEINSTX8632_H | 1109 #endif // SUBZERO_SRC_ICEINSTX8632_H |
OLD | NEW |