History

Remove code in arm-gen.c for struct packing in reg

Struct packing in register is now handled since commit 2bbfaf43 by tccgen.c proper.

Thomas Preud'homme committed 12 years ago

Commit d9d60a11 parent 63a84711 file · +3 −21Browse files

Unified · Split

arm-gen.c+3−21
@@ -1133,7 +1133,7 @@ static int copy_params(int nb_args, struct plan *plan, int todo) · 1132 unmodified lines
1133 parameters and the function address. */1133 parameters and the function address. */
1134void gfunc_call(int nb_args)1134void gfunc_call(int nb_args)
1135{1135{
1136 int align, r, args_size;1136 int r, args_size;
1137 int variadic;1137 int variadic;
1138 int todo;1138 int todo;
1139 struct plan plan;1139 struct plan plan;
@@ -1145,19 +1145,6 @@ void gfunc_call(int nb_args) · 5 unmodified lines
1145 r = vtop->r & VT_VALMASK;1145 r = vtop->r & VT_VALMASK;
1146 if (r == VT_CMP || (r & ~1) == VT_JMP)1146 if (r == VT_CMP || (r & ~1) == VT_JMP)
1147 gv(RC_INT);1147 gv(RC_INT);
1148#ifdef TCC_ARM_EABI
1149 /* return type is a struct so caller of gfunc_call (unary(void) in tccgen.c)
1150 assumed it had to be passed by a pointer. Since it's less than 4 bytes, we
1151 can actually pass it directly in a register. */
1152 if((vtop[-nb_args].type.ref->type.t & VT_BTYPE) == VT_STRUCT
1153 && type_size(&vtop[-nb_args].type.ref->type, &align) <= 4) {
1154 SValue tmp;
1155 tmp=vtop[-nb_args];
1156 vtop[-nb_args]=vtop[-nb_args+1];
1157 vtop[-nb_args+1]=tmp;
1158 --nb_args;
1159 }
1160#endif
1161 1148
1162 args_size = assign_regs(nb_args, variadic, &plan, &todo);1149 args_size = assign_regs(nb_args, variadic, &plan, &todo);
1163 1150
@@ -1177,16 +1164,11 @@ void gfunc_call(int nb_args) · 13 unmodified lines
1177 if (args_size)1164 if (args_size)
1178 gadd_sp(args_size); /* pop all parameters passed on the stack */1165 gadd_sp(args_size); /* pop all parameters passed on the stack */
1179#ifdef TCC_ARM_EABI1166#ifdef TCC_ARM_EABI
1180 if((vtop->type.ref->type.t & VT_BTYPE) == VT_STRUCT
1181 && type_size(&vtop->type.ref->type, &align) <= 4) {
1182 store(REG_IRET,vtop-nb_args-1);
1183 nb_args++;
1184 }
1185#ifdef TCC_ARM_VFP1167#ifdef TCC_ARM_VFP
1186#ifdef TCC_ARM_HARDFLOAT1168#ifdef TCC_ARM_HARDFLOAT
1187 else if(variadic && is_float(vtop->type.ref->type.t)) {1169 if(variadic && is_float(vtop->type.ref->type.t)) {
1188#else1170#else
1189 else if(is_float(vtop->type.ref->type.t)) {1171 rf(is_float(vtop->type.ref->type.t)) {
1190#endif1172#endif
1191 if((vtop->type.ref->type.t & VT_BTYPE) == VT_FLOAT) {1173 if((vtop->type.ref->type.t & VT_BTYPE) == VT_FLOAT) {
1192 o(0xEE000A10); /*vmov s0, r0 */1174 o(0xEE000A10); /*vmov s0, r0 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t