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

Side by Side Diff: src/IceInstX86BaseImpl.h

Issue 1665423002: Subzero: Cleanup Inst==>Instr. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/IceInstX86Base.h ('k') | src/IceRegAlloc.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/IceInstX86BaseImpl.h - Generic X86 instructions -*- C++ -*=// 1 //===- subzero/src/IceInstX86BaseImpl.h - Generic 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 /// \file 10 /// \file
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 assert(this->getSrcSize() == 3); 1027 assert(this->getSrcSize() == 3);
1028 const Operand *Src = this->getSrc(1); 1028 const Operand *Src = this->getSrc(1);
1029 Type Ty = Src->getType(); 1029 Type Ty = Src->getType();
1030 static const GPREmitterOneOp Emitter = {&Assembler::idiv, &Assembler::idiv}; 1030 static const GPREmitterOneOp Emitter = {&Assembler::idiv, &Assembler::idiv};
1031 emitIASOpTyGPR(Func, Ty, Src, Emitter); 1031 emitIASOpTyGPR(Func, Ty, Src, Emitter);
1032 } 1032 }
1033 1033
1034 // pblendvb and blendvps take xmm0 as a final implicit argument. 1034 // pblendvb and blendvps take xmm0 as a final implicit argument.
1035 template <typename TraitsType> 1035 template <typename TraitsType>
1036 void InstImpl<TraitsType>::emitVariableBlendInst(const char *Opcode, 1036 void InstImpl<TraitsType>::emitVariableBlendInst(const char *Opcode,
1037 const Inst *Inst, 1037 const Inst *Instr,
1038 const Cfg *Func) { 1038 const Cfg *Func) {
1039 if (!BuildDefs::dump()) 1039 if (!BuildDefs::dump())
1040 return; 1040 return;
1041 Ostream &Str = Func->getContext()->getStrEmit(); 1041 Ostream &Str = Func->getContext()->getStrEmit();
1042 assert(Inst->getSrcSize() == 3); 1042 assert(Instr->getSrcSize() == 3);
1043 assert(llvm::cast<Variable>(Inst->getSrc(2))->getRegNum() == 1043 assert(llvm::cast<Variable>(Instr->getSrc(2))->getRegNum() ==
1044 RegisterSet::Reg_xmm0); 1044 RegisterSet::Reg_xmm0);
1045 Str << "\t" << Opcode << "\t"; 1045 Str << "\t" << Opcode << "\t";
1046 Inst->getSrc(1)->emit(Func); 1046 Instr->getSrc(1)->emit(Func);
1047 Str << ", "; 1047 Str << ", ";
1048 Inst->getDest()->emit(Func); 1048 Instr->getDest()->emit(Func);
1049 } 1049 }
1050 1050
1051 template <typename TraitsType> 1051 template <typename TraitsType>
1052 void InstImpl<TraitsType>::emitIASVariableBlendInst( 1052 void InstImpl<TraitsType>::emitIASVariableBlendInst(
1053 const Inst *Inst, const Cfg *Func, const XmmEmitterRegOp &Emitter) { 1053 const Inst *Instr, const Cfg *Func, const XmmEmitterRegOp &Emitter) {
1054 assert(Inst->getSrcSize() == 3); 1054 assert(Instr->getSrcSize() == 3);
1055 assert(llvm::cast<Variable>(Inst->getSrc(2))->getRegNum() == 1055 assert(llvm::cast<Variable>(Instr->getSrc(2))->getRegNum() ==
1056 RegisterSet::Reg_xmm0); 1056 RegisterSet::Reg_xmm0);
1057 const Variable *Dest = Inst->getDest(); 1057 const Variable *Dest = Instr->getDest();
1058 const Operand *Src = Inst->getSrc(1); 1058 const Operand *Src = Instr->getSrc(1);
1059 emitIASRegOpTyXMM(Func, Dest->getType(), Dest, Src, Emitter); 1059 emitIASRegOpTyXMM(Func, Dest->getType(), Dest, Src, Emitter);
1060 } 1060 }
1061 1061
1062 template <typename TraitsType> 1062 template <typename TraitsType>
1063 void InstImpl<TraitsType>::InstX86Blendvps::emit(const Cfg *Func) const { 1063 void InstImpl<TraitsType>::InstX86Blendvps::emit(const Cfg *Func) const {
1064 if (!BuildDefs::dump()) 1064 if (!BuildDefs::dump())
1065 return; 1065 return;
1066 emitVariableBlendInst(this->Opcode, this, Func); 1066 emitVariableBlendInst(this->Opcode, this, Func);
1067 } 1067 }
1068 1068
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2889 return; 2889 return;
2890 Ostream &Str = Func->getContext()->getStrDump(); 2890 Ostream &Str = Func->getContext()->getStrDump();
2891 Str << "IACA_END"; 2891 Str << "IACA_END";
2892 } 2892 }
2893 2893
2894 } // end of namespace X86NAMESPACE 2894 } // end of namespace X86NAMESPACE
2895 2895
2896 } // end of namespace Ice 2896 } // end of namespace Ice
2897 2897
2898 #endif // SUBZERO_SRC_ICEINSTX86BASEIMPL_H 2898 #endif // SUBZERO_SRC_ICEINSTX86BASEIMPL_H
OLDNEW
« no previous file with comments | « src/IceInstX86Base.h ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698