src/cpu/ppc/vm/sharedRuntime_ppc.cpp

changeset 8182
e9e252c83b2b
parent 6517
a433eb716ce1
child 8604
04d83ba48607
child 8903
9575483cce09
child 8997
f8a45a60bc6b
     1.1 --- a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Mon Oct 12 12:20:38 2015 +0200
     1.2 +++ b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Tue Nov 17 08:59:21 2015 +0100
     1.3 @@ -766,6 +766,21 @@
     1.4      // in farg_reg[j] if argument i is the j-th float argument of this call.
     1.5      //
     1.6      case T_FLOAT:
     1.7 +#if defined(LINUX)
     1.8 +      // Linux uses ELF ABI. Both original ELF and ELFv2 ABIs have float
     1.9 +      // in the least significant word of an argument slot.
    1.10 +#if defined(VM_LITTLE_ENDIAN)
    1.11 +#define FLOAT_WORD_OFFSET_IN_SLOT 0
    1.12 +#else
    1.13 +#define FLOAT_WORD_OFFSET_IN_SLOT 1
    1.14 +#endif
    1.15 +#elif defined(AIX)
    1.16 +      // Although AIX runs on big endian CPU, float is in the most
    1.17 +      // significant word of an argument slot.
    1.18 +#define FLOAT_WORD_OFFSET_IN_SLOT 0
    1.19 +#else
    1.20 +#error "unknown OS"
    1.21 +#endif
    1.22        if (freg < Argument::n_float_register_parameters_c) {
    1.23          // Put float in register ...
    1.24          reg = farg_reg[freg];
    1.25 @@ -779,14 +794,14 @@
    1.26          if (arg >= Argument::n_regs_not_on_stack_c) {
    1.27            // ... and on the stack.
    1.28            guarantee(regs2 != NULL, "must pass float in register and stack slot");
    1.29 -          VMReg reg2 = VMRegImpl::stack2reg(stk LINUX_ONLY(+1));
    1.30 +          VMReg reg2 = VMRegImpl::stack2reg(stk + FLOAT_WORD_OFFSET_IN_SLOT);
    1.31            regs2[i].set1(reg2);
    1.32            stk += inc_stk_for_intfloat;
    1.33          }
    1.34  
    1.35        } else {
    1.36          // Put float on stack.
    1.37 -        reg = VMRegImpl::stack2reg(stk LINUX_ONLY(+1));
    1.38 +        reg = VMRegImpl::stack2reg(stk + FLOAT_WORD_OFFSET_IN_SLOT);
    1.39          stk += inc_stk_for_intfloat;
    1.40        }
    1.41        regs[i].set1(reg);

mercurial