Skip to content

Commit ce9a1a6

Browse files
committed
A bit more clean-up
1 parent a95b06f commit ce9a1a6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cpu/ppc/ppcmacros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
4848
uint32_t ppc_result_d = ppc_state.gpr[reg_s]; \
4949
uint32_t ppc_result_a = ppc_state.gpr[reg_a];
5050

51+
#define ppc_grab_crfd_regsauimm(opcode) \
52+
int crf_d = (opcode >> 21) & 0x1C; \
53+
int reg_a = (opcode >> 16) & 31; \
54+
uint32_t uimm = uint16_t(opcode); \
55+
uint32_t ppc_result_a = ppc_state.gpr[reg_a];
56+
5157
#define ppc_grab_da(opcode)\
5258
int reg_d = (opcode >> 21) & 31;\
5359
int reg_a = (opcode >> 16) & 31;\

cpu/ppc/ppcopcodes.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,7 @@ void dppc_interpreter::ppc_cmpli() {
12611261
return;
12621262
}
12631263
#endif
1264-
int crf_d = (ppc_cur_instruction >> 21) & 0x1C;
1265-
ppc_grab_regssauimm(ppc_cur_instruction);
1264+
ppc_grab_crfd_regsauimm(ppc_cur_instruction);
12661265
uint32_t xercon = (ppc_state.spr[SPR::XER] & XER::SO) >> 3;
12671266
uint32_t cmp_c = (ppc_result_a == uimm) ? 0x20000000UL : \
12681267
(ppc_result_a > uimm) ? 0x40000000UL : 0x80000000UL;
@@ -1467,7 +1466,7 @@ void dppc_interpreter::ppc_dcbtst() {
14671466
}
14681467

14691468
void dppc_interpreter::ppc_dcbz() {
1470-
ppc_grab_regsdab(ppc_cur_instruction);
1469+
ppc_grab_regsab(ppc_cur_instruction);
14711470
ppc_effective_address = ppc_result_b + (reg_a ? ppc_result_a : 0);
14721471

14731472
ppc_effective_address &= 0xFFFFFFE0UL; // align EA on a 32-byte boundary

0 commit comments

Comments
 (0)