* src/vm/jit/powerpc64/linux/md-abi.c (_ALIGN): Renamed to
authortbfg <none@none>
Wed, 25 Oct 2006 14:26:08 +0000 (14:26 +0000)
committertbfg <none@none>
Wed, 25 Oct 2006 14:26:08 +0000 (14:26 +0000)
 CACAO_ALIGN because of name clash with /usr/include/asm-ppc64/page.h.

* src/vm/jit/powerpc64/emit.c (emit_lconst): Added.
 (emit_iconst): Reformatted.

* src/vm/jit/powerpc64/codegen.c (codegen):
 Replaced all stackframesize with cd->stackframesize.
 Implemented ICMD_IF_LLT, ICMD_IF_LLE, ICMD_IF_LGE, ICMD_IF_LGT.

* src/vm/jit/powerpc64/asmpart.S:
 Partially fixed exception path.
 (asm_cacheflush): Fixed.

* src/vm/jit/powerpc64/codegen.h (LCONST): Implemented.

* tests/if_tests.java: Added simple testcase for if and compare.

src/vm/jit/powerpc64/asmpart.S
src/vm/jit/powerpc64/codegen.c
src/vm/jit/powerpc64/codegen.h
src/vm/jit/powerpc64/emit.c
src/vm/jit/powerpc64/linux/md-abi.c
tests/if_tests.java [new file with mode: 0644]

index 2daba784890b4164c4b66c87338ffc720e9d00aa..bb897851b36ae33e08f75929e96057072873fd3b 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.S 5776 2006-10-13 17:06:39Z tbfg $
+   $Id: asmpart.S 5824 2006-10-25 14:26:08Z tbfg $
 
 */
 
@@ -758,10 +758,10 @@ L_asm_call_jit_compiler:                /* required for PIC code              */
 
 L_asm_call_jit_compiler_exception:
        mflr    r0
-       stw     r0,LA_LR_OFFSET(sp)
-       stwu    sp,-LA_SIZE_ALIGNED(sp)     /* preserve linkage area              */
+       std     r0,LA_LR_OFFSET(sp)
+       stdu    sp,-LA_SIZE_ALIGNED(sp)     /* preserve linkage area              */
        bl      exceptions_get_and_clear_exception
-       lwz     xpc,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
+       l     xpc,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
        mtlr    xpc     
        addi    sp,sp,LA_SIZE_ALIGNED
 
@@ -895,7 +895,7 @@ ex_int1:
 #else
        addi    t3,t3,(ex_int2-ex_int1)@l
 #endif
-       slwi    t2,t2,3                     /* t2 = register count * 8            */
+       slwi    t2,t2,2                     /* t2 = register count * 4            */
        subf    t3,t2,t3                    /* t3 = IntSave - t2                  */
        mtctr   t3
        bctr
@@ -911,7 +911,7 @@ ex_int1:
        ld      s8,-1*8(t1)
 
 ex_int2:
-       subf    t1,t2,t1                    /* t1 = t1 - register count * 8       */
+       subf    t1,t2,t1                    /* t1 = t1 - register count * 4       */
        lwz     t2,FltSave(pv)
        bl      ex_flt1
 ex_flt1:
@@ -921,7 +921,7 @@ ex_flt1:
 #else
        addi    t3,t3,(ex_flt2-ex_flt1)@l
 #endif
-       slwi    t2,t2,3                     /* t2 = register count * 8            */
+       slwi    t2,t2,2                     /* t2 = register count * 4            */
        subf    t3,t2,t3                    /* t3 = FltSave - t2                  */
        mtctr   t3
        bctr
@@ -1325,26 +1325,25 @@ asm_replacement_out:
        mtctr   itmp3
        bctr
 
-/*********************************************************************/
-/*
-asm_cacheflush:
-       .quad .asm_cacheflush,.TOC.@tocbase,0
-       .previous
-       .size asm_cacheflush,24
-       .type .asm_cacheflush,@function
-       .globl .asm_cacheflush
-*/
+/* asm_cacheflush **************************************************************
+       copied from linux/arch/ppc64/kernel/vdso64/cacheflush.S
+       assumes 128 byte cache line size.
+*******************************************************************************/
 .asm_cacheflush:
