From d0b0b8070cb4100a3cf7fa3455f5a03d970c0c99 Mon Sep 17 00:00:00 2001 From: joevt Date: Wed, 10 Jan 2024 05:51:14 -0800 Subject: [PATCH] ppcopcodes: Fix l*ux? invalid form check. Invalid form is (reg_a == reg_d) || reg_a == 0. Therefore, valid form is (reg_a != reg_d) && reg_a != 0 !(a || b) == !a && !b --- cpu/ppc/ppcopcodes.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cpu/ppc/ppcopcodes.cpp b/cpu/ppc/ppcopcodes.cpp index 770babb..b95aafc 100644 --- a/cpu/ppc/ppcopcodes.cpp +++ b/cpu/ppc/ppcopcodes.cpp @@ -1808,7 +1808,7 @@ void dppc_interpreter::ppc_lbzu() { #endif ppc_grab_regsda(); ppc_effective_address = int32_t(int16_t(ppc_cur_instruction)); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address += ppc_result_a; //ppc_result_d = mem_grab_byte(ppc_effective_address); ppc_result_d = mmu_read_vmem(ppc_effective_address); @@ -1836,7 +1836,7 @@ void dppc_interpreter::ppc_lbzux() { num_int_loads++; #endif ppc_grab_regsdab(); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address = ppc_result_a + ppc_result_b; //ppc_result_d = mem_grab_byte(ppc_effective_address); ppc_result_d = mmu_read_vmem(ppc_effective_address); @@ -1866,7 +1866,7 @@ void dppc_interpreter::ppc_lhzu() { num_int_loads++; #endif ppc_grab_regsda(); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address = int32_t(int16_t(ppc_cur_instruction)); ppc_effective_address += ppc_result_a; //ppc_result_d = mem_grab_word(ppc_effective_address); @@ -1895,7 +1895,7 @@ void dppc_interpreter::ppc_lhzux() { num_int_loads++; #endif ppc_grab_regsdab(); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address = ppc_result_a + ppc_result_b; //ppc_result_d = mem_grab_word(ppc_effective_address); ppc_result_d = mmu_read_vmem(ppc_effective_address); @@ -1925,7 +1925,7 @@ void dppc_interpreter::ppc_lhau() { num_int_loads++; #endif ppc_grab_regsda(); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address = int32_t(int16_t(ppc_cur_instruction)); ppc_effective_address += ppc_result_a; //uint16_t val = mem_grab_word(ppc_effective_address); @@ -1944,7 +1944,7 @@ void dppc_interpreter::ppc_lhaux() { num_int_loads++; #endif ppc_grab_regsdab(); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address = ppc_result_a + ppc_result_b; // uint16_t val = mem_grab_word(ppc_effective_address); uint16_t val = mmu_read_vmem(ppc_effective_address); @@ -2010,7 +2010,7 @@ void dppc_interpreter::ppc_lwzu() { #endif ppc_grab_regsda(); ppc_effective_address = int32_t(int16_t(ppc_cur_instruction)); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address += ppc_result_a; //ppc_result_d = mem_grab_dword(ppc_effective_address); ppc_result_d = mmu_read_vmem(ppc_effective_address); @@ -2038,7 +2038,7 @@ void dppc_interpreter::ppc_lwzux() { num_int_loads++; #endif ppc_grab_regsdab(); - if ((reg_a != reg_d) || reg_a != 0) { + if ((reg_a != reg_d) && reg_a != 0) { ppc_effective_address = ppc_result_a + ppc_result_b; // ppc_result_d = mem_grab_dword(ppc_effective_address); ppc_result_d = mmu_read_vmem(ppc_effective_address);