From 72bb3e20c022c3289fba57def136dc7d529dcf50 Mon Sep 17 00:00:00 2001 From: twisti Date: Tue, 6 Jun 2006 18:05:16 +0000 Subject: [PATCH] * src/vm/jit/alpha/arch.h (SUPPORT_LONG_DIV_POW2) (SUPPORT_LONG_REM_POW2): Added, as we probably support these two instructions while the architecture does not support long division. * src/vm/jit/i386/arch.h: Likewise. * src/vm/jit/mips/arch.h: Likewise. * src/vm/jit/powerpc/arch.h: Likewise. * src/vm/jit/x86_64/arch.h: Likewise. * src/vm/jit/stack.c (stack_analyse): Use SUPPORT_LONG_DIV_POW2 and SUPPORT_LONG_REM_POW2 instead of SUPPORT_LONG_DIV. --- src/vm/jit/alpha/arch.h | 5 ++++- src/vm/jit/i386/arch.h | 5 ++++- src/vm/jit/mips/arch.h | 8 +++++++- src/vm/jit/powerpc/arch.h | 5 ++++- src/vm/jit/stack.c | 11 ++++++++--- src/vm/jit/x86_64/arch.h | 5 ++++- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/vm/jit/alpha/arch.h b/src/vm/jit/alpha/arch.h index 46e23090d..3be38f515 100644 --- a/src/vm/jit/alpha/arch.h +++ b/src/vm/jit/alpha/arch.h @@ -28,7 +28,7 @@ Changes: - $Id: arch.h 4357 2006-01-22 23:33:38Z twisti $ + $Id: arch.h 5017 2006-06-06 18:05:16Z twisti $ */ @@ -65,6 +65,9 @@ #define SUPPORT_LONG_MUL 1 #define SUPPORT_LONG_DIV 0 +#define SUPPORT_LONG_DIV_POW2 1 +#define SUPPORT_LONG_REM_POW2 1 + #define SUPPORT_CONST_LOGICAL 1 /* AND, OR, XOR with immediates */ #define SUPPORT_CONST_MUL 1 /* mutiply with immediate */ diff --git a/src/vm/jit/i386/arch.h b/src/vm/jit/i386/arch.h index 870e01e1b..8410a497b 100644 --- a/src/vm/jit/i386/arch.h +++ b/src/vm/jit/i386/arch.h @@ -28,7 +28,7 @@ Changes: - $Id: arch.h 4386 2006-01-30 11:26:34Z christian $ + $Id: arch.h 5017 2006-06-06 18:05:16Z twisti $ */ @@ -79,6 +79,9 @@ #define SUPPORT_LONG_MUL 1 #define SUPPORT_LONG_DIV 0 +#define SUPPORT_LONG_DIV_POW2 1 +#define SUPPORT_LONG_REM_POW2 0 + #define SUPPORT_CONST_LOGICAL 1 /* AND, OR, XOR with immediates */ #define SUPPORT_CONST_MUL 1 /* mutiply with immediate */ diff --git a/src/vm/jit/mips/arch.h b/src/vm/jit/mips/arch.h index 80e9a3a8f..bb49f5664 100644 --- a/src/vm/jit/mips/arch.h +++ b/src/vm/jit/mips/arch.h @@ -28,7 +28,7 @@ Changes: - $Id: arch.h 4357 2006-01-22 23:33:38Z twisti $ + $Id: arch.h 5017 2006-06-06 18:05:16Z twisti $ */ @@ -70,6 +70,9 @@ #define SUPPORT_LONG_MUL 1 #define SUPPORT_LONG_DIV 1 +#define SUPPORT_LONG_DIV_POW2 1 +#define SUPPORT_LONG_REM_POW2 1 + #define SUPPORT_CONST_LOGICAL 1 /* AND, OR, XOR with immediates */ #define SUPPORT_CONST_MUL 1 /* mutiply with immediate */ @@ -104,6 +107,9 @@ #define SUPPORT_LONG_MUL 0 #define SUPPORT_LONG_DIV 0 +#define SUPPORT_LONG_DIV_POW2 0 +#define SUPPORT_LONG_REM_POW2 0 + #define SUPPORT_CONST_LOGICAL 1 /* AND, OR, XOR with immediates */ #define SUPPORT_CONST_MUL 1 /* mutiply with immediate */ diff --git a/src/vm/jit/powerpc/arch.h b/src/vm/jit/powerpc/arch.h index 38d5f04e4..13838fc3d 100644 --- a/src/vm/jit/powerpc/arch.h +++ b/src/vm/jit/powerpc/arch.h @@ -28,7 +28,7 @@ Changes: - $Id: arch.h 4386 2006-01-30 11:26:34Z christian $ + $Id: arch.h 5017 2006-06-06 18:05:16Z twisti $ */ @@ -65,6 +65,9 @@ #define SUPPORT_LONG_MUL 0 #define SUPPORT_LONG_DIV 0 +#define SUPPORT_LONG_DIV_POW2 0 +#define SUPPORT_LONG_REM_POW2 0 + #define SUPPORT_CONST_LOGICAL 1 /* AND, OR, XOR with immediates */ #define SUPPORT_CONST_MUL 1 /* mutiply with immediate */ diff --git a/src/vm/jit/stack.c b/src/vm/jit/stack.c index 5f25ccccd..fd243214e 100644 --- a/src/vm/jit/stack.c +++ b/src/vm/jit/stack.c @@ -30,7 +30,7 @@ Christian Thalinger Christian Ullrich - $Id: stack.c 4998 2006-05-31 20:28:27Z edwin $ + $Id: stack.c 5017 2006-06-06 18:05:16Z twisti $ */ @@ -785,7 +785,8 @@ bool stack_analyse(jitdata *jd) goto icmd_lconst_tail; # endif /* SUPPORT_LONG_SHIFT */ #endif /* SUPPORT_LONG_MUL && SUPPORT_CONST_MUL */ -#if SUPPORT_LONG_DIV + +#if SUPPORT_LONG_DIV_POW2 case ICMD_LDIV: if (iptr[0].val.l == 0x00000002) iptr[0].val.i = 1; @@ -855,6 +856,9 @@ bool stack_analyse(jitdata *jd) } iptr[0].opc = ICMD_LDIVPOW2; goto icmd_lconst_tail; +#endif /* SUPPORT_LONG_DIV_POW2 */ + +#if SUPPORT_LONG_REM_POW2 case ICMD_LREM: if ((iptr[0].val.l == 0x00000002) || (iptr[0].val.l == 0x00000004) || @@ -893,7 +897,8 @@ bool stack_analyse(jitdata *jd) } PUSHCONST(TYPE_LNG); break; -#endif /* SUPPORT_LONG_DIV */ +#endif /* SUPPORT_LONG_REM_POW2 */ + #if SUPPORT_LONG_LOGICAL && SUPPORT_CONST_LOGICAL case ICMD_LAND: diff --git a/src/vm/jit/x86_64/arch.h b/src/vm/jit/x86_64/arch.h index ee87b4ed2..c36824cb3 100644 --- a/src/vm/jit/x86_64/arch.h +++ b/src/vm/jit/x86_64/arch.h @@ -28,7 +28,7 @@ Changes: - $Id: arch.h 4357 2006-01-22 23:33:38Z twisti $ + $Id: arch.h 5017 2006-06-06 18:05:16Z twisti $ */ @@ -67,6 +67,9 @@ #define SUPPORT_LONG_MUL 1 #define SUPPORT_LONG_DIV 1 +#define SUPPORT_LONG_DIV_POW2 1 +#define SUPPORT_LONG_REM_POW2 1 + #define SUPPORT_CONST_LOGICAL 1 /* AND, OR, XOR with immediates */ #define SUPPORT_CONST_MUL 1 /* mutiply with immediate */ -- 2.25.1