| OLD | NEW |
| 1 //===- subzero/src/IceInst.h - High-level instructions ----------*- C++ -*-===// | 1 //===- subzero/src/IceInst.h - High-level 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 Inst class and its target-independent | 10 // This file declares the Inst class and its target-independent |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 public: | 34 public: |
| 35 enum InstKind { | 35 enum InstKind { |
| 36 // Arbitrary (alphabetical) order, except put Unreachable first. | 36 // Arbitrary (alphabetical) order, except put Unreachable first. |
| 37 Unreachable, | 37 Unreachable, |
| 38 Alloca, | 38 Alloca, |
| 39 Arithmetic, | 39 Arithmetic, |
| 40 Assign, // not part of LLVM/PNaCl bitcode | 40 Assign, // not part of LLVM/PNaCl bitcode |
| 41 Br, | 41 Br, |
| 42 Call, | 42 Call, |
| 43 Cast, | 43 Cast, |
| 44 ExtractElement, |
| 44 Fcmp, | 45 Fcmp, |
| 45 Icmp, | 46 Icmp, |
| 46 IntrinsicCall, | 47 IntrinsicCall, |
| 48 InsertElement, |
| 47 Load, | 49 Load, |
| 48 Phi, | 50 Phi, |
| 49 Ret, | 51 Ret, |
| 50 Select, | 52 Select, |
| 51 Store, | 53 Store, |
| 52 Switch, | 54 Switch, |
| 53 FakeDef, // not part of LLVM/PNaCl bitcode | 55 FakeDef, // not part of LLVM/PNaCl bitcode |
| 54 FakeUse, // not part of LLVM/PNaCl bitcode | 56 FakeUse, // not part of LLVM/PNaCl bitcode |
| 55 FakeKill, // not part of LLVM/PNaCl bitcode | 57 FakeKill, // not part of LLVM/PNaCl bitcode |
| 56 Target // target-specific low-level ICE | 58 Target // target-specific low-level ICE |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 static bool classof(const Inst *Inst) { return Inst->getKind() == Cast; } | 339 static bool classof(const Inst *Inst) { return Inst->getKind() == Cast; } |
| 338 | 340 |
| 339 private: | 341 private: |
| 340 InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source); | 342 InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source); |
| 341 InstCast(const InstCast &) LLVM_DELETED_FUNCTION; | 343 InstCast(const InstCast &) LLVM_DELETED_FUNCTION; |
| 342 InstCast &operator=(const InstCast &) LLVM_DELETED_FUNCTION; | 344 InstCast &operator=(const InstCast &) LLVM_DELETED_FUNCTION; |
| 343 virtual ~InstCast() {} | 345 virtual ~InstCast() {} |
| 344 const OpKind CastKind; | 346 const OpKind CastKind; |
| 345 }; | 347 }; |
| 346 | 348 |
| 349 // ExtractElement instruction. |
| 350 class InstExtractElement : public Inst { |
| 351 public: |
| 352 static InstExtractElement *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 353 Operand *Source2) { |
| 354 return new (Func->allocateInst<InstExtractElement>()) |
| 355 InstExtractElement(Func, Dest, Source1, Source2); |
| 356 } |
| 357 |
| 358 virtual void dump(const Cfg *Func) const; |
| 359 static bool classof(const Inst *Inst) { |
| 360 return Inst->getKind() == ExtractElement; |
| 361 } |
| 362 |
| 363 private: |
| 364 InstExtractElement(Cfg *Func, Variable *Dest, Operand *Source1, |
| 365 Operand *Source2); |
| 366 InstExtractElement(const InstExtractElement &) LLVM_DELETED_FUNCTION; |
| 367 InstExtractElement & |
| 368 operator=(const InstExtractElement &) LLVM_DELETED_FUNCTION; |
| 369 virtual ~InstExtractElement() {} |
| 370 }; |
| 371 |
| 347 // Floating-point comparison instruction. The source operands are | 372 // Floating-point comparison instruction. The source operands are |
| 348 // captured in getSrc(0) and getSrc(1). | 373 // captured in getSrc(0) and getSrc(1). |
| 349 class InstFcmp : public Inst { | 374 class InstFcmp : public Inst { |
| 350 public: | 375 public: |
| 351 enum FCond { | 376 enum FCond { |
| 352 #define X(tag, str) tag, | 377 #define X(tag, str) tag, |
| 353 ICEINSTFCMP_TABLE | 378 ICEINSTFCMP_TABLE |
| 354 #undef X | 379 #undef X |
| 355 _num | 380 _num |
| 356 }; | 381 }; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 420 |
| 396 private: | 421 private: |
| 397 InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1, | 422 InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1, |
| 398 Operand *Source2); | 423 Operand *Source2); |
| 399 InstIcmp(const InstIcmp &) LLVM_DELETED_FUNCTION; | 424 InstIcmp(const InstIcmp &) LLVM_DELETED_FUNCTION; |
| 400 InstIcmp &operator=(const InstIcmp &) LLVM_DELETED_FUNCTION; | 425 InstIcmp &operator=(const InstIcmp &) LLVM_DELETED_FUNCTION; |
| 401 virtual ~InstIcmp() {} | 426 virtual ~InstIcmp() {} |
| 402 const ICond Condition; | 427 const ICond Condition; |
| 403 }; | 428 }; |
| 404 | 429 |
| 430 // InsertElement instruction. |
| 431 class InstInsertElement : public Inst { |
| 432 public: |
| 433 static InstInsertElement *create(Cfg *Func, Variable *Dest, Operand *Source1, |
| 434 Operand *Source2, Operand *Source3) { |
| 435 return new (Func->allocateInst<InstInsertElement>()) |
| 436 InstInsertElement(Func, Dest, Source1, Source2, Source3); |
| 437 } |
| 438 |
| 439 virtual void dump(const Cfg *Func) const; |
| 440 static bool classof(const Inst *Inst) { |
| 441 return Inst->getKind() == InsertElement; |
| 442 } |
| 443 |
| 444 private: |
| 445 InstInsertElement(Cfg *Func, Variable *Dest, Operand *Source1, |
| 446 Operand *Source2, Operand *Source3); |
| 447 InstInsertElement(const InstInsertElement &) LLVM_DELETED_FUNCTION; |
| 448 InstInsertElement &operator=(const InstInsertElement &) LLVM_DELETED_FUNCTION; |
| 449 virtual ~InstInsertElement() {} |
| 450 }; |
| 451 |
| 405 // Call to an intrinsic function. The call target is captured as getSrc(0), | 452 // Call to an intrinsic function. The call target is captured as getSrc(0), |
| 406 // and arg I is captured as getSrc(I+1). | 453 // and arg I is captured as getSrc(I+1). |
| 407 class InstIntrinsicCall : public InstCall { | 454 class InstIntrinsicCall : public InstCall { |
| 408 public: | 455 public: |
| 409 static InstIntrinsicCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest, | 456 static InstIntrinsicCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest, |
| 410 Operand *CallTarget, | 457 Operand *CallTarget, |
| 411 const Intrinsics::IntrinsicInfo &Info) { | 458 const Intrinsics::IntrinsicInfo &Info) { |
| 412 return new (Func->allocateInst<InstIntrinsicCall>()) | 459 return new (Func->allocateInst<InstIntrinsicCall>()) |
| 413 InstIntrinsicCall(Func, NumArgs, Dest, CallTarget, Info); | 460 InstIntrinsicCall(Func, NumArgs, Dest, CallTarget, Info); |
| 414 } | 461 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 assert(Kind >= Target); | 748 assert(Kind >= Target); |
| 702 } | 749 } |
| 703 InstTarget(const InstTarget &) LLVM_DELETED_FUNCTION; | 750 InstTarget(const InstTarget &) LLVM_DELETED_FUNCTION; |
| 704 InstTarget &operator=(const InstTarget &) LLVM_DELETED_FUNCTION; | 751 InstTarget &operator=(const InstTarget &) LLVM_DELETED_FUNCTION; |
| 705 virtual ~InstTarget() {} | 752 virtual ~InstTarget() {} |
| 706 }; | 753 }; |
| 707 | 754 |
| 708 } // end of namespace Ice | 755 } // end of namespace Ice |
| 709 | 756 |
| 710 #endif // SUBZERO_SRC_ICEINST_H | 757 #endif // SUBZERO_SRC_ICEINST_H |
| OLD | NEW |