+       /* construct the AND mask */
+       li      r6,   0xffffffffffff8000
+       ori     r6,r6,0x000000000000ff80
+
        add     r4,r3,r4
-       rldimi  r3,r3,0,26
-       addi    r4,r4,31
-       rldimi  r4,r4,0,26
+       and.    r3,r3,r6
+       addi    r4,r4,127
+       and.    r4,r4,r6
        mr      r5,r3
 1:
        cmpld   r3,r4
        bge     0f
        dcbst   0,r3
-       addi    r3,r3,32
+       addi    r3,r3,128
        b       1b
 0:
        sync
@@ -1352,14 +1351,13 @@ asm_cacheflush:
        cmpld   r5,r4
        bge     0f
        icbi    0,r5
-       addi    r5,r5,32
+       addi    r5,r5,128
        b       1b
 0:
        sync
        isync
        blr
 
-
 .asm_getclassvalues_atomic:
 _crit_restart:
 _crit_begin:
index 03605414d458f152bb33482a847e434ca06444f6..70129b0fdc29d52eec5975640403fb189fdf020b 100644 (file)
@@ -32,7 +32,7 @@
             Edwin Steiner
            Roland Lezuo
 
-   $Id: codegen.c 5785 2006-10-15 22:25:54Z edwin $
+   $Id: codegen.c 5824 2006-10-25 14:26:08Z tbfg $
 
 */
 
@@ -89,7 +89,6 @@ bool codegen(jitdata *jd)
        registerdata       *rd;
        s4                  len, s1, s2, s3, d, disp;
        ptrint              a;
-       s4                  stackframesize;
        varinfo            *var;
        basicblock         *bptr;
        instruction        *iptr;
@@ -126,7 +125,7 @@ bool codegen(jitdata *jd)
        savedregs_num += (INT_SAV_CNT - rd->savintreguse);
        savedregs_num += (FLT_SAV_CNT - rd->savfltreguse);
 
-       stackframesize = rd->memuse + savedregs_num;
+       cd->stackframesize = rd->memuse + savedregs_num;
 
 #if defined(ENABLE_THREADS)
        /* space to save argument of monitor_enter and Return Values to survive */
@@ -135,7 +134,7 @@ bool codegen(jitdata *jd)
        /* reside in R3 */
        if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
                /* reserve 2 slots for long/double return values for monitorexit */
-               stackframesize += 2;
+               cd->stackframesize += 2;
        }
 
 #endif
@@ -144,14 +143,15 @@ bool codegen(jitdata *jd)
 
        /* align stack to 16-bytes */
 
+/* FIXME */
 /*     if (!m->isleafmethod || opt_verbosecall) */
-               stackframesize = (stackframesize + 3) & ~3;
-
+/*             stackframesize = (stackframesize + 3) & ~3;
+*/
 /*     else if (m->isleafmethod && (stackframesize == LA_WORD_SIZE)) */
 /*             stackframesize = 0; */
 
        (void) dseg_addaddress(cd, code);                      /* CodeinfoPointer */
-       (void) dseg_adds4(cd, stackframesize * 8);             /* FrameSize       */
+       (void) dseg_adds4(cd, cd->stackframesize * 8);             /* FrameSize       */
 
 #if defined(ENABLE_THREADS)
        /* IsSync contains the offset relative to the stack pointer for the
@@ -190,12 +190,12 @@ bool codegen(jitdata *jd)
                M_AST(REG_ZERO, REG_SP, LA_LR_OFFSET);
        }
 
-       if (stackframesize)
-               M_STDU(REG_SP, REG_SP, -stackframesize * 8);
+       if (cd->stackframesize)
+               M_STDU(REG_SP, REG_SP, -cd->stackframesize * 8);
 
        /* save return address and used callee saved registers */
 
