diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-01-21 01:49:14 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2014-01-21 01:49:14 +0000 |
commit | 7492c1ceb7dd157d6c351723ad12398146789d08 (patch) | |
tree | b511567ce7c0f62de0f0a1d96fe5e05405dd9302 | |
parent | 510d1837350aee0818106a3c9661ba86b40b66a7 (diff) | |
download | pcre-7492c1ceb7dd157d6c351723ad12398146789d08.tar.gz |
Little endian PowerPC systems are supported now by the JIT compiler.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1451 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | sljit/sljitConfigInternal.h | 17 | ||||
-rw-r--r-- | sljit/sljitLir.c | 2 | ||||
-rw-r--r-- | sljit/sljitNativePPC_common.c | 17 |
4 files changed, 31 insertions, 7 deletions
@@ -94,6 +94,8 @@ Version 8.35-RC1 xx-xxxx-201x 18. pcretest was missing "-C bsr" for displaying the \R default setting. +19. Little endian PowerPC systems are supported now by the JIT compiler. + Version 8.34 15-December-2013 ----------------------------- diff --git a/sljit/sljitConfigInternal.h b/sljit/sljitConfigInternal.h index af455df..5e2618a 100644 --- a/sljit/sljitConfigInternal.h +++ b/sljit/sljitConfigInternal.h @@ -353,11 +353,15 @@ typedef double sljit_d; #if !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN) -/* These macros are useful for the application. */ +/* These macros are useful for the applications. */ #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) \ - || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) \ - || (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) + || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) + +#ifdef __LITTLE_ENDIAN__ +#define SLJIT_LITTLE_ENDIAN 1 +#else #define SLJIT_BIG_ENDIAN 1 +#endif #elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) @@ -367,6 +371,10 @@ typedef double sljit_d; #define SLJIT_BIG_ENDIAN 1 #endif +#elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) + +#define SLJIT_BIG_ENDIAN 1 + #else #define SLJIT_LITTLE_ENDIAN 1 #endif @@ -383,7 +391,8 @@ typedef double sljit_d; #endif #ifndef SLJIT_INDIRECT_CALL -#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) || (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32 && defined _AIX) +#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)) \ + || ((defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) && defined _AIX) /* It seems certain ppc compilers use an indirect addressing for functions which makes things complicated. */ #define SLJIT_INDIRECT_CALL 1 diff --git a/sljit/sljitLir.c b/sljit/sljitLir.c index 53d208a..6d3267d 100644 --- a/sljit/sljitLir.c +++ b/sljit/sljitLir.c @@ -217,7 +217,7 @@ #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 -#if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) +#ifdef _AIX #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_sw)) #else #define FIXED_LOCALS_OFFSET (2 * sizeof(sljit_sw)) diff --git a/sljit/sljitNativePPC_common.c b/sljit/sljitNativePPC_common.c index 67e6898..a92fdce 100644 --- a/sljit/sljitNativePPC_common.c +++ b/sljit/sljitNativePPC_common.c @@ -33,6 +33,11 @@ SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name(void) Both for ppc-32 and ppc-64. */ typedef sljit_ui sljit_ins; +#if ((defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) && (defined _AIX)) \ + || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) +#define SLJIT_PPC_ABI_V2 1 +#endif + #ifdef _AIX #include <sys/cache.h> #endif @@ -509,7 +514,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil FAIL_IF(push_inst(compiler, STACK_STORE | S(SLJIT_SAVED_EREG1) | A(SLJIT_LOCALS_REG) | IMM(-5 * (sljit_si)(sizeof(sljit_sw))) )); if (saveds >= 5) FAIL_IF(push_inst(compiler, STACK_STORE | S(SLJIT_SAVED_EREG2) | A(SLJIT_LOCALS_REG) | IMM(-6 * (sljit_si)(sizeof(sljit_sw))) )); +#if (defined SLJIT_PPC_ABI_V2 && SLJIT_PPC_ABI_V2) + FAIL_IF(push_inst(compiler, STACK_STORE | S(0) | A(SLJIT_LOCALS_REG) | IMM(2 * sizeof(sljit_sw)) )); +#else FAIL_IF(push_inst(compiler, STACK_STORE | S(0) | A(SLJIT_LOCALS_REG) | IMM(sizeof(sljit_sw)) )); +#endif FAIL_IF(push_inst(compiler, ADDI | D(ZERO_REG) | A(0) | 0)); if (args >= 1) @@ -519,7 +528,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil if (args >= 3) FAIL_IF(push_inst(compiler, OR | S(SLJIT_SCRATCH_REG3) | A(SLJIT_SAVED_REG3) | B(SLJIT_SCRATCH_REG3))); -#if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) +#if (defined SLJIT_PPC_ABI_V2 && SLJIT_PPC_ABI_V2) compiler->local_size = (1 + saveds + 6 + 8) * sizeof(sljit_sw) + local_size; #else compiler->local_size = (1 + saveds + 2) * sizeof(sljit_sw) + local_size; @@ -556,7 +565,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, compiler->logical_local_size = local_size; #endif -#if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) +#if (defined SLJIT_PPC_ABI_V2 && SLJIT_PPC_ABI_V2) compiler->local_size = (1 + saveds + 6 + 8) * sizeof(sljit_sw) + local_size; #else compiler->local_size = (1 + saveds + 2) * sizeof(sljit_sw) + local_size; @@ -578,7 +587,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compi FAIL_IF(push_inst(compiler, ADD | D(SLJIT_LOCALS_REG) | A(SLJIT_LOCALS_REG) | B(0))); } +#if (defined SLJIT_PPC_ABI_V2 && SLJIT_PPC_ABI_V2) + FAIL_IF(push_inst(compiler, STACK_LOAD | D(0) | A(SLJIT_LOCALS_REG) | IMM(2 * sizeof(sljit_sw)))); +#else FAIL_IF(push_inst(compiler, STACK_LOAD | D(0) | A(SLJIT_LOCALS_REG) | IMM(sizeof(sljit_sw)))); +#endif if (compiler->saveds >= 5) FAIL_IF(push_inst(compiler, STACK_LOAD | D(SLJIT_SAVED_EREG2) | A(SLJIT_LOCALS_REG) | IMM(-6 * (sljit_si)(sizeof(sljit_sw))) )); if (compiler->saveds >= 4) |