aboutsummaryrefslogtreecommitdiff
path: root/arm-gen.c
diff options
context:
space:
mode:
authorDaniel Glöckner <daniel-gl@gmx.net>2016-10-08 18:47:35 +0200
committerDaniel Glöckner <daniel-gl@gmx.net>2016-10-08 18:47:35 +0200
commit3dfee1d290c6659cd57670b99abc50e10f481779 (patch)
tree46fe9995279c594be72e7062b25bdb44566aa079 /arm-gen.c
parentb42cb16b65ed237e6ec30f65d4f9647561515cb8 (diff)
downloadtinycc-3dfee1d290c6659cd57670b99abc50e10f481779.tar.gz
tinycc-3dfee1d290c6659cd57670b99abc50e10f481779.tar.bz2
arm-gen.c: detect long double structures as HFA
when long double is equal to double
Diffstat (limited to 'arm-gen.c')
-rw-r--r--arm-gen.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arm-gen.c b/arm-gen.c
index 9b6bca2..55d6ecd 100644
--- a/arm-gen.c
+++ b/arm-gen.c
@@ -776,6 +776,15 @@ static void gcall_or_jmp(int is_jmp)
}
}
+static int unalias_ldbl(int btype)
+{
+#if LDOUBLE_SIZE == 8
+ if (btype == VT_LDOUBLE)
+ btype = VT_DOUBLE;
+#endif
+ return btype;
+}
+
/* Return whether a structure is an homogeneous float aggregate or not.
The answer is true if all the elements of the structure are of the same
primitive float type and there is less than 4 elements.
@@ -788,9 +797,9 @@ static int is_hgen_float_aggr(CType *type)
int btype, nb_fields = 0;
ref = type->ref->next;
- btype = ref->type.t & VT_BTYPE;
+ btype = unalias_ldbl(ref->type.t & VT_BTYPE);
if (btype == VT_FLOAT || btype == VT_DOUBLE) {
- for(; ref && btype == (ref->type.t & VT_BTYPE); ref = ref->next, nb_fields++);
+ for(; ref && btype == unalias_ldbl(ref->type.t & VT_BTYPE); ref = ref->next, nb_fields++);
return !ref && nb_fields <= 4;
}
}