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

Side by Side Diff: src/IceInstX8632.h

Issue 1186713010: Subzero: Add more kinds of RMW lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactor the assembler for 8 integer arithmetic instructions Created 5 years, 6 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
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInstX8632.h - x86-32 machine instructions -*- C++ -*-===// 1 //===- subzero/src/IceInstX8632.h - x86-32 machine 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 class InstX8632 : public InstTarget { 169 class InstX8632 : public InstTarget {
170 InstX8632() = delete; 170 InstX8632() = delete;
171 InstX8632(const InstX8632 &) = delete; 171 InstX8632(const InstX8632 &) = delete;
172 InstX8632 &operator=(const InstX8632 &) = delete; 172 InstX8632 &operator=(const InstX8632 &) = delete;
173 173
174 public: 174 public:
175 enum InstKindX8632 { 175 enum InstKindX8632 {
176 k__Start = Inst::Target, 176 k__Start = Inst::Target,
177 Adc, 177 Adc,
178 AdcRMW,
178 Add, 179 Add,
179 AddRMW, 180 AddRMW,
180 Addps, 181 Addps,
181 Addss, 182 Addss,
182 Adjuststack, 183 Adjuststack,
183 And, 184 And,
185 AndRMW,
184 Blendvps, 186 Blendvps,
185 Br, 187 Br,
186 Bsf, 188 Bsf,
187 Bsr, 189 Bsr,
188 Bswap, 190 Bswap,
189 Call, 191 Call,
190 Cbwdq, 192 Cbwdq,
191 Cmov, 193 Cmov,
192 Cmpps, 194 Cmpps,
193 Cmpxchg, 195 Cmpxchg,
(...skipping 20 matching lines...) Expand all
214 Movq, 216 Movq,
215 MovssRegs, 217 MovssRegs,
216 Movsx, 218 Movsx,
217 Movzx, 219 Movzx,
218 Mul, 220 Mul,
219 Mulps, 221 Mulps,
220 Mulss, 222 Mulss,
221 Neg, 223 Neg,
222 Nop, 224 Nop,
223 Or, 225 Or,
226 OrRMW,
224 Padd, 227 Padd,
225 Pand, 228 Pand,
226 Pandn, 229 Pandn,
227 Pblendvb, 230 Pblendvb,
228 Pcmpeq, 231 Pcmpeq,
229 Pcmpgt, 232 Pcmpgt,
230 Pextr, 233 Pextr,
231 Pinsr, 234 Pinsr,
232 Pmull, 235 Pmull,
233 Pmuludq, 236 Pmuludq,
234 Pop, 237 Pop,
235 Por, 238 Por,
236 Pshufd, 239 Pshufd,
237 Psll, 240 Psll,
238 Psra, 241 Psra,
239 Psrl, 242 Psrl,
240 Psub, 243 Psub,
241 Push, 244 Push,
242 Pxor, 245 Pxor,
243 Ret, 246 Ret,
244 Rol, 247 Rol,
245 Sar, 248 Sar,
246 Sbb, 249 Sbb,
250 SbbRMW,
247 Setcc, 251 Setcc,
248 Shl, 252 Shl,
249 Shld, 253 Shld,
250 Shr, 254 Shr,
251 Shrd, 255 Shrd,
252 Shufps, 256 Shufps,
253 Sqrtss, 257 Sqrtss,
254 Store, 258 Store,
255 StoreP, 259 StoreP,
256 StoreQ, 260 StoreQ,
257 Sub, 261 Sub,
262 SubRMW,
258 Subps, 263 Subps,
259 Subss, 264 Subss,
260 Test, 265 Test,
261 Ucomiss, 266 Ucomiss,
262 UD2, 267 UD2,
263 Xadd, 268 Xadd,
264 Xchg, 269 Xchg,
265 Xor 270 Xor,
271 XorRMW
266 }; 272 };
267 273
268 static const char *getWidthString(Type Ty); 274 static const char *getWidthString(Type Ty);
269 static const char *getFldString(Type Ty); 275 static const char *getFldString(Type Ty);
270 static CondX86::BrCond getOppositeCondition(CondX86::BrCond Cond); 276 static CondX86::BrCond getOppositeCondition(CondX86::BrCond Cond);
271 void dump(const Cfg *Func) const override; 277 void dump(const Cfg *Func) const override;
272 278
273 // Shared emit routines for common forms of instructions. 279 // Shared emit routines for common forms of instructions.
274 // See the definition of emitTwoAddress() for a description of 280 // See the definition of emitTwoAddress() for a description of
275 // ShiftHack. 281 // ShiftHack.
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 typedef InstX8632Movlike<InstX8632::Mov> InstX8632Mov; 1102 typedef InstX8632Movlike<InstX8632::Mov> InstX8632Mov;
1097 // Move packed - copy 128 bit values between XMM registers, or mem128 1103 // Move packed - copy 128 bit values between XMM registers, or mem128
1098 // and XMM registers. 1104 // and XMM registers.
1099 typedef InstX8632Movlike<InstX8632::Movp> InstX8632Movp; 1105 typedef InstX8632Movlike<InstX8632::Movp> InstX8632Movp;
1100 // Movq - copy between XMM registers, or mem64 and XMM registers. 1106 // Movq - copy between XMM registers, or mem64 and XMM registers.
1101 typedef InstX8632Movlike<InstX8632::Movq> InstX8632Movq; 1107 typedef InstX8632Movlike<InstX8632::Movq> InstX8632Movq;
1102 typedef InstX8632BinopGPR<InstX8632::Add> InstX8632Add; 1108 typedef InstX8632BinopGPR<InstX8632::Add> InstX8632Add;
1103 typedef InstX8632BinopRMW<InstX8632::AddRMW> InstX8632AddRMW; 1109 typedef InstX8632BinopRMW<InstX8632::AddRMW> InstX8632AddRMW;
1104 typedef InstX8632BinopXmm<InstX8632::Addps, true> InstX8632Addps; 1110 typedef InstX8632BinopXmm<InstX8632::Addps, true> InstX8632Addps;
1105 typedef InstX8632BinopGPR<InstX8632::Adc> InstX8632Adc; 1111 typedef InstX8632BinopGPR<InstX8632::Adc> InstX8632Adc;
1112 typedef InstX8632BinopRMW<InstX8632::AdcRMW> InstX8632AdcRMW;
1106 typedef InstX8632BinopXmm<InstX8632::Addss, false> InstX8632Addss; 1113 typedef InstX8632BinopXmm<InstX8632::Addss, false> InstX8632Addss;
1107 typedef InstX8632BinopXmm<InstX8632::Padd, true> InstX8632Padd; 1114 typedef InstX8632BinopXmm<InstX8632::Padd, true> InstX8632Padd;
1108 typedef InstX8632BinopGPR<InstX8632::Sub> InstX8632Sub; 1115 typedef InstX8632BinopGPR<InstX8632::Sub> InstX8632Sub;
1116 typedef InstX8632BinopRMW<InstX8632::SubRMW> InstX8632SubRMW;
1109 typedef InstX8632BinopXmm<InstX8632::Subps, true> InstX8632Subps; 1117 typedef InstX8632BinopXmm<InstX8632::Subps, true> InstX8632Subps;
1110 typedef InstX8632BinopXmm<InstX8632::Subss, false> InstX8632Subss; 1118 typedef InstX8632BinopXmm<InstX8632::Subss, false> InstX8632Subss;
1111 typedef InstX8632BinopGPR<InstX8632::Sbb> InstX8632Sbb; 1119 typedef InstX8632BinopGPR<InstX8632::Sbb> InstX8632Sbb;
1120 typedef InstX8632BinopRMW<InstX8632::SbbRMW> InstX8632SbbRMW;
1112 typedef InstX8632BinopXmm<InstX8632::Psub, true> InstX8632Psub; 1121 typedef InstX8632BinopXmm<InstX8632::Psub, true> InstX8632Psub;
1113 typedef InstX8632BinopGPR<InstX8632::And> InstX8632And; 1122 typedef InstX8632BinopGPR<InstX8632::And> InstX8632And;
1123 typedef InstX8632BinopRMW<InstX8632::AndRMW> InstX8632AndRMW;
1114 typedef InstX8632BinopXmm<InstX8632::Pand, false> InstX8632Pand; 1124 typedef InstX8632BinopXmm<InstX8632::Pand, false> InstX8632Pand;
1115 typedef InstX8632BinopXmm<InstX8632::Pandn, false> InstX8632Pandn; 1125 typedef InstX8632BinopXmm<InstX8632::Pandn, false> InstX8632Pandn;
1116 typedef InstX8632BinopGPR<InstX8632::Or> InstX8632Or; 1126 typedef InstX8632BinopGPR<InstX8632::Or> InstX8632Or;
1127 typedef InstX8632BinopRMW<InstX8632::OrRMW> InstX8632OrRMW;
1117 typedef InstX8632BinopXmm<InstX8632::Por, false> InstX8632Por; 1128 typedef InstX8632BinopXmm<InstX8632::Por, false> InstX8632Por;
1118 typedef InstX8632BinopGPR<InstX8632::Xor> InstX8632Xor; 1129 typedef InstX8632BinopGPR<InstX8632::Xor> InstX8632Xor;
1130 typedef InstX8632BinopRMW<InstX8632::XorRMW> InstX8632XorRMW;
1119 typedef InstX8632BinopXmm<InstX8632::Pxor, false> InstX8632Pxor; 1131 typedef InstX8632BinopXmm<InstX8632::Pxor, false> InstX8632Pxor;
1120 typedef InstX8632BinopGPR<InstX8632::Imul> InstX8632Imul; 1132 typedef InstX8632BinopGPR<InstX8632::Imul> InstX8632Imul;
1121 typedef InstX8632BinopXmm<InstX8632::Mulps, true> InstX8632Mulps; 1133 typedef InstX8632BinopXmm<InstX8632::Mulps, true> InstX8632Mulps;
1122 typedef InstX8632BinopXmm<InstX8632::Mulss, false> InstX8632Mulss; 1134 typedef InstX8632BinopXmm<InstX8632::Mulss, false> InstX8632Mulss;
1123 typedef InstX8632BinopXmm<InstX8632::Pmull, true> InstX8632Pmull; 1135 typedef InstX8632BinopXmm<InstX8632::Pmull, true> InstX8632Pmull;
1124 typedef InstX8632BinopXmm<InstX8632::Pmuludq, false> InstX8632Pmuludq; 1136 typedef InstX8632BinopXmm<InstX8632::Pmuludq, false> InstX8632Pmuludq;
1125 typedef InstX8632BinopXmm<InstX8632::Divps, true> InstX8632Divps; 1137 typedef InstX8632BinopXmm<InstX8632::Divps, true> InstX8632Divps;
1126 typedef InstX8632BinopXmm<InstX8632::Divss, false> InstX8632Divss; 1138 typedef InstX8632BinopXmm<InstX8632::Divss, false> InstX8632Divss;
1127 typedef InstX8632BinopGPRShift<InstX8632::Rol> InstX8632Rol; 1139 typedef InstX8632BinopGPRShift<InstX8632::Rol> InstX8632Rol;
1128 typedef InstX8632BinopGPRShift<InstX8632::Shl> InstX8632Shl; 1140 typedef InstX8632BinopGPRShift<InstX8632::Shl> InstX8632Shl;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; 1801 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const;
1790 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; 1802 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const;
1791 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; 1803 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const;
1792 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; 1804 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const;
1793 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; 1805 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const;
1794 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; 1806 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const;
1795 1807
1796 } // end of namespace Ice 1808 } // end of namespace Ice
1797 1809
1798 #endif // SUBZERO_SRC_ICEINSTX8632_H 1810 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698