src/cpu/sparc/vm/sparc.ad

Print this page
rev 5188 : 8024344: PPC64 (part 112): C argument in register AND stack slot.
Summary: On PPC, the first 13 floating point arguments to C calls are passed in floating point registers. Also, all but the first 8 arguments are passed on the stack. So there can be floating point arguments that are passed on the stack and in a register. We duplicate the regs datastructure in c_calling_convention() to represent this.


3201 
3202   // The after-PROLOG location of the return address.  Location of
3203   // return address specifies a type (REG or STACK) and a number
3204   // representing the register number (i.e. - use a register name) or
3205   // stack slot.
3206   return_addr(REG R_I7);          // Ret Addr is in register I7
3207 
3208   // Body of function which returns an OptoRegs array locating
3209   // arguments either in registers or in stack slots for calling
3210   // java
3211   calling_convention %{
3212     (void) SharedRuntime::java_calling_convention(sig_bt, regs, length, is_outgoing);
3213 
3214   %}
3215 
3216   // Body of function which returns an OptoRegs array locating
3217   // arguments either in registers or in stack slots for callin
3218   // C.
3219   c_calling_convention %{
3220     // This is obviously always outgoing
3221     (void) SharedRuntime::c_calling_convention(sig_bt, regs, length);
3222   %}
3223 
3224   // Location of native (C/C++) and interpreter return values.  This is specified to
3225   // be the  same as Java.  In the 32-bit VM, long values are actually returned from
3226   // native calls in O0:O1 and returned to the interpreter in I0:I1.  The copying
3227   // to and from the register pairs is done by the appropriate call and epilog
3228   // opcodes.  This simplifies the register allocator.
3229   c_return_value %{
3230     assert( ideal_reg >= Op_RegI && ideal_reg <= Op_RegL, "only return normal values" );
3231 #ifdef     _LP64
3232     static int lo_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_O0_num,     R_O0_num,     R_O0_num,     R_F0_num,     R_F0_num, R_O0_num };
3233     static int hi_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_O0H_num,    OptoReg::Bad, R_F1_num, R_O0H_num};
3234     static int lo_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_I0_num,     R_I0_num,     R_I0_num,     R_F0_num,     R_F0_num, R_I0_num };
3235     static int hi_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_I0H_num,    OptoReg::Bad, R_F1_num, R_I0H_num};
3236 #else  // !_LP64
3237     static int lo_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_O0_num,     R_O0_num,     R_O0_num,     R_F0_num,     R_F0_num, R_G1_num };
3238     static int hi_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_F1_num, R_G1H_num };
3239     static int lo_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_I0_num,     R_I0_num,     R_I0_num,     R_F0_num,     R_F0_num, R_G1_num };
3240     static int hi_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_F1_num, R_G1H_num };
3241 #endif




3201 
3202   // The after-PROLOG location of the return address.  Location of
3203   // return address specifies a type (REG or STACK) and a number
3204   // representing the register number (i.e. - use a register name) or
3205   // stack slot.
3206   return_addr(REG R_I7);          // Ret Addr is in register I7
3207 
3208   // Body of function which returns an OptoRegs array locating
3209   // arguments either in registers or in stack slots for calling
3210   // java
3211   calling_convention %{
3212     (void) SharedRuntime::java_calling_convention(sig_bt, regs, length, is_outgoing);
3213 
3214   %}
3215 
3216   // Body of function which returns an OptoRegs array locating
3217   // arguments either in registers or in stack slots for callin
3218   // C.
3219   c_calling_convention %{
3220     // This is obviously always outgoing
3221     (void) SharedRuntime::c_calling_convention(sig_bt, regs, /*regs2=*/NULL, length);
3222   %}
3223 
3224   // Location of native (C/C++) and interpreter return values.  This is specified to
3225   // be the  same as Java.  In the 32-bit VM, long values are actually returned from
3226   // native calls in O0:O1 and returned to the interpreter in I0:I1.  The copying
3227   // to and from the register pairs is done by the appropriate call and epilog
3228   // opcodes.  This simplifies the register allocator.
3229   c_return_value %{
3230     assert( ideal_reg >= Op_RegI && ideal_reg <= Op_RegL, "only return normal values" );
3231 #ifdef     _LP64
3232     static int lo_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_O0_num,     R_O0_num,     R_O0_num,     R_F0_num,     R_F0_num, R_O0_num };
3233     static int hi_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_O0H_num,    OptoReg::Bad, R_F1_num, R_O0H_num};
3234     static int lo_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_I0_num,     R_I0_num,     R_I0_num,     R_F0_num,     R_F0_num, R_I0_num };
3235     static int hi_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_I0H_num,    OptoReg::Bad, R_F1_num, R_I0H_num};
3236 #else  // !_LP64
3237     static int lo_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_O0_num,     R_O0_num,     R_O0_num,     R_F0_num,     R_F0_num, R_G1_num };
3238     static int hi_out[Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_F1_num, R_G1H_num };
3239     static int lo_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, R_I0_num,     R_I0_num,     R_I0_num,     R_F0_num,     R_F0_num, R_G1_num };
3240     static int hi_in [Op_RegL+1] = { OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, OptoReg::Bad, R_F1_num, R_G1H_num };
3241 #endif