summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-20 16:27:11 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-20 16:27:11 +0000
commit50a41668c9882fecb864bc3178708471d164b6d6 (patch)
treec596ddfc425aed225f7c331ca330a5ca2c6ca920
parent5eab43195462708923e7ef6672fa8feb4493bf33 (diff)
downloadpcre-50a41668c9882fecb864bc3178708471d164b6d6.tar.gz
Small, MIPS related fix in the JIT compiler
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@703 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--sljit/sljitConfigInternal.h11
-rw-r--r--sljit/sljitNativeMIPS_common.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/sljit/sljitConfigInternal.h b/sljit/sljitConfigInternal.h
index 1293f76..5904ced 100644
--- a/sljit/sljitConfigInternal.h
+++ b/sljit/sljitConfigInternal.h
@@ -246,8 +246,17 @@ typedef long int sljit_w;
#if !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN)
/* These macros are useful for the application. */
-#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) || (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
+#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
#define SLJIT_BIG_ENDIAN 1
+
+#elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
+
+#ifdef __MIPSEL__
+#define SLJIT_LITTLE_ENDIAN 1
+#else
+#define SLJIT_BIG_ENDIAN 1
+#endif
+
#else
#define SLJIT_LITTLE_ENDIAN 1
#endif
diff --git a/sljit/sljitNativeMIPS_common.c b/sljit/sljitNativeMIPS_common.c
index 1f10c06..799d06a 100644
--- a/sljit/sljitNativeMIPS_common.c
+++ b/sljit/sljitNativeMIPS_common.c
@@ -373,7 +373,7 @@ void* sljit_generate_code(struct sljit_compiler *compiler)
}
if (jump->flags & PATCH_J) {
SLJIT_ASSERT((addr & ~0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~0xfffffff));
- buf_ptr[0] |= (addr >> 2) & 0x0cffffff;
+ buf_ptr[0] |= (addr >> 2) & 0x03ffffff;
break;
}