diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index f6a688b09..37a05c60b 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -2460,7 +2460,11 @@ struct LOG2_F32 : Sequence> { } static void Emit(X64Emitter& e, const EmitArgType& i) { assert_always(); - e.lea(e.GetNativeParam(0), e.StashXmm(0, i.src1)); + if (i.src1.is_constant) { + e.lea(e.GetNativeParam(0), e.StashConstantXmm(0, i.src1.constant())); + } else { + e.lea(e.GetNativeParam(0), e.StashXmm(0, i.src1)); + } e.CallNativeSafe(reinterpret_cast(EmulateLog2)); e.vmovaps(i.dest, e.xmm0); } @@ -2474,7 +2478,11 @@ struct LOG2_F64 : Sequence> { } static void Emit(X64Emitter& e, const EmitArgType& i) { assert_always(); - e.lea(e.GetNativeParam(0), e.StashXmm(0, i.src1)); + if (i.src1.is_constant) { + e.lea(e.GetNativeParam(0), e.StashConstantXmm(0, i.src1.constant())); + } else { + e.lea(e.GetNativeParam(0), e.StashXmm(0, i.src1)); + } e.CallNativeSafe(reinterpret_cast(EmulateLog2)); e.vmovaps(i.dest, e.xmm0); } @@ -2489,7 +2497,11 @@ struct LOG2_V128 : Sequence> { return _mm_load_ps(values); } static void Emit(X64Emitter& e, const EmitArgType& i) { - e.lea(e.GetNativeParam(0), e.StashXmm(0, i.src1)); + if (i.src1.is_constant) { + e.lea(e.GetNativeParam(0), e.StashConstantXmm(0, i.src1.constant())); + } else { + e.lea(e.GetNativeParam(0), e.StashXmm(0, i.src1)); + } e.CallNativeSafe(reinterpret_cast(EmulateLog2)); e.vmovaps(i.dest, e.xmm0); }