PR148 again: don't defuse IF_LCMPxx
authorStefan Ring <stefan@complang.tuwien.ac.at>
Mon, 22 Nov 2010 18:33:30 +0000 (19:33 +0100)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Mon, 22 Nov 2010 18:33:30 +0000 (19:33 +0100)
* 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.

src/vm/jit/alpha/arch.h
src/vm/jit/arm/arch.h
src/vm/jit/builtin.cpp
src/vm/jit/builtintable.inc
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/stack.c
src/vm/jit/x86_64/arch.h

index a1c8a551aedc15d4af13720ec3242ee7f44f2229..2ad05ee5072aed1e9012fa38ec63dcf174038013 100644 (file)
@@ -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
index 2d12dc17097b5de80ff3aaa54ef9d75ba1432cfc..cb55ca04b276e4b63954686b53c37cdd695020c0 100644 (file)
@@ -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
index 146e64dffdb87a8fbbc3820076088d0d08cb02ab..615f4b8dc2d51175a66a0b748c3d64c2d14de337 100644 (file)
@@ -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 ****************************/
index 32d20945bf8f629de9247c6b168eceb0d35caa4e..4b8c219a248b04e673e91c5c861a060ec2639c10 100644 (file)
@@ -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,
index a092680b855e5386dfa90c09a1da41f5d77d5e55..1d90338e2d64bab5e7edd265504e2428b45d54d9 100644 (file)
@@ -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
index 73fe24a4b2f99f050855aa02e71eba20991745f3..c0d70758a3b78d0b1caf27084cb831ffc34df571 100644 (file)
@@ -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
index 3160ed5a1e0253bad3574e44e706c3f31c037763..1728e78964633cd3c34c9e0676a4fb808a3afb64 100644 (file)
@@ -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
index 30d1faf4945eb47022d1353adc96404e0b78c8e5..5f82a670f7943c67cf7b73c8658117e0b4d25621 100644 (file)
@@ -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     
index 05ffc44a7438b5286b23bb108680ea262c416090..c6415882a2b9319e34ac404953287290f45fee59 100644 (file)
@@ -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
index 3b3828cf5bbb83448900ee0b941a6684903b0e2f..40810e0d22ddf122b2e81a3b5b8131987b116a74 100644 (file)
@@ -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:
index 5d3a3082759fbb9817726c28d64d132170d97b30..3bbc1f3d5cd518512af6bc472e36d033d4148781 100644 (file)
@@ -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