Add fix for XMM register handling in function calls for x64.
This commit is contained in:
@ -750,7 +750,12 @@ void gfunc_prolog(CType *func_type)
|
|||||||
bt = type->t & VT_BTYPE;
|
bt = type->t & VT_BTYPE;
|
||||||
if (reg_param_index < REGN) {
|
if (reg_param_index < REGN) {
|
||||||
/* save arguments passed by register */
|
/* save arguments passed by register */
|
||||||
gen_modrm64(0x89, arg_regs[reg_param_index], VT_LOCAL, NULL, addr);
|
if ((bt == VT_FLOAT) || (bt == VT_DOUBLE)) {
|
||||||
|
o(0xd60f66); /* movq */
|
||||||
|
gen_modrm(reg_param_index, VT_LOCAL, NULL, addr);
|
||||||
|
} else {
|
||||||
|
gen_modrm64(0x89, arg_regs[reg_param_index], VT_LOCAL, NULL, addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (bt == VT_STRUCT || bt == VT_LDOUBLE) {
|
if (bt == VT_STRUCT || bt == VT_LDOUBLE) {
|
||||||
sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | VT_LVAL | VT_REF, addr);
|
sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | VT_LVAL | VT_REF, addr);
|
||||||
|
|||||||
Reference in New Issue
Block a user