From bbdd626a0c0ee655391bb7454303b475c2443db0 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 17 Dec 2024 21:36:52 +0200 Subject: [PATCH] drc: avoid mov pc DDI0406 A4.1.1 "Changing between Thumb state and ARM state" recommends against mov pc, and recent compilers completely avoid it too. --- libpcsxcore/new_dynarec/linkage_arm.S | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libpcsxcore/new_dynarec/linkage_arm.S b/libpcsxcore/new_dynarec/linkage_arm.S index 01cb42ca..37afa972 100644 --- a/libpcsxcore/new_dynarec/linkage_arm.S +++ b/libpcsxcore/new_dynarec/linkage_arm.S @@ -165,7 +165,7 @@ FUNCTION(dyna_linker): beq 0f add r6, r5, r6, asr #6 /* old target */ teq r0, r6 - moveq pc, r0 /* Stale i-cache */ + bxeq r0 /* Stale i-cache */ mov r0, r4 mov r1, r6 bl ndrc_add_jump_out @@ -176,7 +176,7 @@ FUNCTION(dyna_linker): sub r1, r1, #2 add r1, r1, r2, lsr #8 str r1, [r5] - mov pc, r8 + bx r8 0: mov r0, r4 #else @@ -184,7 +184,7 @@ FUNCTION(dyna_linker): #endif ldr r1, [fp, #LO_hash_table_ptr] bl ndrc_get_addr_ht - mov pc, r0 + bx r0 .size dyna_linker, .-dyna_linker .align 2 @@ -234,7 +234,7 @@ FUNCTION(jump_vaddr_r7): FUNCTION(jump_vaddr_r0): ldr r1, [fp, #LO_hash_table_ptr] bl ndrc_get_addr_ht - mov pc, r0 + bx r0 .size jump_vaddr_r0, .-jump_vaddr_r0 .align 2 @@ -257,10 +257,10 @@ FUNCTION(cc_interrupt): tst r2, r2 ldmfdne sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, pc} cmp r0, r9 - moveq pc, lr + bxeq lr ldr r1, [fp, #LO_hash_table_ptr] bl ndrc_get_addr_ht - mov pc, r0 + bx r0 .size cc_interrupt, .-cc_interrupt .align 2 @@ -317,7 +317,7 @@ FUNCTION(jump_to_new_pc): bne new_dyna_leave ldr r1, [fp, #LO_hash_table_ptr] bl ndrc_get_addr_ht - mov pc, r0 + bx r0 .size jump_to_new_pc, .-jump_to_new_pc .align 2 @@ -427,7 +427,7 @@ new_dyna_start_at_e: ldr r10, [fp, #LO_cycle] str r1, [fp, #LO_last_count] sub r10, r10, r1 - mov pc, r0 + bx r0 .size new_dyna_start, .-new_dyna_start /* --------------------------------------- */ @@ -456,7 +456,7 @@ new_dyna_start_at_e: .else \readop r0, [r1, r3, lsl #\tab_shift] .endif - movcc pc, lr + bxcc lr mov r2, r12 str r12, [fp, #LO_cycle] .endm @@ -495,7 +495,7 @@ FUNCTION(jump_handler_read32): .else \wrtop r1, [r3, r12, lsl #\tab_shift] .endif - movcc pc, lr + bxcc lr ldr r12, [fp, #LO_last_count] mov r0, r1 add r2, r2, r12 -- 2.39.5