Revision: 1280
http://vcs.pcre.org/viewvc?view=rev&revision=1280
Author: zherczeg
Date: 2013-03-15 06:58:31 +0000 (Fri, 15 Mar 2013)
Log Message:
-----------
JIT compiler update.
Modified Paths:
--------------
code/trunk/sljit/sljitLir.c
code/trunk/sljit/sljitLir.h
code/trunk/sljit/sljitNativeARM_Thumb2.c
code/trunk/sljit/sljitNativeARM_v5.c
code/trunk/sljit/sljitNativeMIPS_common.c
code/trunk/sljit/sljitNativePPC_common.c
code/trunk/sljit/sljitNativeSPARC_common.c
code/trunk/sljit/sljitNativeX86_common.c
Modified: code/trunk/sljit/sljitLir.c
===================================================================
--- code/trunk/sljit/sljitLir.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitLir.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -993,6 +993,12 @@
SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_REGISTERS);
}
+static SLJIT_INLINE void check_sljit_get_float_register_index(sljit_si reg)
+{
+ SLJIT_UNUSED_ARG(reg);
+ SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_FLOAT_REGISTERS);
+}
+
static SLJIT_INLINE void check_sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{
Modified: code/trunk/sljit/sljitLir.h
===================================================================
--- code/trunk/sljit/sljitLir.h 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitLir.h 2013-03-15 06:58:31 UTC (rev 1280)
@@ -161,13 +161,15 @@
/* Floating point operations are performed on double or
single precision values. */
-#define SLJIT_FLOAT_REG1 1
-#define SLJIT_FLOAT_REG2 2
-#define SLJIT_FLOAT_REG3 3
-#define SLJIT_FLOAT_REG4 4
-#define SLJIT_FLOAT_REG5 5
-#define SLJIT_FLOAT_REG6 6
+#define SLJIT_FLOAT_REG1 1
+#define SLJIT_FLOAT_REG2 2
+#define SLJIT_FLOAT_REG3 3
+#define SLJIT_FLOAT_REG4 4
+#define SLJIT_FLOAT_REG5 5
+#define SLJIT_FLOAT_REG6 6
+#define SLJIT_NO_FLOAT_REGISTERS 6
+
/* --------------------------------------------------------------------- */
/* Main structures and functions */
/* --------------------------------------------------------------------- */
@@ -698,12 +700,16 @@
/* The following function is a helper function for sljit_emit_op_custom.
It returns with the real machine register index of any SLJIT_SCRATCH
SLJIT_SAVED or SLJIT_LOCALS register.
- Note: it returns with -1 for virtual registers (all EREGs on x86-32).
- Note: register returned by SLJIT_LOCALS_REG is not necessary the real
- stack pointer register of the target architecture. */
+ Note: it returns with -1 for virtual registers (all EREGs on x86-32). */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
+/* The following function is a helper function for sljit_emit_op_custom.
+ It returns with the real machine register index of any SLJIT_FLOAT register.
+ Note: the index is divided by 2 on ARM 32 bit architectures. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
+
/* Any instruction can be inserted into the instruction stream by
sljit_emit_op_custom. It has a similar purpose as inline assembly.
The size parameter must match to the instruction size of the target
Modified: code/trunk/sljit/sljitNativeARM_Thumb2.c
===================================================================
--- code/trunk/sljit/sljitNativeARM_Thumb2.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitNativeARM_Thumb2.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -1526,6 +1526,12 @@
return reg_map[reg];
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg)
+{
+ check_sljit_get_float_register_index(reg);
+ return reg;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{
Modified: code/trunk/sljit/sljitNativeARM_v5.c
===================================================================
--- code/trunk/sljit/sljitNativeARM_v5.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitNativeARM_v5.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -1989,6 +1989,12 @@
return reg_map[reg];
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg)
+{
+ check_sljit_get_float_register_index(reg);
+ return reg;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{
Modified: code/trunk/sljit/sljitNativeMIPS_common.c
===================================================================
--- code/trunk/sljit/sljitNativeMIPS_common.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitNativeMIPS_common.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -1099,6 +1099,12 @@
return reg_map[reg];
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg)
+{
+ check_sljit_get_float_register_index(reg);
+ return reg << 1;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{
Modified: code/trunk/sljit/sljitNativePPC_common.c
===================================================================
--- code/trunk/sljit/sljitNativePPC_common.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitNativePPC_common.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -1507,6 +1507,12 @@
return reg_map[reg];
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg)
+{
+ check_sljit_get_float_register_index(reg);
+ return reg;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{
Modified: code/trunk/sljit/sljitNativeSPARC_common.c
===================================================================
--- code/trunk/sljit/sljitNativeSPARC_common.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitNativeSPARC_common.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -921,6 +921,12 @@
return reg_map[reg];
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg)
+{
+ check_sljit_get_float_register_index(reg);
+ return reg << 1;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{
Modified: code/trunk/sljit/sljitNativeX86_common.c
===================================================================
--- code/trunk/sljit/sljitNativeX86_common.c 2013-03-12 17:27:34 UTC (rev 1279)
+++ code/trunk/sljit/sljitNativeX86_common.c 2013-03-15 06:58:31 UTC (rev 1280)
@@ -2214,6 +2214,12 @@
return reg_map[reg];
}
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg)
+{
+ check_sljit_get_float_register_index(reg);
+ return reg;
+}
+
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size)
{