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

Side by Side Diff: src/IceInstX8632.cpp

Issue 944333002: Subzero: Update tests and build scripts for sandboxing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove old assignment of llcbin and gold Created 5 years, 10 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.cpp - X86-32 instruction implementation ---===// 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===//
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 implements the InstX8632 and OperandX8632 classes, 10 // This file implements the InstX8632 and OperandX8632 classes,
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 dumpDest(Func); 1611 dumpDest(Func);
1612 Str << " = cmp" << InstX8632CmppsAttributes[Condition].EmitString << "ps" 1612 Str << " = cmp" << InstX8632CmppsAttributes[Condition].EmitString << "ps"
1613 << "\t"; 1613 << "\t";
1614 dumpSources(Func); 1614 dumpSources(Func);
1615 } 1615 }
1616 1616
1617 void InstX8632Cmpxchg::emit(const Cfg *Func) const { 1617 void InstX8632Cmpxchg::emit(const Cfg *Func) const {
1618 if (!ALLOW_DUMP) 1618 if (!ALLOW_DUMP)
1619 return; 1619 return;
1620 Ostream &Str = Func->getContext()->getStrEmit(); 1620 Ostream &Str = Func->getContext()->getStrEmit();
1621 emitPrefix(Str);
1621 assert(getSrcSize() == 3); 1622 assert(getSrcSize() == 3);
1622 if (Locked) { 1623 if (Locked) {
1623 Str << "\tlock"; 1624 Str << "\tlock";
1624 } 1625 }
1625 Str << "\tcmpxchg" << getWidthString(getSrc(0)->getType()) << "\t"; 1626 Str << "\tcmpxchg" << getWidthString(getSrc(0)->getType()) << "\t";
1626 getSrc(2)->emit(Func); 1627 getSrc(2)->emit(Func);
1627 Str << ", "; 1628 Str << ", ";
1628 getSrc(0)->emit(Func); 1629 getSrc(0)->emit(Func);
1630 emitSuffix(Str);
1629 } 1631 }
1630 1632
1631 void InstX8632Cmpxchg::emitIAS(const Cfg *Func) const { 1633 void InstX8632Cmpxchg::emitIAS(const Cfg *Func) const {
1632 assert(getSrcSize() == 3); 1634 assert(getSrcSize() == 3);
1633 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>(); 1635 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>();
1634 Type Ty = getSrc(0)->getType(); 1636 Type Ty = getSrc(0)->getType();
1635 const auto Mem = llvm::cast<OperandX8632Mem>(getSrc(0)); 1637 const auto Mem = llvm::cast<OperandX8632Mem>(getSrc(0));
1636 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment); 1638 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment);
1637 const x86::Address Addr = Mem->toAsmAddress(Asm); 1639 const x86::Address Addr = Mem->toAsmAddress(Asm);
1638 const auto VarReg = llvm::cast<Variable>(getSrc(2)); 1640 const auto VarReg = llvm::cast<Variable>(getSrc(2));
(...skipping 15 matching lines...) Expand all
1654 Str << "lock "; 1656 Str << "lock ";
1655 } 1657 }
1656 Str << "cmpxchg." << getSrc(0)->getType() << " "; 1658 Str << "cmpxchg." << getSrc(0)->getType() << " ";
1657 dumpSources(Func); 1659 dumpSources(Func);
1658 } 1660 }
1659 1661
1660 void InstX8632Cmpxchg8b::emit(const Cfg *Func) const { 1662 void InstX8632Cmpxchg8b::emit(const Cfg *Func) const {
1661 if (!ALLOW_DUMP) 1663 if (!ALLOW_DUMP)
1662 return; 1664 return;
1663 Ostream &Str = Func->getContext()->getStrEmit(); 1665 Ostream &Str = Func->getContext()->getStrEmit();
1666 emitPrefix(Str);
1664 assert(getSrcSize() == 5); 1667 assert(getSrcSize() == 5);
1665 if (Locked) { 1668 if (Locked) {
1666 Str << "\tlock"; 1669 Str << "\tlock";
1667 } 1670 }
1668 Str << "\tcmpxchg8b\t"; 1671 Str << "\tcmpxchg8b\t";
1669 getSrc(0)->emit(Func); 1672 getSrc(0)->emit(Func);
1673 emitSuffix(Str);
1670 } 1674 }
1671 1675
1672 void InstX8632Cmpxchg8b::emitIAS(const Cfg *Func) const { 1676 void InstX8632Cmpxchg8b::emitIAS(const Cfg *Func) const {
1673 assert(getSrcSize() == 5); 1677 assert(getSrcSize() == 5);
1674 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>(); 1678 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>();
1675 const auto Mem = llvm::cast<OperandX8632Mem>(getSrc(0)); 1679 const auto Mem = llvm::cast<OperandX8632Mem>(getSrc(0));
1676 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment); 1680 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment);
1677 const x86::Address Addr = Mem->toAsmAddress(Asm); 1681 const x86::Address Addr = Mem->toAsmAddress(Asm);
1678 if (Locked) { 1682 if (Locked) {
1679 Asm->lock(); 1683 Asm->lock();
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 Ostream &Str = Func->getContext()->getStrDump(); 2707 Ostream &Str = Func->getContext()->getStrDump();
2704 Type Ty = (getSrcSize() == 0 ? IceType_void : getSrc(0)->getType()); 2708 Type Ty = (getSrcSize() == 0 ? IceType_void : getSrc(0)->getType());
2705 Str << "ret." << Ty << " "; 2709 Str << "ret." << Ty << " ";
2706 dumpSources(Func); 2710 dumpSources(Func);
2707 } 2711 }
2708 2712
2709 void InstX8632Xadd::emit(const Cfg *Func) const { 2713 void InstX8632Xadd::emit(const Cfg *Func) const {
2710 if (!ALLOW_DUMP) 2714 if (!ALLOW_DUMP)
2711 return; 2715 return;
2712 Ostream &Str = Func->getContext()->getStrEmit(); 2716 Ostream &Str = Func->getContext()->getStrEmit();
2717 emitPrefix(Str);
2713 if (Locked) { 2718 if (Locked) {
2714 Str << "\tlock"; 2719 Str << "\tlock";
2715 } 2720 }
2716 Str << "\txadd" << getWidthString(getSrc(0)->getType()) << "\t"; 2721 Str << "\txadd" << getWidthString(getSrc(0)->getType()) << "\t";
2717 getSrc(1)->emit(Func); 2722 getSrc(1)->emit(Func);
2718 Str << ", "; 2723 Str << ", ";
2719 getSrc(0)->emit(Func); 2724 getSrc(0)->emit(Func);
2725 emitSuffix(Str);
2720 } 2726 }
2721 2727
2722 void InstX8632Xadd::emitIAS(const Cfg *Func) const { 2728 void InstX8632Xadd::emitIAS(const Cfg *Func) const {
2723 assert(getSrcSize() == 2); 2729 assert(getSrcSize() == 2);
2724 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>(); 2730 x86::AssemblerX86 *Asm = Func->getAssembler<x86::AssemblerX86>();
2725 Type Ty = getSrc(0)->getType(); 2731 Type Ty = getSrc(0)->getType();
2726 const auto Mem = llvm::cast<OperandX8632Mem>(getSrc(0)); 2732 const auto Mem = llvm::cast<OperandX8632Mem>(getSrc(0));
2727 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment); 2733 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment);
2728 const x86::Address Addr = Mem->toAsmAddress(Asm); 2734 const x86::Address Addr = Mem->toAsmAddress(Asm);
2729 const auto VarReg = llvm::cast<Variable>(getSrc(1)); 2735 const auto VarReg = llvm::cast<Variable>(getSrc(1));
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 } 2951 }
2946 Str << "("; 2952 Str << "(";
2947 if (Func) 2953 if (Func)
2948 Var->dump(Func); 2954 Var->dump(Func);
2949 else 2955 else
2950 Var->dump(Str); 2956 Var->dump(Str);
2951 Str << ")"; 2957 Str << ")";
2952 } 2958 }
2953 2959
2954 } // end of namespace Ice 2960 } // end of namespace Ice
OLDNEW
« src/IceInstX8632.h ('K') | « src/IceInstX8632.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698