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

Unified Diff: src/IceInstX86Base.h

Issue 1909013002: Subzero. X86. Lowers shufflevector using xmm instructions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 8 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
Index: src/IceInstX86Base.h
diff --git a/src/IceInstX86Base.h b/src/IceInstX86Base.h
index 1c2e8e6faca33dad15a46eeb41013d04bdd049be..c29538a4553f57a52a87e8f8fd2407958ee39943 100644
--- a/src/IceInstX86Base.h
+++ b/src/IceInstX86Base.h
@@ -143,6 +143,7 @@ template <typename TraitsType> struct InstImpl {
Pop,
Por,
Pshufd,
+ Punpckl,
Psll,
Psra,
Psrl,
@@ -183,7 +184,7 @@ template <typename TraitsType> struct InstImpl {
IacaEnd
};
- enum SseSuffix { None, Packed, Scalar, Integral };
+ enum SseSuffix { None, Packed, Unpack, Scalar, Integral };
static const char *getWidthString(Type Ty);
static const char *getFldString(Type Ty);
@@ -841,6 +842,9 @@ template <typename TraitsType> struct InstImpl {
case InstX86Base::SseSuffix::Packed:
SuffixString = Traits::TypeAttributes[DestTy].PdPsString;
break;
+ case InstX86Base::SseSuffix::Unpack:
+ SuffixString = Traits::TypeAttributes[DestTy].UnpackString;
+ break;
case InstX86Base::SseSuffix::Scalar:
SuffixString = Traits::TypeAttributes[DestTy].SdSsString;
break;
@@ -2839,6 +2843,23 @@ template <typename TraitsType> struct InstImpl {
private:
InstX86IacaEnd(Cfg *Func);
};
+
+ class InstX86Punpckl
+ : public InstX86BaseBinopXmm<InstX86Base::Punpckl, false,
+ InstX86Base::SseSuffix::Unpack> {
+ public:
+ static InstX86Punpckl *create(Cfg *Func, Variable *Dest, Operand *Source) {
+ return new (Func->allocate<InstX86Punpckl>())
+ InstX86Punpckl(Func, Dest, Source);
+ }
+
+ private:
+ InstX86Punpckl(Cfg *Func, Variable *Dest, Operand *Source)
+ : InstX86BaseBinopXmm<InstX86Base::Punpckl, false,
+ InstX86Base::SseSuffix::Unpack>(Func, Dest,
+ Source) {}
+ };
+
}; // struct InstImpl
/// struct Insts is a template that can be used to instantiate all the X86
@@ -2960,6 +2981,8 @@ template <typename TraitsType> struct Insts {
using IacaStart = typename InstImpl<TraitsType>::InstX86IacaStart;
using IacaEnd = typename InstImpl<TraitsType>::InstX86IacaEnd;
+
+ using Punpckl = typename InstImpl<TraitsType>::InstX86Punpckl;
};
/// X86 Instructions have static data (particularly, opcodes and instruction
@@ -3189,6 +3212,9 @@ template <typename TraitsType> struct Insts {
template <> \
template <> \
const char *InstImpl<TraitsType>::InstX86Pshufd::Base::Opcode = "pshufd"; \
+ template <> \
+ template <> \
+ const char *InstImpl<TraitsType>::InstX86Punpckl::Base::Opcode = "punpckl"; \
/* Inplace GPR ops */ \
template <> \
template <> \
@@ -3550,6 +3576,12 @@ template <typename TraitsType> struct Insts {
&InstImpl<TraitsType>::Assembler::psrl, \
&InstImpl<TraitsType>::Assembler::psrl, \
&InstImpl<TraitsType>::Assembler::psrl}; \
+ template <> \
+ template <> \
+ const InstImpl<TraitsType>::Assembler::XmmEmitterRegOp \
+ InstImpl<TraitsType>::InstX86Punpckl::Base::Emitter = { \
+ &InstImpl<TraitsType>::Assembler::punpckldq, \
+ &InstImpl<TraitsType>::Assembler::punpckldq}; \
} \
}

Powered by Google App Engine
This is Rietveld 408576698