-       p = stackframesize;
+       p = cd->stackframesize;
        for (i = INT_SAV_CNT - 1; i >= rd->savintreguse; i--) {
                p--; M_LST(rd->savintregs[i], REG_SP, p * 8);
        }
@@ -241,21 +241,21 @@ bool codegen(jitdata *jd)
                        } else {                                 /* stack arguments       */
                                if (!(var->flags & INMEMORY)) {      /* stack arg -> register */
                                        if (IS_2_WORD_TYPE(t))
-                                               M_LLD(var->vv.regoff, REG_SP, (stackframesize + s1) * 4);
+                                               M_LLD(var->vv.regoff, REG_SP, (cd->stackframesize + s1) * 4);
                                        else
-                                               M_ILD(var->vv.regoff, REG_SP, (stackframesize + s1) * 4);
+                                               M_ILD(var->vv.regoff, REG_SP, (cd->stackframesize + s1) * 4);
 
                                } else {                             /* stack arg -> spilled  */
 #if 1
-                                       M_ILD(REG_ITMP1, REG_SP, (stackframesize + s1) * 4);
+                                       M_ILD(REG_ITMP1, REG_SP, (cd->stackframesize + s1) * 4);
                                        M_IST(REG_ITMP1, REG_SP, var->vv.regoff * 4);
                                        if (IS_2_WORD_TYPE(t)) {
-                                               M_ILD(REG_ITMP1, REG_SP, (stackframesize + s1) * 4 +4);
+                                               M_ILD(REG_ITMP1, REG_SP, (cd->stackframesize + s1) * 4 +4);
                                                M_IST(REG_ITMP1, REG_SP, var->vv.regoff * 4 + 4);
                                        }
 #else
                                        /* Reuse Memory Position on Caller Stack */
-                                       var->vv.regoff = stackframesize + s1;
+                                       var->vv.regoff = cd->stackframesize + s1;
 #endif
                                }
                        }
@@ -276,25 +276,25 @@ bool codegen(jitdata *jd)
                        } else {                                 /* stack arguments       */
                                if (!(var->flags & INMEMORY)) {      /* stack-arg -> register */
                                        if (IS_2_WORD_TYPE(t))
-                                               M_DLD(var->vv.regoff, REG_SP, (stackframesize + s1) * 4);
+                                               M_DLD(var->vv.regoff, REG_SP, (cd->stackframesize + s1) * 4);
 
                                        else
-                                               M_FLD(var->vv.regoff, REG_SP, (stackframesize + s1) * 4);
+                                               M_FLD(var->vv.regoff, REG_SP, (cd->stackframesize + s1) * 4);
 
                                } else {                             /* stack-arg -> spilled  */
 #if 1
                                        if (IS_2_WORD_TYPE(t)) {
-                                               M_DLD(REG_FTMP1, REG_SP, (stackframesize + s1) * 4);
+                                               M_DLD(REG_FTMP1, REG_SP, (cd->stackframesize + s1) * 4);
                                                M_DST(REG_FTMP1, REG_SP, var->vv.regoff * 4);
-                                               var->vv.regoff = stackframesize + s1;
+                                               var->vv.regoff = cd->stackframesize + s1;
 
                                        } else {
-                                               M_FLD(REG_FTMP1, REG_SP, (stackframesize + s1) * 4);
+                                               M_FLD(REG_FTMP1, REG_SP, (cd->stackframesize + s1) * 4);
                                                M_FST(REG_FTMP1, REG_SP, var->vv.regoff * 4);
                                        }
 #else
                                        /* Reuse Memory Position on Caller Stack */
-                                       var->vv.regoff = stackframesize + s1;
+                                       var->vv.regoff = cd->stackframesize + s1;
 #endif
                                }
                        }
@@ -1872,7 +1872,6 @@ bool codegen(jitdata *jd)
                        codegen_addreference(cd, iptr->dst.block);
                        break;
                        
-               case ICMD_IF_LLE:       /* ..., value ==> ...                         */
 
                        s1 = emit_load_s1_low(jd, iptr, REG_ITMP1);
                        s2 = emit_load_s2_high(jd, iptr, REG_ITMP2);
