diff options
author | twinaphex | 2017-05-03 03:55:32 +0200 |
---|---|---|
committer | twinaphex | 2017-05-03 03:55:32 +0200 |
commit | f0a02fdcf0043d9afa9c4b26c38c28cb761e1e10 (patch) | |
tree | c4200a0cd30014da03c08455a6f619fedde4bc31 | |
parent | ee091481d4aa4a525f84f9c499641c9ba49b8164 (diff) | |
parent | 0e4ad31902f206e2c6945632bb1f558eae941ff1 (diff) | |
download | pcsx_rearmed-f0a02fdcf0043d9afa9c4b26c38c28cb761e1e10.tar.gz pcsx_rearmed-f0a02fdcf0043d9afa9c4b26c38c28cb761e1e10.tar.bz2 pcsx_rearmed-f0a02fdcf0043d9afa9c4b26c38c28cb761e1e10.zip |
Merge https://github.com/notaz/pcsx_rearmed
-rw-r--r-- | include/arm_features.h | 4 | ||||
-rw-r--r-- | libpcsxcore/new_dynarec/arm/linkage_arm.S | 12 | ||||
-rw-r--r-- | libpcsxcore/new_dynarec/new_dynarec.c | 2 | ||||
-rw-r--r-- | plugins/dfsound/arm_utils.S | 10 | ||||
-rw-r--r-- | plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S | 21 |
5 files changed, 22 insertions, 27 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/arm/linkage_arm.S b/libpcsxcore/new_dynarec/arm/linkage_arm.S index b630142..269eb99 100644 --- a/libpcsxcore/new_dynarec/arm/linkage_arm.S +++ b/libpcsxcore/new_dynarec/arm/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/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index d2cd270..dfa17a7 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -7123,7 +7123,7 @@ void new_dynarec_init(void) #else #ifndef NO_WRITE_EXEC // not all systems allow execute in data segment by default - if (mprotect((void*)BASE_ADDR, 1<<TARGET_SIZE_2, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) + if (mprotect((void *)BASE_ADDR, 1<<TARGET_SIZE_2, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) SysPrintf("mprotect() failed: %s\n", strerror(errno)); #endif #endif 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 |