Fix counting of VFP regs in ARM's gfunc_prolog

Fix in gfunc_prolog for ARM the counting of the highest numbered VFP
float register used for parameter passing, rounded to 2. It can be
computed from the range of VFP float register with the highest range
start and adding the number of VFP float register occupied. This ensure
that parameter of type struct that spans over more than 2 float
registers are correctly taken into account.
This commit is contained in:
Thomas Preud'homme 2013-11-21 21:14:25 +08:00
parent 41ce391c86
commit c3e7c725b5

View File

@ -1227,7 +1227,8 @@ void gfunc_prolog(CType *func_type)
#ifdef TCC_ARM_HARDFLOAT
if (!variadic && (is_float(sym2->type.t)
|| is_hgen_float_aggr(&sym2->type))) {
int tmpnf = assign_vfpreg(&avregs, align, size) + 1;
int tmpnf = assign_vfpreg(&avregs, align, size);
tmpnf += (size + 3) / 4;
nf = (tmpnf > nf) ? tmpnf : nf;
} else
#endif