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,15 +293,18 @@ 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:
|
||||||
const Xbyak::Xmm temp = ctx.reg_alloc.ScratchXmm();
|
if (code.DoesCpuSupport(Xbyak::util::Cpu::tAVX512VL)) {
|
||||||
code.pshufd(temp, data, 0b11110101);
|
code.vpabsq(data, data);
|
||||||
code.psrad(temp, 31);
|
} else {
|
||||||
code.pxor(data, temp);
|
const Xbyak::Xmm temp = ctx.reg_alloc.ScratchXmm();
|
||||||
code.psubq(data, temp);
|
code.pshufd(temp, data, 0b11110101);
|
||||||
|
code.psrad(temp, 31);
|
||||||
|
code.pxor(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