From: Stefan Ring Date: Mon, 22 Nov 2010 18:33:30 +0000 (+0100) Subject: PR148 again: don't defuse IF_LCMPxx X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=cacao.git;a=commitdiff_plain;h=3ad897682797a290973663c3d27fb72c94d02516 PR148 again: don't defuse IF_LCMPxx * src/vm/jit/stack.c: Unconditionally use BUILTIN_lcmp, as no architecture implements it. * src/vm/jit/builtin.cpp: Likewise * src/vm/jit/builtintable.inc: Copied BUILTIN_lcmp entry (from automatic table to internal table). * src/vm/jit/alpha/arch.h: Re-enable SUPPORT_LONG_CMP. * src/vm/jit/arm/arch.h, * src/vm/jit/i386/arch.h, * src/vm/jit/mips/arch.h, * src/vm/jit/powerpc/arch.h, * src/vm/jit/powerpc64/arch.h, * src/vm/jit/s390/arch.h, * src/vm/jit/x86_64/arch.h: Likewise. --- diff --git a/src/vm/jit/alpha/arch.h b/src/vm/jit/alpha/arch.h index a1c8a551a..2ad05ee50 100644 --- a/src/vm/jit/alpha/arch.h +++ b/src/vm/jit/alpha/arch.h @@ -47,7 +47,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 1 diff --git a/src/vm/jit/arm/arch.h b/src/vm/jit/arm/arch.h index 2d12dc170..cb55ca04b 100644 --- a/src/vm/jit/arm/arch.h +++ b/src/vm/jit/arm/arch.h @@ -47,7 +47,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 0 diff --git a/src/vm/jit/builtin.cpp b/src/vm/jit/builtin.cpp index 146e64dff..615f4b8dc 100644 --- a/src/vm/jit/builtin.cpp +++ b/src/vm/jit/builtin.cpp @@ -1409,7 +1409,6 @@ s8 builtin_lxor(s8 a, s8 b) #endif /* !(SUPPORT_LONG && SUPPORT_LONG_LOGICAL) */ -#if !(SUPPORT_LONG && SUPPORT_LONG_CMP) s4 builtin_lcmp(s8 a, s8 b) { if (a < b) @@ -1420,7 +1419,6 @@ s4 builtin_lcmp(s8 a, s8 b) return 0; } -#endif /* !(SUPPORT_LONG && SUPPORT_LONG_CMP) */ /* functions for unsupported floating instructions ****************************/ diff --git a/src/vm/jit/builtintable.inc b/src/vm/jit/builtintable.inc index 32d20945b..4b8c219a2 100644 --- a/src/vm/jit/builtintable.inc +++ b/src/vm/jit/builtintable.inc @@ -1,6 +1,6 @@ /* src/vm/jit/builtintable.inc - tables of builtin functions - Copyright (C) 1996-2005, 2006, 2007, 2008 + Copyright (C) 1996-2010 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This file is part of CACAO. @@ -96,6 +96,21 @@ static builtintable_entry builtintable_internal[] = { }, #endif + { + ICMD_LCMP, + 0, + BUILTIN_lcmp, + NULL, + NULL, + "lcmp", + "(JJ)I", + NULL, + NULL, + NULL, + NULL, + NULL + }, + #if !SUPPORT_DIVISION || defined(DISABLE_GC) { ICMD_IDIV, diff --git a/src/vm/jit/i386/arch.h b/src/vm/jit/i386/arch.h index a092680b8..1d90338e2 100644 --- a/src/vm/jit/i386/arch.h +++ b/src/vm/jit/i386/arch.h @@ -77,7 +77,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 1 diff --git a/src/vm/jit/mips/arch.h b/src/vm/jit/mips/arch.h index 73fe24a4b..c0d70758a 100644 --- a/src/vm/jit/mips/arch.h +++ b/src/vm/jit/mips/arch.h @@ -49,7 +49,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 1 diff --git a/src/vm/jit/powerpc/arch.h b/src/vm/jit/powerpc/arch.h index 3160ed5a1..1728e7896 100644 --- a/src/vm/jit/powerpc/arch.h +++ b/src/vm/jit/powerpc/arch.h @@ -47,7 +47,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 0 diff --git a/src/vm/jit/powerpc64/arch.h b/src/vm/jit/powerpc64/arch.h index 30d1faf49..5f82a670f 100644 --- a/src/vm/jit/powerpc64/arch.h +++ b/src/vm/jit/powerpc64/arch.h @@ -41,7 +41,7 @@ #define SUPPORT_IFCVT 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 1 diff --git a/src/vm/jit/s390/arch.h b/src/vm/jit/s390/arch.h index 05ffc44a7..c6415882a 100644 --- a/src/vm/jit/s390/arch.h +++ b/src/vm/jit/s390/arch.h @@ -45,7 +45,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 1 diff --git a/src/vm/jit/stack.c b/src/vm/jit/stack.c index 3b3828cf5..40810e0d2 100644 --- a/src/vm/jit/stack.c +++ b/src/vm/jit/stack.c @@ -4003,7 +4003,15 @@ icmd_DUP_X2: break; normal_LCMP: #endif /* SUPPORT_LONG_CMP_CONST */ - OP2_1(TYPE_LNG, TYPE_LNG, TYPE_INT); + bte = builtintable_get_internal(BUILTIN_lcmp); + + iptr->opc = ICMD_BUILTIN; + iptr->flags.bits &= INS_FLAG_ID_MASK; + iptr->sx.s23.s3.bte = bte; + /* iptr->line is already set */ + code_unflag_leafmethod(code); + goto icmd_BUILTIN; + break; case ICMD_FCMPL: diff --git a/src/vm/jit/x86_64/arch.h b/src/vm/jit/x86_64/arch.h index 5d3a30827..3bbc1f3d5 100644 --- a/src/vm/jit/x86_64/arch.h +++ b/src/vm/jit/x86_64/arch.h @@ -49,7 +49,7 @@ #define SUPPORT_D2L 0 #define SUPPORT_LONG_ADD 1 -#define SUPPORT_LONG_CMP 0 +#define SUPPORT_LONG_CMP 1 #define SUPPORT_LONG_CMP_CONST 1 #define SUPPORT_LONG_LOGICAL 1 #define SUPPORT_LONG_SHIFT 1