Browse Source

Use separate JIT_REG_xxx flags for float32, float64, and nfloat


			
			
				cache-refactoring
			
			
		
Rhys Weatherley 21 years ago
parent
commit
27d58523cf
  1. 8
      ChangeLog
  2. 12
      jit/jit-reg-alloc.c
  3. 3
      jit/jit-rules-arm.h
  4. 8
      jit/jit-rules-interp.c
  5. 50
      jit/jit-rules-interp.h
  6. 22
      jit/jit-rules-x86.h
  7. 22
      jit/jit-rules.h

8
ChangeLog

@ -1,4 +1,12 @@
2004-06-24 Rhys Weatherley <rweather@southern-storm.com.au>
* jit/jit-reg-alloc.c, jit/jit-rules-arm.h, jit/jit-rules-interp.c,
jit/jit-rules-interp.h, jit/jit-rules-x86.h, jit/jit-rules.h:
use separate JIT_REG_xxx flags for float32, float64, and nfloat
because some platforms need to put these values in different
types of registers (e.g. x86-64).
2004-06-22 Rhys Weatherley <rweather@southern-storm.com.au>
* jit/jit-insn.c: properly set the "may_throw" flag for opcodes

12
jit/jit-reg-alloc.c

@ -955,10 +955,20 @@ static int free_register_for_value
break;
case JIT_TYPE_FLOAT32:
{
type = JIT_REG_FLOAT32;
}
break;
case JIT_TYPE_FLOAT64:
{
type = JIT_REG_FLOAT64;
}
break;
case JIT_TYPE_NFLOAT:
{
type = JIT_REG_FLOAT;
type = JIT_REG_NFLOAT;
}
break;

3
jit/jit-rules-arm.h

