diff options
author | notaz | 2017-05-03 02:52:15 +0300 |
---|---|---|
committer | notaz | 2017-05-03 02:52:15 +0300 |
commit | 0e4ad31902f206e2c6945632bb1f558eae941ff1 (patch) | |
tree | 81435eaaac3be5d685132259f79794fb556bd431 | |
parent | 25e52b2c51afd3609aa2a0e218036d27520af510 (diff) | |
download | pcsx_rearmed-0e4ad31902f206e2c6945632bb1f558eae941ff1.tar.gz pcsx_rearmed-0e4ad31902f206e2c6945632bb1f558eae941ff1.tar.bz2 pcsx_rearmed-0e4ad31902f206e2c6945632bb1f558eae941ff1.zip |
use pc-relative offsets for PIC too
-rw-r--r-- | include/arm_features.h | 4 | ||||
-rw-r--r-- | libpcsxcore/new_dynarec/linkage_arm.S | 12 | ||||
-rw-r--r-- | plugins/dfsound/arm_utils.S | 10 | ||||
-rw-r--r-- | plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S | 21 |
4 files changed, 21 insertions, 26 deletions
diff --git a/include/arm_features.h b/include/arm_features.h index f35e0b7..7c82ff3 100644 --- a/include/arm_features.h +++ b/include/arm_features.h @@ -73,4 +73,8 @@ #endif +#if defined(__MACH__) || defined(__PIC__) +#define TEXRELS_FORBIDDEN +#endif + #endif /* __ARM_FEATURES_H__ */ diff --git a/libpcsxcore/new_dynarec/linkage_arm.S b/libpcsxcore/new_dynarec/linkage_arm.S index 147b0df..d32dc0b 100644 --- a/libpcsxcore/new_dynarec/linkage_arm.S +++ b/libpcsxcore/new_dynarec/linkage_arm.S @@ -93,7 +93,7 @@ DRC_VAR(restore_candidate, 512) DRC_VAR(FCR0, 4) DRC_VAR(FCR31, 4) -#ifdef __MACH__ +#ifdef TEXRELS_FORBIDDEN .data .align 2 ptr_jump_in: @@ -117,21 +117,21 @@ ptr_hash_table: #endif .macro load_varadr reg var -#if defined(HAVE_ARMV7) && !defined(__PIC__) - movw \reg, #:lower16:\var - movt \reg, #:upper16:\var -#elif defined(HAVE_ARMV7) && defined(__MACH__) +#if defined(HAVE_ARMV7) && defined(TEXRELS_FORBIDDEN) movw \reg, #:lower16:(\var-(1678f+8)) movt \reg, #:upper16:(\var-(1678f+8)) 1678: add \reg, pc +#elif defined(HAVE_ARMV7) && !defined(__PIC__) + movw \reg, #:lower16:\var + movt \reg, #:upper16:\var #else ldr \reg, =\var #endif .endm .macro load_varadr_ext reg var -#if defined(HAVE_ARMV7) && defined(__MACH__) && defined(__PIC__) +#if defined(HAVE_ARMV7) && defined(TEXRELS_FORBIDDEN) movw \reg, #:lower16:(ptr_\var-(1678f+8)) movt \reg, #:upper16:(ptr_\var-(1678f+8)) 1678: diff --git a/plugins/dfsound/arm_utils.S b/plugins/dfsound/arm_utils.S index eaeca51..8ac7c30 100644 --- a/plugins/dfsound/arm_utils.S +++ b/plugins/dfsound/arm_utils.S @@ -10,7 +10,7 @@ #include "arm_features.h" -#ifdef __MACH__ +#ifdef TEXRELS_FORBIDDEN .data .align 2 ptr_ChanBuf: .word ESYM(ChanBuf) @@ -20,14 +20,14 @@ ptr_ChanBuf: .word ESYM(ChanBuf) .align 2 .macro load_varadr reg var -#if defined(HAVE_ARMV7) && !defined(__PIC__) - movw \reg, #:lower16:ESYM(\var) - movt \reg, #:upper16:ESYM(\var) -#elif defined(HAVE_ARMV7) && defined(__MACH__) +#if defined(HAVE_ARMV7) && defined(TEXRELS_FORBIDDEN) movw \reg, #:lower16:(ptr_\var-(1678f+8)) movt \reg, #:upper16:(ptr_\var-(1678f+8)) 1678: ldr \reg, [pc, \reg] +#elif defined(HAVE_ARMV7) && !defined(__PIC__) + movw \reg, #:lower16:ESYM(\var) + movt \reg, #:upper16:ESYM(\var) #else ldr \reg, =ESYM(\var) #endif diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S index 110c868..7c820d2 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S @@ -194,26 +194,18 @@ .align 4 -#ifndef __MACH__ +#include "arm_features.h" -#define function(name) \ - .global name; \ - .type name, %function; \ - name: \ +#define function(name) FUNCTION(name): + +#ifndef TEXRELS_FORBIDDEN #define JT_OP_REL(table_label, index_reg, temp) #define JT_OP(x...) x #define JTE(start, target) target -#define EXTRA_UNSAVED_REGS - #else -#define function(name) \ - .globl _##name; \ - name: \ - _##name: \ - #define JT_OP_REL(table_label, index_reg, temp) \ adr temp, table_label; \ ldr temp, [temp, index_reg, lsl #2]; \ @@ -222,13 +214,12 @@ #define JT_OP(x...) #define JTE(start, target) (target - start) -// r7 is preserved, but add it for EABI alignment.. -#define EXTRA_UNSAVED_REGS r7, r9, +#endif +#ifdef __MACH__ #define flush_render_block_buffer _flush_render_block_buffer #define setup_sprite_untextured_simple _setup_sprite_untextured_simple #define update_texture_8bpp_cache _update_texture_8bpp_cache - #endif @ r0: psx_gpu |