src/cpu/x86/vm/x86_64.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.


2924               round_to((Compile::current()->in_preserve_stack_slots() +
2925                         Compile::current()->fixed_slots()),
2926                        stack_alignment_in_slots()));
2927 
2928   // Body of function which returns an integer array locating
2929   // arguments either in registers or in stack slots.  Passed an array
2930   // of ideal registers called "sig" and a "length" count.  Stack-slot
2931   // offsets are based on outgoing arguments, i.e. a CALLER setting up
2932   // arguments for a CALLEE.  Incoming stack arguments are
2933   // automatically biased by the preserve_stack_slots field above.
2934 
2935   calling_convention
2936   %{
2937     // No difference between ingoing/outgoing just pass false
2938     SharedRuntime::java_calling_convention(sig_bt, regs, length, false);
2939   %}
2940 
2941   c_calling_convention
2942   %{
2943     // This is obviously always outgoing
2944     (void) SharedRuntime::c_calling_convention(sig_bt, regs, length);
2945   %}
2946 
2947   // Location of compiled Java return values.  Same as C for now.
2948   return_value
2949   %{
2950     assert(ideal_reg >= Op_RegI && ideal_reg <= Op_RegL,
2951            "only return normal values");
2952 
2953     static const int lo[Op_RegL + 1] = {
2954       0,
2955       0,
2956       RAX_num,  // Op_RegN
2957       RAX_num,  // Op_RegI
2958       RAX_num,  // Op_RegP
2959       XMM0_num, // Op_RegF
2960       XMM0_num, // Op_RegD
2961       RAX_num   // Op_RegL
2962     };
2963     static const int hi[Op_RegL + 1] = {
2964       0,




2924               round_to((Compile::current()->in_preserve_stack_slots() +
2925                         Compile::current()->fixed_slots()),
2926                        stack_alignment_in_slots()));
2927 
2928   // Body of function which returns an integer array locating
2929   // arguments either in registers or in stack slots.  Passed an array
2930   // of ideal registers called "sig" and a "length" count.  Stack-slot
2931   // offsets are based on outgoing arguments, i.e. a CALLER setting up
2932   // arguments for a CALLEE.  Incoming stack arguments are
2933   // automatically biased by the preserve_stack_slots field above.
2934 
2935   calling_convention
2936   %{
2937     // No difference between ingoing/outgoing just pass false
2938     SharedRuntime::java_calling_convention(sig_bt, regs, length, false);
2939   %}
2940 
2941   c_calling_convention
2942   %{
2943     // This is obviously always outgoing
2944     (void) SharedRuntime::c_calling_convention(sig_bt, regs, /*regs2=*/NULL, length);
2945   %}
2946 
2947   // Location of compiled Java return values.  Same as C for now.
2948   return_value
2949   %{
2950     assert(ideal_reg >= Op_RegI && ideal_reg <= Op_RegL,
2951            "only return normal values");
2952 
2953     static const int lo[Op_RegL + 1] = {
2954       0,
2955       0,
2956       RAX_num,  // Op_RegN
2957       RAX_num,  // Op_RegI
2958       RAX_num,  // Op_RegP
2959       XMM0_num, // Op_RegF
2960       XMM0_num, // Op_RegD
2961       RAX_num   // Op_RegL
2962     };
2963     static const int hi[Op_RegL + 1] = {
2964       0,