Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: src/IceInstX8632.h

Issue 397833002: Lower the rest of the vector arithmetic operations. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Format crosstest.py Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Mov, 158 Mov,
159 Movp, 159 Movp,
160 Movq, 160 Movq,
161 Movsx, 161 Movsx,
162 Movzx, 162 Movzx,
163 Mul, 163 Mul,
164 Mulps, 164 Mulps,
165 Mulss, 165 Mulss,
166 Neg, 166 Neg,
167 Or, 167 Or,
168 Padd,
169 Pand,
170 Pmullw,
171 Pmuludq,
168 Pop, 172 Pop,
173 Por,
174 Pshufd,
175 Psub,
169 Push, 176 Push,
170 Pxor, 177 Pxor,
171 Ret, 178 Ret,
172 Sar, 179 Sar,
173 Sbb, 180 Sbb,
174 Shl, 181 Shl,
175 Shld, 182 Shld,
176 Shr, 183 Shr,
177 Shrd, 184 Shrd,
185 Shufps,
178 Sqrtss, 186 Sqrtss,
179 Store, 187 Store,
180 StoreQ, 188 StoreQ,
181 Sub, 189 Sub,
182 Subps, 190 Subps,
183 Subss, 191 Subss,
184 Test, 192 Test,
185 Ucomiss, 193 Ucomiss,
186 UD2, 194 UD2,
187 Xadd, 195 Xadd,
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 InstX8632Ternop &operator=(const InstX8632Ternop &) LLVM_DELETED_FUNCTION; 444 InstX8632Ternop &operator=(const InstX8632Ternop &) LLVM_DELETED_FUNCTION;
437 virtual ~InstX8632Ternop() {} 445 virtual ~InstX8632Ternop() {}
438 static const char *Opcode; 446 static const char *Opcode;
439 }; 447 };
440 448
441 typedef InstX8632Unaryop<InstX8632::Neg> InstX8632Neg; 449 typedef InstX8632Unaryop<InstX8632::Neg> InstX8632Neg;
442 typedef InstX8632Binop<InstX8632::Add> InstX8632Add; 450 typedef InstX8632Binop<InstX8632::Add> InstX8632Add;
443 typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps; 451 typedef InstX8632Binop<InstX8632::Addps> InstX8632Addps;
444 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc; 452 typedef InstX8632Binop<InstX8632::Adc> InstX8632Adc;
445 typedef InstX8632Binop<InstX8632::Addss> InstX8632Addss; 453 typedef InstX8632Binop<InstX8632::Addss> InstX8632Addss;
454 typedef InstX8632Binop<InstX8632::Padd> InstX8632Padd;
446 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub; 455 typedef InstX8632Binop<InstX8632::Sub> InstX8632Sub;
447 typedef InstX8632Binop<InstX8632::Subps> InstX8632Subps; 456 typedef InstX8632Binop<InstX8632::Subps> InstX8632Subps;
448 typedef InstX8632Binop<InstX8632::Subss> InstX8632Subss; 457 typedef InstX8632Binop<InstX8632::Subss> InstX8632Subss;
449 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb; 458 typedef InstX8632Binop<InstX8632::Sbb> InstX8632Sbb;
459 typedef InstX8632Binop<InstX8632::Psub> InstX8632Psub;
450 typedef InstX8632Binop<InstX8632::And> InstX8632And; 460 typedef InstX8632Binop<InstX8632::And> InstX8632And;
461 typedef InstX8632Binop<InstX8632::Pand> InstX8632Pand;
451 typedef InstX8632Binop<InstX8632::Or> InstX8632Or; 462 typedef InstX8632Binop<InstX8632::Or> InstX8632Or;
463 typedef InstX8632Binop<InstX8632::Por> InstX8632Por;
452 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor; 464 typedef InstX8632Binop<InstX8632::Xor> InstX8632Xor;
453 typedef InstX8632Binop<InstX8632::Pxor> InstX8632Pxor; 465 typedef InstX8632Binop<InstX8632::Pxor> InstX8632Pxor;
454 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul; 466 typedef InstX8632Binop<InstX8632::Imul> InstX8632Imul;
455 typedef InstX8632Binop<InstX8632::Mulps> InstX8632Mulps; 467 typedef InstX8632Binop<InstX8632::Mulps> InstX8632Mulps;
456 typedef InstX8632Binop<InstX8632::Mulss> InstX8632Mulss; 468 typedef InstX8632Binop<InstX8632::Mulss> InstX8632Mulss;
469 typedef InstX8632Binop<InstX8632::Pmullw> InstX8632Pmullw;
470 typedef InstX8632Binop<InstX8632::Pmuludq> InstX8632Pmuludq;
457 typedef InstX8632Binop<InstX8632::Divps> InstX8632Divps; 471 typedef InstX8632Binop<InstX8632::Divps> InstX8632Divps;
458 typedef InstX8632Binop<InstX8632::Divss> InstX8632Divss; 472 typedef InstX8632Binop<InstX8632::Divss> InstX8632Divss;
459 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl; 473 typedef InstX8632Binop<InstX8632::Shl, true> InstX8632Shl;
460 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr; 474 typedef InstX8632Binop<InstX8632::Shr, true> InstX8632Shr;
461 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar; 475 typedef InstX8632Binop<InstX8632::Sar, true> InstX8632Sar;
462 typedef InstX8632Ternop<InstX8632::Idiv> InstX8632Idiv; 476 typedef InstX8632Ternop<InstX8632::Idiv> InstX8632Idiv;
463 typedef InstX8632Ternop<InstX8632::Div> InstX8632Div; 477 typedef InstX8632Ternop<InstX8632::Div> InstX8632Div;
464 478
465 // Base class for a lockable x86-32 instruction (emits a locked prefix). 479 // Base class for a lockable x86-32 instruction (emits a locked prefix).
466 class InstX8632Lockable : public InstX8632 { 480 class InstX8632Lockable : public InstX8632 {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); } 935 static bool classof(const Inst *Inst) { return isClassof(Inst, Push); }
922 936
923 private: 937 private:
924 InstX8632Push(Cfg *Func, Operand *Source, bool SuppressStackAdjustment); 938 InstX8632Push(Cfg *Func, Operand *Source, bool SuppressStackAdjustment);
925 InstX8632Push(const InstX8632Push &) LLVM_DELETED_FUNCTION; 939 InstX8632Push(const InstX8632Push &) LLVM_DELETED_FUNCTION;
926 InstX8632Push &operator=(const InstX8632Push &) LLVM_DELETED_FUNCTION; 940 InstX8632Push &operator=(const InstX8632Push &) LLVM_DELETED_FUNCTION;
927 bool SuppressStackAdjustment; 941 bool SuppressStackAdjustment;
928 virtual ~InstX8632Push() {} 942 virtual ~InstX8632Push() {}
929 }; 943 };
930 944
945 // Pshufd - shuffle a vector of doublewords
946 class InstX8632Pshufd : public InstX8632 {
947 public:
948 static InstX8632Pshufd *create(Cfg *Func, Variable *Dest, Operand *Source1,
949 Operand *Source2) {
950 return new (Func->allocate<InstX8632Pshufd>())
951 InstX8632Pshufd(Func, Dest, Source1, Source2);
952 }
953 virtual void emit(const Cfg *Func) const;
954 virtual void dump(const Cfg *Func) const;
955 static bool classof(const Inst *Inst) { return isClassof(Inst, Pshufd); }
956
957 private:
958 InstX8632Pshufd(Cfg *Func, Variable *Dest, Operand *Source1,
959 Operand *Source2);
960 InstX8632Pshufd(const InstX8632Pshufd &) LLVM_DELETED_FUNCTION;
961 InstX8632Pshufd &operator=(const InstX8632Pshufd &) LLVM_DELETED_FUNCTION;
962 virtual ~InstX8632Pshufd() {}
963 static const char *Opcode;
964 };
965
931 // Ret instruction. Currently only supports the "ret" version that 966 // Ret instruction. Currently only supports the "ret" version that
932 // does not pop arguments. This instruction takes a Source operand 967 // does not pop arguments. This instruction takes a Source operand
933 // (for non-void returning functions) for liveness analysis, though 968 // (for non-void returning functions) for liveness analysis, though
934 // a FakeUse before the ret would do just as well. 969 // a FakeUse before the ret would do just as well.
935 class InstX8632Ret : public InstX8632 { 970 class InstX8632Ret : public InstX8632 {
936 public: 971 public:
937 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { 972 static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) {
938 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); 973 return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source);
939 } 974 }
940 virtual void emit(const Cfg *Func) const; 975 virtual void emit(const Cfg *Func) const;
941 virtual void dump(const Cfg *Func) const; 976 virtual void dump(const Cfg *Func) const;
942 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); } 977 static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); }
943 978
944 private: 979 private:
945 InstX8632Ret(Cfg *Func, Variable *Source); 980 InstX8632Ret(Cfg *Func, Variable *Source);
946 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION; 981 InstX8632Ret(const InstX8632Ret &) LLVM_DELETED_FUNCTION;
947 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION; 982 InstX8632Ret &operator=(const InstX8632Ret &) LLVM_DELETED_FUNCTION;
948 virtual ~InstX8632Ret() {} 983 virtual ~InstX8632Ret() {}
949 }; 984 };
950 985
986 // Shufps - select from two vectors of floating point values
987 class InstX8632Shufps : public InstX8632 {
988 public:
989 static InstX8632Shufps *create(Cfg *Func, Variable *Dest, Operand *Source1,
990 Operand *Source2) {
991 return new (Func->allocate<InstX8632Shufps>())
992 InstX8632Shufps(Func, Dest, Source1, Source2);
993 }
994 virtual void emit(const Cfg *Func) const;
995 virtual void dump(const Cfg *Func) const;
996 static bool classof(const Inst *Inst) { return isClassof(Inst, Shufps); }
997
998 private:
999 InstX8632Shufps(Cfg *Func, Variable *Dest, Operand *Source1,
1000 Operand *Source2);
1001 InstX8632Shufps(const InstX8632Shufps &) LLVM_DELETED_FUNCTION;
1002 InstX8632Shufps &operator=(const InstX8632Shufps &) LLVM_DELETED_FUNCTION;
1003 virtual ~InstX8632Shufps() {}
1004 static const char *Opcode;
1005 };
1006
951 // Sqrtss - Scalar sqrt of a float or double. 1007 // Sqrtss - Scalar sqrt of a float or double.
952 class InstX8632Sqrtss : public InstX8632 { 1008 class InstX8632Sqrtss : public InstX8632 {
953 public: 1009 public:
954 static InstX8632Sqrtss *create(Cfg *Func, Variable *Dest, Operand *Source) { 1010 static InstX8632Sqrtss *create(Cfg *Func, Variable *Dest, Operand *Source) {
955 return new (Func->allocate<InstX8632Sqrtss>()) 1011 return new (Func->allocate<InstX8632Sqrtss>())
956 InstX8632Sqrtss(Func, Dest, Source); 1012 InstX8632Sqrtss(Func, Dest, Source);
957 } 1013 }
958 virtual void emit(const Cfg *Func) const; 1014 virtual void emit(const Cfg *Func) const;
959 virtual void dump(const Cfg *Func) const; 1015 virtual void dump(const Cfg *Func) const;
960 static bool classof(const Inst *Inst) { return isClassof(Inst, Sqrtss); } 1016 static bool classof(const Inst *Inst) { return isClassof(Inst, Sqrtss); }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 private: 1066 private:
1011 InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source); 1067 InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source);
1012 InstX8632Xchg(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; 1068 InstX8632Xchg(const InstX8632Xchg &) LLVM_DELETED_FUNCTION;
1013 InstX8632Xchg &operator=(const InstX8632Xchg &) LLVM_DELETED_FUNCTION; 1069 InstX8632Xchg &operator=(const InstX8632Xchg &) LLVM_DELETED_FUNCTION;
1014 virtual ~InstX8632Xchg() {} 1070 virtual ~InstX8632Xchg() {}
1015 }; 1071 };
1016 1072
1017 } // end of namespace Ice 1073 } // end of namespace Ice
1018 1074
1019 #endif // SUBZERO_SRC_ICEINSTX8632_H 1075 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698