| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 InstX8632Label(const InstX8632Label &) = delete; | 315 InstX8632Label(const InstX8632Label &) = delete; |
| 316 InstX8632Label &operator=(const InstX8632Label &) = delete; | 316 InstX8632Label &operator=(const InstX8632Label &) = delete; |
| 317 | 317 |
| 318 public: | 318 public: |
| 319 static InstX8632Label *create(Cfg *Func, TargetX8632 *Target) { | 319 static InstX8632Label *create(Cfg *Func, TargetX8632 *Target) { |
| 320 return new (Func->allocate<InstX8632Label>()) InstX8632Label(Func, Target); | 320 return new (Func->allocate<InstX8632Label>()) InstX8632Label(Func, Target); |
| 321 } | 321 } |
| 322 uint32_t getEmitInstCount() const override { return 0; } | 322 uint32_t getEmitInstCount() const override { return 0; } |
| 323 IceString getName(const Cfg *Func) const; | 323 IceString getName(const Cfg *Func) const; |
| 324 void emit(const Cfg *Func) const override; | 324 void emit(const Cfg *Func) const override; |
| 325 // TODO(jvoung): Filler in. |
| 326 void emitIAS(const Cfg *Func) const override { emit(Func); } |
| 325 void dump(const Cfg *Func) const override; | 327 void dump(const Cfg *Func) const override; |
| 326 | 328 |
| 327 private: | 329 private: |
| 328 InstX8632Label(Cfg *Func, TargetX8632 *Target); | 330 InstX8632Label(Cfg *Func, TargetX8632 *Target); |
| 329 ~InstX8632Label() override {} | 331 ~InstX8632Label() override {} |
| 330 SizeT Number; // used only for unique label string generation | 332 SizeT Number; // used only for unique label string generation |
| 331 }; | 333 }; |
| 332 | 334 |
| 333 // Conditional and unconditional branch instruction. | 335 // Conditional and unconditional branch instruction. |
| 334 class InstX8632Br : public InstX8632 { | 336 class InstX8632Br : public InstX8632 { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 uint32_t Sum = 0; | 378 uint32_t Sum = 0; |
| 377 if (Label) | 379 if (Label) |
| 378 ++Sum; | 380 ++Sum; |
| 379 if (getTargetTrue()) | 381 if (getTargetTrue()) |
| 380 ++Sum; | 382 ++Sum; |
| 381 if (getTargetFalse()) | 383 if (getTargetFalse()) |
| 382 ++Sum; | 384 ++Sum; |
| 383 return Sum; | 385 return Sum; |
| 384 } | 386 } |
| 385 void emit(const Cfg *Func) const override; | 387 void emit(const Cfg *Func) const override; |
| 388 // TODO(jvoung): Filler in. |
| 389 void emitIAS(const Cfg *Func) const override { emit(Func); } |
| 386 void dump(const Cfg *Func) const override; | 390 void dump(const Cfg *Func) const override; |
| 387 static bool classof(const Inst *Inst) { return isClassof(Inst, Br); } | 391 static bool classof(const Inst *Inst) { return isClassof(Inst, Br); } |
| 388 | 392 |
| 389 private: | 393 private: |
| 390 InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, | 394 InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, |
| 391 const InstX8632Label *Label, CondX86::BrCond Condition); | 395 const InstX8632Label *Label, CondX86::BrCond Condition); |
| 392 ~InstX8632Br() override {} | 396 ~InstX8632Br() override {} |
| 393 CondX86::BrCond Condition; | 397 CondX86::BrCond Condition; |
| 394 const CfgNode *TargetTrue; | 398 const CfgNode *TargetTrue; |
| 395 const CfgNode *TargetFalse; | 399 const CfgNode *TargetFalse; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 422 InstX8632Call(const InstX8632Call &) = delete; | 426 InstX8632Call(const InstX8632Call &) = delete; |
| 423 InstX8632Call &operator=(const InstX8632Call &) = delete; | 427 InstX8632Call &operator=(const InstX8632Call &) = delete; |
| 424 | 428 |
| 425 public: | 429 public: |
| 426 static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { | 430 static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { |
| 427 return new (Func->allocate<InstX8632Call>()) | 431 return new (Func->allocate<InstX8632Call>()) |
| 428 InstX8632Call(Func, Dest, CallTarget); | 432 InstX8632Call(Func, Dest, CallTarget); |
| 429 } | 433 } |
| 430 Operand *getCallTarget() const { return getSrc(0); } | 434 Operand *getCallTarget() const { return getSrc(0); } |
| 431 void emit(const Cfg *Func) const override; | 435 void emit(const Cfg *Func) const override; |
| 436 void emitIAS(const Cfg *Func) const override; |
| 432 void dump(const Cfg *Func) const override; | 437 void dump(const Cfg *Func) const override; |
| 433 static bool classof(const Inst *Inst) { return isClassof(Inst, Call); } | 438 static bool classof(const Inst *Inst) { return isClassof(Inst, Call); } |
| 434 | 439 |
| 435 private: | 440 private: |
| 436 InstX8632Call(Cfg *Func, Variable *Dest, Operand *CallTarget); | 441 InstX8632Call(Cfg *Func, Variable *Dest, Operand *CallTarget); |
| 437 ~InstX8632Call() override {} | 442 ~InstX8632Call() override {} |
| 438 }; | 443 }; |
| 439 | 444 |
| 440 // Emit a one-operand (GPR) instruction. | 445 // Emit a one-operand (GPR) instruction. |
| 441 void emitIASOpTyGPR(const Cfg *Func, Type Ty, const Operand *Var, | 446 void emitIASOpTyGPR(const Cfg *Func, Type Ty, const Operand *Var, |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 class InstX8632Store : public InstX8632 { | 1272 class InstX8632Store : public InstX8632 { |
| 1268 InstX8632Store(const InstX8632Store &) = delete; | 1273 InstX8632Store(const InstX8632Store &) = delete; |
| 1269 InstX8632Store &operator=(const InstX8632Store &) = delete; | 1274 InstX8632Store &operator=(const InstX8632Store &) = delete; |
| 1270 | 1275 |
| 1271 public: | 1276 public: |
| 1272 static InstX8632Store *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { | 1277 static InstX8632Store *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { |
| 1273 return new (Func->allocate<InstX8632Store>()) | 1278 return new (Func->allocate<InstX8632Store>()) |
| 1274 InstX8632Store(Func, Value, Mem); | 1279 InstX8632Store(Func, Value, Mem); |
| 1275 } | 1280 } |
| 1276 void emit(const Cfg *Func) const override; | 1281 void emit(const Cfg *Func) const override; |
| 1282 void emitIAS(const Cfg *Func) const override; |
| 1277 void dump(const Cfg *Func) const override; | 1283 void dump(const Cfg *Func) const override; |
| 1278 static bool classof(const Inst *Inst) { return isClassof(Inst, Store); } | 1284 static bool classof(const Inst *Inst) { return isClassof(Inst, Store); } |
| 1279 | 1285 |
| 1280 private: | 1286 private: |
| 1281 InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem); | 1287 InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem); |
| 1282 ~InstX8632Store() override {} | 1288 ~InstX8632Store() override {} |
| 1283 }; | 1289 }; |
| 1284 | 1290 |
| 1285 // This is essentially a vector "mov" instruction with an OperandX8632Mem | 1291 // This is essentially a vector "mov" instruction with an OperandX8632Mem |
| 1286 // operand instead of Variable as the destination. It's important | 1292 // operand instead of Variable as the destination. It's important |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; | 1544 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; |
| 1539 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; | 1545 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; |
| 1540 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; | 1546 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; |
| 1541 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; | 1547 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; |
| 1542 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; | 1548 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; |
| 1543 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; | 1549 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; |
| 1544 | 1550 |
| 1545 } // end of namespace Ice | 1551 } // end of namespace Ice |
| 1546 | 1552 |
| 1547 #endif // SUBZERO_SRC_ICEINSTX8632_H | 1553 #endif // SUBZERO_SRC_ICEINSTX8632_H |
| OLD | NEW |