| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- 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 /// \file | 10 /// \file |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 typename Traits::Cond::CmppsCond Condition) { | 367 typename Traits::Cond::CmppsCond Condition) { |
| 368 Context.insert(Traits::Insts::Cmpps::create(Func, Dest, Src0, Condition)); | 368 Context.insert(Traits::Insts::Cmpps::create(Func, Dest, Src0, Condition)); |
| 369 } | 369 } |
| 370 void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, | 370 void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, |
| 371 bool Locked) { | 371 bool Locked) { |
| 372 Context.insert( | 372 Context.insert( |
| 373 Traits::Insts::Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); | 373 Traits::Insts::Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); |
| 374 // Mark eax as possibly modified by cmpxchg. | 374 // Mark eax as possibly modified by cmpxchg. |
| 375 Context.insert( | 375 Context.insert( |
| 376 InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); | 376 InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); |
| 377 _set_dest_nonkillable(); | 377 _set_dest_redefined(); |
| 378 Context.insert(InstFakeUse::create(Func, Eax)); | 378 Context.insert(InstFakeUse::create(Func, Eax)); |
| 379 } | 379 } |
| 380 void _cmpxchg8b(typename Traits::X86OperandMem *Addr, Variable *Edx, | 380 void _cmpxchg8b(typename Traits::X86OperandMem *Addr, Variable *Edx, |
| 381 Variable *Eax, Variable *Ecx, Variable *Ebx, bool Locked) { | 381 Variable *Eax, Variable *Ecx, Variable *Ebx, bool Locked) { |
| 382 Context.insert(Traits::Insts::Cmpxchg8b::create(Func, Addr, Edx, Eax, Ecx, | 382 Context.insert(Traits::Insts::Cmpxchg8b::create(Func, Addr, Edx, Eax, Ecx, |
| 383 Ebx, Locked)); | 383 Ebx, Locked)); |
| 384 // Mark edx, and eax as possibly modified by cmpxchg8b. | 384 // Mark edx, and eax as possibly modified by cmpxchg8b. |
| 385 Context.insert(InstFakeDef::create(Func, Edx)); | 385 Context.insert(InstFakeDef::create(Func, Edx)); |
| 386 _set_dest_nonkillable(); | 386 _set_dest_redefined(); |
| 387 Context.insert(InstFakeUse::create(Func, Edx)); | 387 Context.insert(InstFakeUse::create(Func, Edx)); |
| 388 Context.insert(InstFakeDef::create(Func, Eax)); | 388 Context.insert(InstFakeDef::create(Func, Eax)); |
| 389 _set_dest_nonkillable(); | 389 _set_dest_redefined(); |
| 390 Context.insert(InstFakeUse::create(Func, Eax)); | 390 Context.insert(InstFakeUse::create(Func, Eax)); |
| 391 } | 391 } |
| 392 void _cvt(Variable *Dest, Operand *Src0, | 392 void _cvt(Variable *Dest, Operand *Src0, |
| 393 typename Traits::Insts::Cvt::CvtVariant Variant) { | 393 typename Traits::Insts::Cvt::CvtVariant Variant) { |
| 394 Context.insert(Traits::Insts::Cvt::create(Func, Dest, Src0, Variant)); | 394 Context.insert(Traits::Insts::Cvt::create(Func, Dest, Src0, Variant)); |
| 395 } | 395 } |
| 396 void _div(Variable *Dest, Operand *Src0, Operand *Src1) { | 396 void _div(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 397 Context.insert(Traits::Insts::Div::create(Func, Dest, Src0, Src1)); | 397 Context.insert(Traits::Insts::Div::create(Func, Dest, Src0, Src1)); |
| 398 } | 398 } |
| 399 void _divps(Variable *Dest, Operand *Src0) { | 399 void _divps(Variable *Dest, Operand *Src0) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 void _mfence() { Context.insert(Traits::Insts::Mfence::create(Func)); } | 440 void _mfence() { Context.insert(Traits::Insts::Mfence::create(Func)); } |
| 441 /// If Dest=nullptr is passed in, then a new variable is created, marked as | 441 /// If Dest=nullptr is passed in, then a new variable is created, marked as |
| 442 /// infinite register allocation weight, and returned through the in/out Dest | 442 /// infinite register allocation weight, and returned through the in/out Dest |
| 443 /// argument. | 443 /// argument. |
| 444 void _mov(Variable *&Dest, Operand *Src0, | 444 void _mov(Variable *&Dest, Operand *Src0, |
| 445 int32_t RegNum = Variable::NoRegister) { | 445 int32_t RegNum = Variable::NoRegister) { |
| 446 if (Dest == nullptr) | 446 if (Dest == nullptr) |
| 447 Dest = makeReg(Src0->getType(), RegNum); | 447 Dest = makeReg(Src0->getType(), RegNum); |
| 448 Context.insert(Traits::Insts::Mov::create(Func, Dest, Src0)); | 448 Context.insert(Traits::Insts::Mov::create(Func, Dest, Src0)); |
| 449 } | 449 } |
| 450 void _mov_nonkillable(Variable *Dest, Operand *Src0) { | 450 void _mov_redefined(Variable *Dest, Operand *Src0) { |
| 451 Inst *NewInst = Traits::Insts::Mov::create(Func, Dest, Src0); | 451 Inst *NewInst = Traits::Insts::Mov::create(Func, Dest, Src0); |
| 452 NewInst->setDestNonKillable(); | 452 NewInst->setDestRedefined(); |
| 453 Context.insert(NewInst); | 453 Context.insert(NewInst); |
| 454 } | 454 } |
| 455 void _movd(Variable *Dest, Operand *Src0) { | 455 void _movd(Variable *Dest, Operand *Src0) { |
| 456 Context.insert(Traits::Insts::Movd::create(Func, Dest, Src0)); | 456 Context.insert(Traits::Insts::Movd::create(Func, Dest, Src0)); |
| 457 } | 457 } |
| 458 void _movp(Variable *Dest, Operand *Src0) { | 458 void _movp(Variable *Dest, Operand *Src0) { |
| 459 Context.insert(Traits::Insts::Movp::create(Func, Dest, Src0)); | 459 Context.insert(Traits::Insts::Movp::create(Func, Dest, Src0)); |
| 460 } | 460 } |
| 461 void _movq(Variable *Dest, Operand *Src0) { | 461 void _movq(Variable *Dest, Operand *Src0) { |
| 462 Context.insert(Traits::Insts::Movq::create(Func, Dest, Src0)); | 462 Context.insert(Traits::Insts::Movq::create(Func, Dest, Src0)); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 void _ucomiss(Operand *Src0, Operand *Src1) { | 611 void _ucomiss(Operand *Src0, Operand *Src1) { |
| 612 Context.insert(Traits::Insts::Ucomiss::create(Func, Src0, Src1)); | 612 Context.insert(Traits::Insts::Ucomiss::create(Func, Src0, Src1)); |
| 613 } | 613 } |
| 614 void _ud2() { Context.insert(Traits::Insts::UD2::create(Func)); } | 614 void _ud2() { Context.insert(Traits::Insts::UD2::create(Func)); } |
| 615 void _xadd(Operand *Dest, Variable *Src, bool Locked) { | 615 void _xadd(Operand *Dest, Variable *Src, bool Locked) { |
| 616 Context.insert(Traits::Insts::Xadd::create(Func, Dest, Src, Locked)); | 616 Context.insert(Traits::Insts::Xadd::create(Func, Dest, Src, Locked)); |
| 617 // The xadd exchanges Dest and Src (modifying Src). Model that update with | 617 // The xadd exchanges Dest and Src (modifying Src). Model that update with |
| 618 // a FakeDef followed by a FakeUse. | 618 // a FakeDef followed by a FakeUse. |
| 619 Context.insert( | 619 Context.insert( |
| 620 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); | 620 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); |
| 621 _set_dest_nonkillable(); | 621 _set_dest_redefined(); |
| 622 Context.insert(InstFakeUse::create(Func, Src)); | 622 Context.insert(InstFakeUse::create(Func, Src)); |
| 623 } | 623 } |
| 624 void _xchg(Operand *Dest, Variable *Src) { | 624 void _xchg(Operand *Dest, Variable *Src) { |
| 625 Context.insert(Traits::Insts::Xchg::create(Func, Dest, Src)); | 625 Context.insert(Traits::Insts::Xchg::create(Func, Dest, Src)); |
| 626 // The xchg modifies Dest and Src -- model that update with a | 626 // The xchg modifies Dest and Src -- model that update with a |
| 627 // FakeDef/FakeUse. | 627 // FakeDef/FakeUse. |
| 628 Context.insert( | 628 Context.insert( |
| 629 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); | 629 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); |
| 630 _set_dest_nonkillable(); | 630 _set_dest_redefined(); |
| 631 Context.insert(InstFakeUse::create(Func, Src)); | 631 Context.insert(InstFakeUse::create(Func, Src)); |
| 632 } | 632 } |
| 633 void _xor(Variable *Dest, Operand *Src0) { | 633 void _xor(Variable *Dest, Operand *Src0) { |
| 634 Context.insert(Traits::Insts::Xor::create(Func, Dest, Src0)); | 634 Context.insert(Traits::Insts::Xor::create(Func, Dest, Src0)); |
| 635 } | 635 } |
| 636 void _xor_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { | 636 void _xor_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { |
| 637 Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1)); | 637 Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1)); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void _iaca_start() { | 640 void _iaca_start() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 Operand *Src1Lo, Variable *DestLo, Variable *DestHi); | 719 Operand *Src1Lo, Variable *DestLo, Variable *DestHi); |
| 720 | 720 |
| 721 BoolFolding FoldingInfo; | 721 BoolFolding FoldingInfo; |
| 722 }; | 722 }; |
| 723 } // end of namespace X86Internal | 723 } // end of namespace X86Internal |
| 724 } // end of namespace Ice | 724 } // end of namespace Ice |
| 725 | 725 |
| 726 #include "IceTargetLoweringX86BaseImpl.h" | 726 #include "IceTargetLoweringX86BaseImpl.h" |
| 727 | 727 |
| 728 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 728 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
| OLD | NEW |