emit_x64_vector: Emit VPABSQ in EmitVectorAbs() for the 64-bit case if AVX-512VL is available
This commit is contained in:
parent
d4ee878cbd
commit
0f067b7330
1 changed files with 10 additions and 7 deletions
|
@ -293,14 +293,17 @@ static void EmitVectorAbs(size_t esize, EmitContext& ctx, IR::Inst* inst, BlockO
|
||||||
code.psubd(data, temp);
|
code.psubd(data, temp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 64: {
|
case 64:
|
||||||
|
if (code.DoesCpuSupport(Xbyak::util::Cpu::tAVX512VL)) {
|
||||||
|
code.vpabsq(data, data);
|
||||||
|
} else {
|
||||||
const Xbyak::Xmm temp = ctx.reg_alloc.ScratchXmm();
|
const Xbyak::Xmm temp = ctx.reg_alloc.ScratchXmm();
|
||||||
code.pshufd(temp, data, 0b11110101);
|
code.pshufd(temp, data, 0b11110101);
|
||||||
code.psrad(temp, 31);
|
code.psrad(temp, 31);
|
||||||
code.pxor(data, temp);
|
code.pxor(data, temp);
|
||||||
code.psubq(data, temp);
|
code.psubq(data, temp);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.reg_alloc.DefineValue(inst, data);
|
ctx.reg_alloc.DefineValue(inst, data);
|
||||||
|
|
Loading…
Reference in a new issue