From b5bef8c54d12c365d2cd7213c96759a1b2b21e7f Mon Sep 17 00:00:00 2001 From: gibbed Date: Sun, 19 Jun 2016 02:33:52 -0500 Subject: [PATCH] Undoing the previous commit in favor of finding a better solution (xmm1/xmm2 can't safely be used here). --- src/xenia/cpu/backend/x64/x64_sequences.cc | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index 9d77b6aec..1a255e447 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -567,29 +567,32 @@ struct Sequence { template static void EmitCommutativeBinaryXmmOp(X64Emitter& e, const EmitArgType& i, const FN& fn) { - Xmm src1 = i.src1.is_constant ? e.xmm0 : i.src1; if (i.src1.is_constant) { + assert_true(!i.src2.is_constant); e.LoadConstantXmm(e.xmm0, i.src1.constant()); + fn(e, i.dest, e.xmm0, i.src2); + } else if (i.src2.is_constant) { + assert_true(!i.src1.is_constant); + e.LoadConstantXmm(e.xmm0, i.src2.constant()); + fn(e, i.dest, i.src1, e.xmm0); + } else { + fn(e, i.dest, i.src1, i.src2); } - Xmm src2 = i.src2.is_constant ? e.xmm1 : i.src2; - if (i.src2.is_constant) { - e.LoadConstantXmm(e.xmm1, i.src2.constant()); - } - fn(e, i.dest, src1, src2); } template static void EmitAssociativeBinaryXmmOp(X64Emitter& e, const EmitArgType& i, const FN& fn) { - Xmm src1 = i.src1.is_constant ? e.xmm0 : i.src1; if (i.src1.is_constant) { + assert_true(!i.src2.is_constant); e.LoadConstantXmm(e.xmm0, i.src1.constant()); + fn(e, i.dest, e.xmm0, i.src2); + } else if (i.src2.is_constant) { + e.LoadConstantXmm(e.xmm0, i.src2.constant()); + fn(e, i.dest, i.src1, e.xmm0); + } else { + fn(e, i.dest, i.src1, i.src2); } - Xmm src2 = i.src2.is_constant ? e.xmm1 : i.src2; - if (i.src2.is_constant) { - e.LoadConstantXmm(e.xmm1, i.src2.constant()); - } - fn(e, i.dest, src1, src2); } template