@@ -1949,34 +1948,35 @@ bool codegen(jitdata *jd)
                        codegen_addreference(cd, iptr->dst.block);
                        break;
                        
-               case ICMD_IF_LGE:       /* ..., value ==> ...                         */
-
-                       /* TODO, remove me */
-                       s1 = emit_load_s1_low(jd, iptr, REG_ITMP1);
-                       s2 = emit_load_s2_high(jd, iptr, REG_ITMP2);
-                       if (iptr->sx.val.l == 0) {
-                               /* if high word is greater equal zero, the whole long is too */
-                               M_CMPI(s2, 0);
-                       } else if ((iptr->sx.val.l >= 0) && (iptr->sx.val.l <= 0xffff)) {
-                               M_CMPI(s2, 0);
-                               M_BGT(0);
-                               codegen_addreference(cd, iptr->dst.block);
-                               M_BLT(2);
-                               M_CMPUI(s1, iptr->sx.val.l & 0xffff);
-                       } else {
-                               ICONST(REG_ITMP3, iptr->sx.val.l >> 32);
-                               M_CMP(s2, REG_ITMP3);
-                               M_BGT(0);
-                               codegen_addreference(cd, iptr->dst.block);
-                               M_BLT(3);
-                               ICONST(REG_ITMP3, iptr->sx.val.l & 0xffffffff);
-                               M_CMPU(s1, REG_ITMP3);
-                       }
+               #endif
+               case ICMD_IF_LLT:       /* ..., value ==> ...                         */
+                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       LCONST(REG_ITMP2, iptr->sx.val.l);
+                       M_CMP(s1, REG_ITMP2);
+                       M_BLT(0);
+                       codegen_addreference(cd, iptr->dst.block);
+                       break;
+               case ICMD_IF_LLE:       /* ..., value ==> ...                         */
+                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       LCONST(REG_ITMP2, iptr->sx.val.l);
+                       M_CMP(s1, REG_ITMP2);
+                       M_BLE(0);
+                       codegen_addreference(cd, iptr->dst.block);
+                       break;
+               case ICMD_IF_LGE:       /* ..., value ==> ... */
+                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       LCONST(REG_ITMP2, iptr->sx.val.l);
+                       M_CMP(s1, REG_ITMP2);
                        M_BGE(0);
                        codegen_addreference(cd, iptr->dst.block);
                        break;
-               #endif
-
+               case ICMD_IF_LGT:       /* ..., value ==> ...                         */
+                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       LCONST(REG_ITMP2, iptr->sx.val.l);
+                       M_CMP(s1, REG_ITMP2);
+                       M_BGT(0);
+                       codegen_addreference(cd, iptr->dst.block);
+                       break;
                case ICMD_IF_ICMPEQ:    /* ..., value, value ==> ...                  */
                case ICMD_IF_ACMPEQ:    /* op1 = target JavaVM pc                     */
                case ICMD_IF_LCMPEQ: 
@@ -2078,7 +2078,7 @@ nowperformreturn:
                        {
                        s4 i, p;
                        
-                       p = stackframesize;
+                       p = cd->stackframesize;
 
                        /* call trace function */
 
@@ -2155,8 +2155,8 @@ nowperformreturn:
 
                        /* deallocate stack                                               */
 
-                       if (stackframesize)
-                               M_LDA(REG_SP, REG_SP, stackframesize * 8);
+                       if (cd->stackframesize)
+                               M_LDA(REG_SP, REG_SP, cd->stackframesize * 8);
 
                        M_RET;
                        ALIGNCODENOP;
@@ -2901,7 +2901,7 @@ gen_method:
 
                                if (jd->isleafmethod) {
                                        M_MFLR(REG_ZERO);
-                                       M_AST(REG_ZERO, REG_SP, stackframesize * 8 + LA_LR_OFFSET);
+                                       M_AST(REG_ZERO, REG_SP, cd->stackframesize * 8 + LA_LR_OFFSET);
                                }
 
                                M_MOV(REG_PV, rd->argintregs[0]);
@@ -2911,7 +2911,7 @@ gen_method:
                                        M_MOV(REG_ZERO, rd->argintregs[2]);
                                else
                                        M_ALD(rd->argintregs[2],
-                                                 REG_SP, stackframesize * 8 + LA_LR_OFFSET);
+                                                 REG_SP, cd->stackframesize * 8 + LA_LR_OFFSET);
 
                                M_MOV(REG_ITMP2_XPC, rd->argintregs[3]);
                                M_MOV(REG_ITMP1, rd->argintregs[4]);