@ -43,7 +43,8 @@ extern "C" {
* The floating-point registers are only present on some ARM cores.
*/
#ifdef JIT_ARM_HAS_FLOAT_REGS
#define JIT_REG_ARM_FLOAT JIT_REG_FLOAT | JIT_REG_CALL_USED
#define JIT_REG_ARM_FLOAT \
(JIT_REG_FLOAT32 | JIT_REG_FLOAT64 | JIT_REG_NFLOAT | JIT_REG_CALL_USED)
#else
#define JIT_REG_ARM_FLOAT JIT_REG_FIXED
#endif

8
jit/jit-rules-interp.c

@ -83,7 +83,13 @@ This register can hold an integer word value.
This register can hold a 64-bit long value without needing a
second register. Normally only used on 64-bit platforms.
@item JIT_REG_FLOAT
@item JIT_REG_FLOAT32
This register can hold a 32-bit floating-point value.
@item JIT_REG_FLOAT64
This register can hold a 64-bit floating-point value.
@item JIT_REG_NFLOAT
This register can hold a native floating-point value.
@item JIT_REG_FRAME

50
jit/jit-rules-interp.h

@ -31,38 +31,24 @@ extern "C" {
* Information about all of the registers, in allocation order.
*/
#define JIT_REG_INFO \
{"r0", 0, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_START_STACK | JIT_REG_IN_STACK}, \
{"r1", 1, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r2", 2, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r3", 3, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r4", 4, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r5", 5, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r6", 6, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r7", 7, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r8", 8, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r9", 9, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r10", 10, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r11", 11, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r12", 12, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r13", 13, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r14", 14, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r15", 15, -1, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT | \
JIT_REG_CALL_USED | JIT_REG_END_STACK | JIT_REG_IN_STACK},
{"r0", 0, -1, JIT_REG_ALL | JIT_REG_CALL_USED | \
JIT_REG_START_STACK | JIT_REG_IN_STACK}, \
{"r1", 1, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r2", 2, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r3", 3, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r4", 4, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r5", 5, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r6", 6, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r7", 7, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r8", 8, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r9", 9, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r10", 10, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r11", 11, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r12", 12, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r13", 13, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r14", 14, -1, JIT_REG_ALL | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"r15", 15, -1, JIT_REG_ALL | JIT_REG_CALL_USED | \
JIT_REG_END_STACK | JIT_REG_IN_STACK},
#define JIT_NUM_REGS 16
#define JIT_NUM_GLOBAL_REGS 0

22
jit/jit-rules-x86.h

@ -28,6 +28,8 @@ extern "C" {
/*
* Information about all of the registers, in allocation order.
*/
#define JIT_REG_X86_FLOAT \
(JIT_REG_FLOAT32 | JIT_REG_FLOAT64 | JIT_REG_NFLOAT)
#define JIT_REG_INFO \
{"eax", 0, 2, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_CALL_USED}, \
{"ecx", 1, 3, JIT_REG_WORD | JIT_REG_LONG | JIT_REG_CALL_USED}, \
@ -37,16 +39,16 @@ extern "C" {
{"edi", 7, -1, JIT_REG_WORD | JIT_REG_GLOBAL}, \
{"ebp", 4, -1, JIT_REG_FRAME | JIT_REG_FIXED}, \
{"esp", 5, -1, JIT_REG_STACK_PTR | JIT_REG_FIXED | JIT_REG_CALL_USED}, \
{"st", 0, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_START_STACK | \
JIT_REG_IN_STACK}, \
{"st1", 1, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st2", 2, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st3", 3, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st4", 4, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st5", 5, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st6", 6, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st7", 7, -1, JIT_REG_FLOAT | JIT_REG_CALL_USED | JIT_REG_END_STACK | \
JIT_REG_IN_STACK},
{"st", 0, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | \
JIT_REG_START_STACK | JIT_REG_IN_STACK}, \
{"st1", 1, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st2", 2, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st3", 3, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st4", 4, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st5", 5, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st6", 6, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | JIT_REG_IN_STACK}, \
{"st7", 7, -1, JIT_REG_X86_FLOAT | JIT_REG_CALL_USED | \
JIT_REG_END_STACK | JIT_REG_IN_STACK},
#define JIT_NUM_REGS 16
#define JIT_NUM_GLOBAL_REGS 3

22
jit/jit-rules.h

@ -60,15 +60,19 @@ typedef struct
*/
#define JIT_REG_WORD (1 << 0) /* Can be used for word values */
#define JIT_REG_LONG (1 << 1) /* Can be used for long values */
#define JIT_REG_FLOAT (1 << 2) /* Can be used for float values */
#define JIT_REG_FRAME (1 << 3) /* Contains frame pointer */
#define JIT_REG_STACK_PTR (1 << 4) /* Contains CPU stack pointer */
#define JIT_REG_FIXED (1 << 5) /* Fixed use; not for allocation */
#define JIT_REG_CALL_USED (1 << 6) /* Destroyed by a call */
#define JIT_REG_START_STACK (1 << 7) /* Stack of stack-like allocation */
#define JIT_REG_END_STACK (1 << 8) /* End of stack-like allocation */
#define JIT_REG_IN_STACK (1 << 9) /* Middle of stack-like allocation */
#define JIT_REG_GLOBAL (1 << 10) /* Candidate for global allocation */
#define JIT_REG_FLOAT32 (1 << 2) /* Can be used for float32 values */
#define JIT_REG_FLOAT64 (1 << 3) /* Can be used for float64 values */
#define JIT_REG_NFLOAT (1 << 4) /* Can be used for nfloat values */
#define JIT_REG_FRAME (1 << 5) /* Contains frame pointer */
#define JIT_REG_STACK_PTR (1 << 6) /* Contains CPU stack pointer */
#define JIT_REG_FIXED (1 << 7) /* Fixed use; not for allocation */
#define JIT_REG_CALL_USED (1 << 8) /* Destroyed by a call */
#define JIT_REG_START_STACK (1 << 9) /* Stack of stack-like allocation */
#define JIT_REG_END_STACK (1 << 10) /* End of stack-like allocation */
#define JIT_REG_IN_STACK (1 << 11) /* Middle of stack-like allocation */
#define JIT_REG_GLOBAL (1 << 12) /* Candidate for global allocation */
#define JIT_REG_ALL (JIT_REG_WORD | JIT_REG_LONG | JIT_REG_FLOAT32 | \
JIT_REG_FLOAT64 | JIT_REG_NFLOAT)
/*
* Include definitions that are specific to the backend.

Loading…
Cancel
Save