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
776 }776 }
777}777}
778 778
779static 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
779/* Return whether a structure is an homogeneous float aggregate or not.788/* Return whether a structure is an homogeneous float aggregate or not.
780 The answer is true if all the elements of the structure are of the same789 The answer is true if all the elements of the structure are of the same
781 primitive float type and there is less than 4 elements.790 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
788 int btype, nb_fields = 0;797 int btype, nb_fields = 0;
789 798
790 ref = type->ref->next;799 ref = type->ref->next;
791 btype = ref->type.t & VT_BTYPE;800 btype = unalias_ldbl(ref->type.t & VT_BTYPE);
792 if (btype == VT_FLOAT || btype == VT_DOUBLE) {801 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++);
794 return !ref && nb_fields <= 4;803 return !ref && nb_fields <= 4;
795 }804 }
796 }805 }