@@ -2928,9 +2928,9 @@ gen_method:
 
                                if (jd->isleafmethod) {
                                        /* XXX FIXME: REG_ZERO can cause problems here! */
-                                       assert(stackframesize * 8 <= 32767);
+                                       assert(cd->stackframesize * 8 <= 32767);
 
-                                       M_ALD(REG_ZERO, REG_SP, stackframesize * 8 + LA_LR_OFFSET);
+                                       M_ALD(REG_ZERO, REG_SP, cd->stackframesize * 8 + LA_LR_OFFSET);
                                        M_MTLR(REG_ZERO);
                                }
 
@@ -3152,7 +3152,6 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        codeinfo     *code;
        codegendata  *cd;
        registerdata *rd;
-       s4            stackframesize;       /* size of stackframe if needed       */
        methoddesc   *md;
        s4            nativeparams;
        s4            i, j;                 /* count variables                    */
@@ -3174,19 +3173,19 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 
        /* calculate stackframe size */
 
-       stackframesize =
+       cd->stackframesize =
                sizeof(stackframeinfo) / SIZEOF_VOID_P +
                sizeof(localref_table) / SIZEOF_VOID_P +
                4 +                            /* 4 stackframeinfo arguments (darwin)*/
                nmd->paramcount  + 
                nmd->memuse;
 
-       stackframesize = (stackframesize + 3) & ~3; /* keep stack 16-byte aligned */
+       cd->stackframesize = (cd->stackframesize + 3) & ~3; /* keep stack 16-byte aligned */
 
        /* create method header */
 
        (void) dseg_addaddress(cd, code);                      /* CodeinfoPointer */
-       (void) dseg_adds4(cd, stackframesize * 8);             /* FrameSize       */
+       (void) dseg_adds4(cd, cd->stackframesize * 8);             /* FrameSize       */
        (void) dseg_adds4(cd, 0);                              /* IsSync          */
        (void) dseg_adds4(cd, 0);                              /* IsLeaf          */
        (void) dseg_adds4(cd, 0);                              /* IntSave         */
@@ -3198,7 +3197,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 
        M_MFLR(REG_ZERO);
        M_AST_INTERN(REG_ZERO, REG_SP, LA_LR_OFFSET);
-       M_STDU(REG_SP, REG_SP, -(stackframesize * 8));
+       M_STDU(REG_SP, REG_SP, -(cd->stackframesize * 8));
 
 #if !defined(NDEBUG)
        if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
@@ -3246,10 +3245,10 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 
        /* create native stack info */
 
-       M_AADD_IMM(REG_SP, stackframesize * 8, rd->argintregs[0]);
+       M_AADD_IMM(REG_SP, cd->stackframesize * 8, rd->argintregs[0]);
        M_MOV(REG_PV, rd->argintregs[1]);
-       M_AADD_IMM(REG_SP, stackframesize * 8, rd->argintregs[2]);
-       M_ALD(rd->argintregs[3], REG_SP, stackframesize * 8 + LA_LR_OFFSET);
+       M_AADD_IMM(REG_SP, cd->stackframesize * 8, rd->argintregs[2]);
+       M_ALD(rd->argintregs[3], REG_SP, cd->stackframesize * 8 + LA_LR_OFFSET);
        disp = dseg_addaddress(cd, codegen_start_native_call);
 
        M_ALD(REG_ITMP1, REG_PV, disp);
