History

arm-gen.c: detect long double structures as HFA

when long double is equal to double

Daniel Glöckner committed 10 years ago

Commit 3dfee1d1 parent b42cb161 file · +11 −2Browse files

Unified · Split

arm-gen.c+11−2
@@ -776,6 +776,15 @@ static void gcall_or_jmp(int is_jmp) · 775 unmodified lines
776776 }
777777 }
778778
779+static int unalias_ldbl(int btype)
780+{
781+#if LDOUBLE_SIZE == 8
782+ if (btype == VT_LDOUBLE)
783+ btype = VT_DOUBLE;
784+#endif
785+ return btype;
786+}
787+
779788 /* Return whether a structure is an homogeneous float aggregate or not.
780789 The answer is true if all the elements of the structure are of the same
781790 primitive float type and there is less than 4 elements.
@@ -788,9 +797,9 @@ static int is_hgen_float_aggr(CType *type) · 6 unmodified lines
788797 int btype, nb_fields = 0;
789798
790799 ref = type->ref->next;
791− btype = ref->type.t & VT_BTYPE;
800+ btype = unalias_ldbl(ref->type.t & VT_BTYPE);
792801 if (btype == VT_FLOAT || btype == VT_DOUBLE) {
793− for(; ref && btype == (ref->type.t & VT_BTYPE); ref = ref->next, nb_fields++);
802+ for(; ref && btype == unalias_ldbl(ref->type.t & VT_BTYPE); ref = ref->next, nb_fields++);
794803 return !ref && nb_fields <= 4;
795804 }
796805 }