From 157c7780af7bbe9061a0a44d720622270b8838df Mon Sep 17 00:00:00 2001 From: DrChat Date: Sat, 3 Mar 2018 18:24:57 -0600 Subject: [PATCH] [JIT] Add V128 ADD/SUB (fixes #1095) --- src/xenia/cpu/backend/x64/x64_sequences.cc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index f9b7960df..f2dfb89f0 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -3674,8 +3674,16 @@ struct ADD_F64 : Sequence> { }); } }; +struct ADD_V128 : Sequence> { + static void Emit(X64Emitter& e, const EmitArgType& i) { + EmitCommutativeBinaryXmmOp(e, i, + [](X64Emitter& e, Xmm dest, Xmm src1, Xmm src2) { + e.vaddps(dest, src1, src2); + }); + } +}; EMITTER_OPCODE_TABLE(OPCODE_ADD, ADD_I8, ADD_I16, ADD_I32, ADD_I64, ADD_F32, - ADD_F64); + ADD_F64, ADD_V128); // ============================================================================ // OPCODE_ADD_CARRY @@ -3882,8 +3890,17 @@ struct SUB_F64 : Sequence> { }); } }; +struct SUB_V128 : Sequence> { + static void Emit(X64Emitter& e, const EmitArgType& i) { + assert_true(!i.instr->flags); + EmitAssociativeBinaryXmmOp(e, i, + [](X64Emitter& e, Xmm dest, Xmm src1, Xmm src2) { + e.vsubps(dest, src1, src2); + }); + } +}; EMITTER_OPCODE_TABLE(OPCODE_SUB, SUB_I8, SUB_I16, SUB_I32, SUB_I64, SUB_F32, - SUB_F64); + SUB_F64, SUB_V128); // ============================================================================ // OPCODE_VECTOR_SUB