emit_x64_vector: Emit VPABSQ in EmitVectorAbs() for the 64-bit case if AVX-512VL is available

This commit is contained in:
Lioncash 2018-05-03 12:46:13 -04:00 committed by MerryMage
parent d4ee878cbd
commit 0f067b7330

View file

@ -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);
} }