From e47d0d11c3afc668642f864a89b9eb2bd72e0b45 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Fri, 4 Jun 2021 19:26:36 -0700 Subject: [PATCH] emit_x64_vector: AVX512 implementation of EmitVectorNot Single in-place ternary logic instruction. --- src/dynarmic/backend/x64/emit_x64_vector.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dynarmic/backend/x64/emit_x64_vector.cpp b/src/dynarmic/backend/x64/emit_x64_vector.cpp index 4615320d..5f9bd0c4 100644 --- a/src/dynarmic/backend/x64/emit_x64_vector.cpp +++ b/src/dynarmic/backend/x64/emit_x64_vector.cpp @@ -2137,12 +2137,18 @@ void EmitX64::EmitVectorNarrow64(EmitContext& ctx, IR::Inst* inst) { void EmitX64::EmitVectorNot(EmitContext& ctx, IR::Inst* inst) { auto args = ctx.reg_alloc.GetArgumentInfo(inst); + if (code.HasHostFeature(HostFeature::AVX512_Ortho)) { + const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm(); + const Xbyak::Xmm operand = ctx.reg_alloc.UseXmm(args[0]); + code.vpternlogq(result, operand, operand, u8(~Tern::c)); + ctx.reg_alloc.DefineValue(inst, result); + return; + } + const Xbyak::Xmm xmm_a = ctx.reg_alloc.UseScratchXmm(args[0]); const Xbyak::Xmm xmm_b = ctx.reg_alloc.ScratchXmm(); - code.pcmpeqw(xmm_b, xmm_b); code.pxor(xmm_a, xmm_b); - ctx.reg_alloc.DefineValue(inst, xmm_a); }