From 8e86562b01717985051a922e8e5aa5bb73be92b1 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 7 Apr 2022 23:22:20 -0400 Subject: drcbex64.cpp: Fix assert in debug build with some CPUs (PowerPC, SH) --- src/devices/cpu/drcbex64.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index ad005425fa2..a8abda5a5d4 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -2642,8 +2642,6 @@ void drcbe_x64::op_carry(Assembler &a, const instruction &inst) be_parameter srcp(*this, inst.param(0), PTYPE_MRI); be_parameter bitp(*this, inst.param(1), PTYPE_MRI); - Gp const src = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, srcp.ireg()); - // degenerate case: source is immediate if (srcp.is_immediate() && bitp.is_immediate()) { @@ -2660,18 +2658,19 @@ void drcbe_x64::op_carry(Assembler &a, const instruction &inst) a.and_(ecx, inst.size() * 8 - 1); } - if (bitp.is_immediate()) + if (srcp.is_memory()) { - if (srcp.is_memory()) + if (bitp.is_immediate()) a.bt(MABS(srcp.memory(), inst.size()), bitp.immediate()); // bt [srcp],bitp - else if (srcp.is_int_register()) - a.bt(src, bitp.immediate()); // bt srcp,bitp + else + a.bt(MABS(srcp.memory(), inst.size()), ecx); // bt [srcp],ecx } - else + else if (srcp.is_int_register()) { - if (srcp.is_memory()) - a.bt(MABS(srcp.memory(), inst.size()), ecx); // bt [srcp],ecx - else if (srcp.is_int_register()) + Gp const src = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, srcp.ireg()); + if (bitp.is_immediate()) + a.bt(src, bitp.immediate()); // bt srcp,bitp + else a.bt(src, ecx); // bt srcp,ecx } } -- cgit v1.2.3