@@ -3301,7 +3300,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
                                }
 
                        } else {
-                               s1 = md->params[i].regoff + stackframesize;
+                               s1 = md->params[i].regoff + cd->stackframesize;
                                s2 = nmd->params[j].regoff;
 
                                M_LLD(REG_ITMP1, REG_SP, s1 * 8);
@@ -3313,7 +3312,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
                           argument registers keep unchanged. */
 
                        if (md->params[i].inmemory) {
-                               s1 = md->params[i].regoff + stackframesize;
+                               s1 = md->params[i].regoff + cd->stackframesize;
                                s2 = nmd->params[j].regoff;
 
                                if (IS_2_WORD_TYPE(t)) {
@@ -3351,10 +3350,6 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        M_JSR;
        M_ALD(REG_TOC, REG_SP, 40);     /* restore TOC */
 
-       M_NOP;
-       M_NOP;
-       M_NOP;
-
        /* save return value */
 
        if (md->returntype.type != TYPE_VOID) {
@@ -3377,11 +3372,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 #endif
        /* remove native stackframe info */
 
-       M_NOP;
-       M_NOP;
-       M_NOP;
-
-       M_AADD_IMM(REG_SP, stackframesize * 8, rd->argintregs[0]);
+       M_AADD_IMM(REG_SP, cd->stackframesize * 8, rd->argintregs[0]);
        disp = dseg_addaddress(cd, codegen_finish_native_call);
        M_ALD(REG_ITMP1, REG_PV, disp);
        M_ALD(REG_ITMP1, REG_ITMP1, 0); /* XXX what about TOC? */
@@ -3403,9 +3394,9 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
                }
        }
 
-       M_ALD(REG_ITMP2_XPC, REG_SP, stackframesize * 8 + LA_LR_OFFSET);
+       M_ALD(REG_ITMP2_XPC, REG_SP, cd->stackframesize * 8 + LA_LR_OFFSET);
        M_MTLR(REG_ITMP2_XPC);
-       M_LDA(REG_SP, REG_SP, stackframesize * 8); /* remove stackframe           */
+       M_LDA(REG_SP, REG_SP, cd->stackframesize * 8); /* remove stackframe           */
 
        /* check for exception */
 
index b89c80012ab517332b2d960eff3ee3e646156b41..00b24cd2a2c656374a4ebcbf029aef7888c89655 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Christian Thalinger
             Christian Ullrich
 
-   $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $
+   $Id: codegen.h 5824 2006-10-25 14:26:08Z tbfg $
 
 */
 
 
 
 #define ICONST(d,c)                     emit_iconst(cd, (d), (c))
-#define LCONST(reg,c)                  ICONST(reg,c)
+#define LCONST(reg,c)                  emit_lconst(cd, (reg), (c))
 
 
 #define ALIGNCODENOP \
index 323e9c83d1d91238a624c27f2b145a7bbf69eb52..07d46c0f0ebaa9d23ac420a3c2cd479c745bbd9b 100644 (file)
@@ -177,14 +177,25 @@ void emit_iconst(codegendata *cd, s4 d, s4 value)
 {
        s4 disp;
 
-       if ((value >= -32768) && (value <= 32767))
+       if ((value >= -32768) && (value <= 32767)) {
                M_LDA_INTERN(d, REG_ZERO, value);
-       else {
+       else {
                disp = dseg_adds4(cd, value);
                M_ILD(d, REG_PV, disp);
        }
 }
 
+void emit_lconst(codegendata *cd, s4 d, s8 value)
+{
+       s4 disp;
+       if ((value >= -32768) && (value <= 32767)) {
+               M_LDA_INTERN(d, REG_ZERO, value);
+       } else {
+               disp = dseg_adds8(cd, value);
+               M_LLD(d, REG_PV, disp);
+       }
+}
+
 
 /* emit_verbosecall_enter ******************************************************
  *
index 6f2dc48b9f291dddf52bdc71eafb8895011668e4..b0b9fa53fe13f257669e6cb4de8955f0c09df4b6 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: 
 
-   $Id: md-abi.c 5634 2006-10-02 14:18:04Z edwin $
+   $Id: md-abi.c 5824 2006-10-25 14:26:08Z tbfg $
 
 */
 
@@ -43,7 +43,7 @@
 #include "vm/jit/abi.h"
 
 
-#define _ALIGN(a)    do { if ((a) & 1) (a)++; } while (0)
+#define CACAO_ALIGN(a)    do { if ((a) & 1) (a)++; } while (0)
 
 
 /* register descripton array **************************************************/
@@ -156,7 +156,7 @@ void md_param_alloc(methoddesc *md)
                                pd->regoff = farg;
                                farg++;
                        } else {
-                               _ALIGN(stacksize);
+                               CACAO_ALIGN(stacksize);
                                pd->inmemory = true;
                                pd->regoff = stacksize;
                                stacksize += 2;
diff --git a/tests/if_tests.java b/tests/if_tests.java
new file mode 100644 (file)
index 0000000..9e83a8d
--- /dev/null
@@ -0,0 +1,104 @@
+class if_tests {
+       static public void main(String args[])  {
+               int i = 5;
+               long l = 690000000000L;
+               int mi = -5;
+               long ml = -690000000000L;
+
+               if (i<10)       {
+                       System.out.println("OK i<10");
+               } else  {
+                       System.out.println("FAIL i<10");
+               }
+
+               if (i>4)        {
+                       System.out.println("OK i>4");
+               } else  {
+                       System.out.println("FAIL i>4");
+               }
+
+               if (i<=5)       {
+                       System.out.println("OK i<=5");
+               } else  {
+                       System.out.println("FAIL i<=5");
+               }
+               if (i>=5)       {
+                       System.out.println("OK i>=5");
+               } else  {
+                       System.out.println("FAIL i>=5");
+               }
+
+               if (l<690000000001L)    {
+                       System.out.println("OK l<690000000001L");
+               } else  {
+                       System.out.println("FAIL l<690000000001L");
+               }
+
+               if (l>689999999999L)    {
+                       System.out.println("OK l>689999999999L");
+               } else  {
+                       System.out.println("FAIL l>689999999999L");
+               }
+
+               if (l<=690000000000L)   {
+                       System.out.println("OK l<=690000000000L");
+               } else  {
+                       System.out.println("FAIL l<=690000000000L");
+               }
+               if (l>=690000000000L)   {
+                       System.out.println("OK l>=690000000000L");
+               } else  {
+                       System.out.println("FAIL l>=690000000000L");
+               }
+
+               // nagtive i and l
+
+               if (mi<10)      {
+                       System.out.println("OK mi<10");
+               } else  {
+                       System.out.println("FAIL mi<10");
+               }
+
+               if (mi>4)       {
+                       System.out.println("FAIL mi>4");
+               } else  {
+                       System.out.println("OK mi>4");
+               }
+
+               if (mi<=5)      {
+                       System.out.println("OK mi<=5");
+               } else  {
+                       System.out.println("FAIL mi<=5");
+               }
+               if (mi>=5)      {
+                       System.out.println("FAIL mi>=5");
+               } else  {
+                       System.out.println("OK mi>=5");
+               }
+
+               if (ml<690000000001L)   {
+                       System.out.println("OK ml<690000000001L");
+               } else  {
+                       System.out.println("FAIL ml<690000000001L");
+               }
+
+               if (ml>689999999999L)   {
+                       System.out.println("FAIL ml>689999999999L");
+               } else  {
+                       System.out.println("OK ml>689999999999L");
+               }
+
+               if (ml<=690000000000L)  {
+                       System.out.println("OK ml<=690000000000L");
+               } else  {
+                       System.out.println("FAIL ml<=690000000000L");
+               }
+               if (ml>=690000000000L)  {
+                       System.out.println("FAIL ml>=690000000000L");
+               } else  {
+                       System.out.println("OK ml>=690000000000L");
+               }
+
+
+       }
+};