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

Unified Diff: src/IceInstX8632.cpp

Issue 650573002: emitIAS for the couple of blend instructions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: remove isa Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstX8632.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.cpp
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index d51eeca2f5d7fed75152798f12ce9d506ce756a3..274d02c4cb11f3d6e39f9cd318c3a14fdb5d6d64 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -1067,7 +1067,6 @@ void emitVariableBlendInst(const char *Opcode, const Inst *Inst,
const Cfg *Func) {
Ostream &Str = Func->getContext()->getStrEmit();
assert(Inst->getSrcSize() == 3);
- assert(llvm::isa<Variable>(Inst->getSrc(2)));
assert(llvm::cast<Variable>(Inst->getSrc(2))->getRegNum() ==
RegX8632::Reg_xmm0);
Str << "\t" << Opcode << "\t";
@@ -1077,6 +1076,17 @@ void emitVariableBlendInst(const char *Opcode, const Inst *Inst,
Str << "\n";
}
+void
+emitIASVariableBlendInst(const Inst *Inst, const Cfg *Func,
+ const x86::AssemblerX86::XmmEmitterRegOp &Emitter) {
+ assert(Inst->getSrcSize() == 3);
+ assert(llvm::cast<Variable>(Inst->getSrc(2))->getRegNum() ==
+ RegX8632::Reg_xmm0);
+ const Variable *Dest = Inst->getDest();
+ const Operand *Src = Inst->getSrc(1);
+ emitIASRegOpTyXMM(Func, Dest->getType(), Dest, Src, Emitter);
+}
+
} // end anonymous namespace
template <> void InstX8632Blendvps::emit(const Cfg *Func) const {
@@ -1085,12 +1095,28 @@ template <> void InstX8632Blendvps::emit(const Cfg *Func) const {
emitVariableBlendInst(Opcode, this, Func);
}
+template <> void InstX8632Blendvps::emitIAS(const Cfg *Func) const {
+ assert(static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet() >=
+ TargetX8632::SSE4_1);
+ static const x86::AssemblerX86::XmmEmitterRegOp Emitter = {
+ &x86::AssemblerX86::blendvps, &x86::AssemblerX86::blendvps};
+ emitIASVariableBlendInst(this, Func, Emitter);
+}
+
template <> void InstX8632Pblendvb::emit(const Cfg *Func) const {
assert(static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet() >=
TargetX8632::SSE4_1);
emitVariableBlendInst(Opcode, this, Func);
}
+template <> void InstX8632Pblendvb::emitIAS(const Cfg *Func) const {
+ assert(static_cast<TargetX8632 *>(Func->getTarget())->getInstructionSet() >=
+ TargetX8632::SSE4_1);
+ static const x86::AssemblerX86::XmmEmitterRegOp Emitter = {
+ &x86::AssemblerX86::pblendvb, &x86::AssemblerX86::pblendvb};
+ emitIASVariableBlendInst(this, Func, Emitter);
+}
+
template <> void InstX8632Imul::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
assert(getSrcSize() == 2);
« no previous file with comments | « src/IceInstX8632.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698