[x64] Fix constant access in VECTOR_SHL_V128.

This commit is contained in:
gibbed 2018-11-18 08:13:11 -06:00
parent 3ced6c5cf2
commit 44f194be35
1 changed files with 10 additions and 2 deletions

View File

@ -5640,6 +5640,14 @@ struct VECTOR_SHL_V128
// Shift 8 words in src1 by amount specified in src2.
Xbyak::Label emu, end;
Xmm src1;
if (i.src1.is_constant) {
src1 = e.xmm2;
e.LoadConstantXmm(src1, i.src1.constant());
} else {
src1 = i.src1;
}
// Only bother with this check if shift amt isn't constant.
if (!i.src2.is_constant) {
// See if the shift is equal first for a shortcut.
@ -5653,7 +5661,7 @@ struct VECTOR_SHL_V128
e.mov(e.rax, 0xF);
e.vmovq(e.xmm1, e.rax);
e.vpand(e.xmm0, e.xmm0, e.xmm1);
e.vpsllw(i.dest, i.src1, e.xmm0);
e.vpsllw(i.dest, src1, e.xmm0);
e.jmp(end);
}
@ -5665,7 +5673,7 @@ struct VECTOR_SHL_V128
} else {
e.lea(e.r9, e.StashXmm(1, i.src2));
}
e.lea(e.r8, e.StashXmm(0, i.src1));
e.lea(e.r8, e.StashXmm(0, src1));
e.CallNativeSafe(reinterpret_cast<void*>(EmulateVectorShlI16));
e.vmovaps(i.dest, e.xmm0);