emit_x64_vector_floating_point: AVX && DN implementation of EmitFPVectorMulX
This commit is contained in:
parent
e3898e628e
commit
7c8fcaef26
1 changed files with 22 additions and 2 deletions
|
@ -960,6 +960,26 @@ static void EmitFPVectorMulX(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst
|
||||||
|
|
||||||
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||||
|
|
||||||
|
if (ctx.FPSCR_DN() && code.DoesCpuSupport(Xbyak::util::Cpu::tAVX)) {
|
||||||
|
const Xbyak::Xmm result = ctx.reg_alloc.UseScratchXmm(args[0]);
|
||||||
|
const Xbyak::Xmm operand = ctx.reg_alloc.UseXmm(args[1]);
|
||||||
|
const Xbyak::Xmm tmp = ctx.reg_alloc.ScratchXmm();
|
||||||
|
const Xbyak::Xmm twos = ctx.reg_alloc.ScratchXmm();
|
||||||
|
|
||||||
|
FCODE(vcmpunordp)(xmm0, result, operand);
|
||||||
|
FCODE(vxorp)(twos, result, operand);
|
||||||
|
FCODE(mulp)(result, operand);
|
||||||
|
FCODE(andp)(twos, GetNegativeZeroVector<fsize>(code));
|
||||||
|
FCODE(vcmpunordp)(tmp, result, result);
|
||||||
|
FCODE(blendvp)(result, GetNaNVector<fsize>(code));
|
||||||
|
FCODE(orp)(twos, GetVectorOf<fsize, false, 0, 2>(code));
|
||||||
|
FCODE(andnp)(xmm0, tmp);
|
||||||
|
FCODE(blendvp)(result, twos);
|
||||||
|
|
||||||
|
ctx.reg_alloc.DefineValue(inst, result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm();
|
const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm();
|
||||||
const Xbyak::Xmm xmm_a = ctx.reg_alloc.UseXmm(args[0]);
|
const Xbyak::Xmm xmm_a = ctx.reg_alloc.UseXmm(args[0]);
|
||||||
const Xbyak::Xmm xmm_b = ctx.reg_alloc.UseXmm(args[1]);
|
const Xbyak::Xmm xmm_b = ctx.reg_alloc.UseXmm(args[1]);
|
||||||
|
|
Loading…
Reference in a new issue