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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 2695613004: Add several SIMD opcodes to IA32 (Closed)
Patch Set: Rebase Created 3 years, 9 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/ia32/macro-assembler-ia32.h ('k') | src/ia32/sse-instr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index 906c369172086454690cf6b6d612ff8204d3bc8a..e8842a83238bda9242981aeb8cc42fb2197dae56 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -2270,32 +2270,41 @@ void MacroAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) {
movd(dst, src);
return;
}
- DCHECK_EQ(1, imm8);
if (CpuFeatures::IsSupported(SSE4_1)) {
CpuFeatureScope sse_scope(this, SSE4_1);
pextrd(dst, src, imm8);
return;
}
- pshufd(xmm0, src, 1);
+ DCHECK_LT(imm8, 4);
+ pshufd(xmm0, src, imm8);
movd(dst, xmm0);
}
-
-void MacroAssembler::Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8) {
- DCHECK(imm8 == 0 || imm8 == 1);
+void MacroAssembler::Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8,
+ bool is_64_bits) {
if (CpuFeatures::IsSupported(SSE4_1)) {
CpuFeatureScope sse_scope(this, SSE4_1);
pinsrd(dst, src, imm8);
return;
}
- movd(xmm0, src);
- if (imm8 == 1) {
- punpckldq(dst, xmm0);
+ if (is_64_bits) {
+ movd(xmm0, src);
+ if (imm8 == 1) {
+ punpckldq(dst, xmm0);
+ } else {
+ DCHECK_EQ(0, imm8);
+ psrlq(dst, 32);
+ punpckldq(xmm0, dst);
+ movaps(dst, xmm0);
+ }
} else {
- DCHECK_EQ(0, imm8);
- psrlq(dst, 32);
- punpckldq(xmm0, dst);
- movaps(dst, xmm0);
+ DCHECK_LT(imm8, 4);
+ push(eax);
+ mov(eax, src);
+ pinsrw(dst, eax, imm8 * 2);
+ shr(eax, 16);
+ pinsrw(dst, eax, imm8 * 2 + 1);
+ pop(eax);
}
}
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/sse-instr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698