Commit 9d5202ee authored by Tobias Rapp's avatar Tobias Rapp
Browse files

amd64: vararg calls need the number of SSE registers used

parent 957ba4b4
......@@ -202,6 +202,7 @@ amd64_cconv_t *amd64_decide_calling_convention(ir_type *function_type,
cconv->parameters = params;
cconv->param_stack_size = stack_offset;
cconv->n_param_regs = n_param_regs_used;
cconv->n_xmm_regs = float_param_regnum;
cconv->results = results;
cconv->omit_fp = omit_fp;
cconv->caller_saves = caller_saves;
......
......@@ -40,7 +40,8 @@ typedef struct amd64_cconv_t
reg_or_stackslot_t *parameters; /**< parameter info. */
unsigned param_stack_size; /**< stack size for parameters */
unsigned n_param_regs; /**< number of values passed in a
register */
register (gp + xmm) */
unsigned n_xmm_regs; /**< number of xmm registers used */
reg_or_stackslot_t *results; /**< result info. */
unsigned n_reg_results;
unsigned *caller_saves; /**< bitset of caller saved registers */
......
......@@ -1632,9 +1632,11 @@ static ir_node *gen_Call(ir_node *node)
/* vararg calls need the number of SSE registers used */
if (get_method_variadicity(type) == variadicity_variadic) {
ir_node *zero = new_bd_amd64_Xor0(NULL, block);
unsigned xmm_regs = cconv->n_xmm_regs;
ir_node *xmm_imm = new_bd_amd64_MovImm(dbgi, block, INSN_MODE_32,
xmm_regs, NULL);
in_req[in_arity] = amd64_registers[REG_RAX].single_req;
in[in_arity] = zero;
in[in_arity] = xmm_imm;
++in_arity;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment