emit_x64_vector: Vectorize non-SSE4.1 fallback path for VectorMultiply32()
This commit is contained in:
parent
d70ee7c0d1
commit
0d20423ad5
1 changed files with 15 additions and 3 deletions
|
@ -1117,9 +1117,21 @@ void EmitX64::EmitVectorMultiply32(EmitContext& ctx, IR::Inst* inst) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmitTwoArgumentFallback(code, ctx, inst, [](std::array<u32, 4>& result, const std::array<u32, 4>& a, const std::array<u32, 4>& b){
|
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||||
std::transform(a.begin(), a.end(), b.begin(), result.begin(), std::multiplies<>());
|
const Xbyak::Xmm a = ctx.reg_alloc.UseScratchXmm(args[0]);
|
||||||
});
|
const Xbyak::Xmm b = ctx.reg_alloc.UseScratchXmm(args[1]);
|
||||||
|
const Xbyak::Xmm tmp = ctx.reg_alloc.ScratchXmm();
|
||||||
|
|
||||||
|
code.movdqa(tmp, a);
|
||||||
|
code.psrlq(a, 32);
|
||||||
|
code.pmuludq(tmp, b);
|
||||||
|
code.psrlq(b, 32);
|
||||||
|
code.pmuludq(a, b);
|
||||||
|
code.pshufd(tmp, tmp, 0b00001000);
|
||||||
|
code.pshufd(b, a, 0b00001000);
|
||||||
|
code.punpckldq(tmp, b);
|
||||||
|
|
||||||
|
ctx.reg_alloc.DefineValue(inst, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitX64::EmitVectorMultiply64(EmitContext& ctx, IR::Inst* inst) {
|
void EmitX64::EmitVectorMultiply64(EmitContext& ctx, IR::Inst* inst) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue