summaryrefslogtreecommitdiff
path: root/sljit
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-17 11:52:43 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-17 11:52:43 +0000
commit305ba99ed65522dbeef23c125eed3271cde7fbf8 (patch)
tree093a34a9566ef9ca0528b0fd9094c4b15538d284 /sljit
parentc79fd890ec446bf923ba9d4f16e54908db38df29 (diff)
downloadpcre-305ba99ed65522dbeef23c125eed3271cde7fbf8.tar.gz
JIT test prints cpu info
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@884 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'sljit')
-rw-r--r--sljit/sljitLir.c26
-rw-r--r--sljit/sljitNativeARM_Thumb2.c2
-rw-r--r--sljit/sljitNativeARM_v5.c4
-rw-r--r--sljit/sljitNativeMIPS_common.c6
-rw-r--r--sljit/sljitNativePPC_common.c6
-rw-r--r--sljit/sljitNativeX86_common.c6
6 files changed, 32 insertions, 18 deletions
diff --git a/sljit/sljitLir.c b/sljit/sljitLir.c
index c2a636b..c1fa5e4 100644
--- a/sljit/sljitLir.c
+++ b/sljit/sljitLir.c
@@ -1153,6 +1153,32 @@ static SLJIT_INLINE int emit_mov_before_return(struct sljit_compiler *compiler,
return sljit_emit_op1(compiler, op, SLJIT_RETURN_REG, 0, src, srcw);
}
+/* CPU description section */
+
+#if (defined SLJIT_32BIT_ARCHITECTURE && SLJIT_32BIT_ARCHITECTURE)
+#define SLJIT_CPUINFO_PART1 " 32bit ("
+#elif (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
+#define SLJIT_CPUINFO_PART1 " 64bit ("
+#else
+#error "Internal error: CPU type info missing"
+#endif
+
+#if (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
+#define SLJIT_CPUINFO_PART2 "little endian + "
+#elif (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)
+#define SLJIT_CPUINFO_PART2 "big endian + "
+#else
+#error "Internal error: CPU type info missing"
+#endif
+
+#if (defined SLJIT_UNALIGNED && SLJIT_UNALIGNED)
+#define SLJIT_CPUINFO_PART3 "unaligned)"
+#else
+#define SLJIT_CPUINFO_PART3 "aligned)"
+#endif
+
+#define SLJIT_CPUINFO SLJIT_CPUINFO_PART1 SLJIT_CPUINFO_PART2 SLJIT_CPUINFO_PART3
+
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
#include "sljitNativeX86_common.c"
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
diff --git a/sljit/sljitNativeARM_Thumb2.c b/sljit/sljitNativeARM_Thumb2.c
index 5455ce6..a51536b 100644
--- a/sljit/sljitNativeARM_Thumb2.c
+++ b/sljit/sljitNativeARM_Thumb2.c
@@ -26,7 +26,7 @@
SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name()
{
- return "arm-thumb2";
+ return "ARM-Thumb2" SLJIT_CPUINFO;
}
/* Last register + 1. */
diff --git a/sljit/sljitNativeARM_v5.c b/sljit/sljitNativeARM_v5.c
index 63bc6ee..e3a5873 100644
--- a/sljit/sljitNativeARM_v5.c
+++ b/sljit/sljitNativeARM_v5.c
@@ -27,9 +27,9 @@
SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name()
{
#if (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
- return "arm-v7";
+ return "ARMv7" SLJIT_CPUINFO;
#elif (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
- return "arm-v5";
+ return "ARMv5" SLJIT_CPUINFO;
#else
#error "Internal error: Unknown ARM architecture"
#endif
diff --git a/sljit/sljitNativeMIPS_common.c b/sljit/sljitNativeMIPS_common.c
index 0358585..3c6ee66 100644
--- a/sljit/sljitNativeMIPS_common.c
+++ b/sljit/sljitNativeMIPS_common.c
@@ -26,11 +26,7 @@
SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name()
{
-#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
- return "mips-32";
-#else
-#error "mips-64 is not yet supported"
-#endif
+ return "MIPS" SLJIT_CPUINFO;
}
/* Latest MIPS architecture. */
diff --git a/sljit/sljitNativePPC_common.c b/sljit/sljitNativePPC_common.c
index b45b476..f0f191d 100644
--- a/sljit/sljitNativePPC_common.c
+++ b/sljit/sljitNativePPC_common.c
@@ -26,11 +26,7 @@
SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name()
{
-#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
- return "ppc-32";
-#else
- return "ppc-64";
-#endif
+ return "PowerPC" SLJIT_CPUINFO;
}
/* Length of an instruction word.
diff --git a/sljit/sljitNativeX86_common.c b/sljit/sljitNativeX86_common.c
index 9df4f4e..1ed9649 100644
--- a/sljit/sljitNativeX86_common.c
+++ b/sljit/sljitNativeX86_common.c
@@ -26,11 +26,7 @@
SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name()
{
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
- return "x86-32";
-#else
- return "x86-64";
-#endif
+ return "x86" SLJIT_CPUINFO;
}
/*