@@ -15911,12 +15911,20 @@ rs6000_init_builtins (void)
ptr_long_double_type_node
= build_pointer_type (build_qualified_type (long_double_type_internal_node,
TYPE_QUAL_CONST));
- ptr_dfloat64_type_node
- = build_pointer_type (build_qualified_type (dfloat64_type_internal_node,
- TYPE_QUAL_CONST));
- ptr_dfloat128_type_node
- = build_pointer_type (build_qualified_type (dfloat128_type_internal_node,
- TYPE_QUAL_CONST));
+ if (dfloat64_type_node)
+ ptr_dfloat64_type_node
+ = build_pointer_type (build_qualified_type (dfloat64_type_internal_node,
+ TYPE_QUAL_CONST));
+ else
+ ptr_dfloat64_type_node = NULL;
+
+ if (dfloat128_type_node)
+ ptr_dfloat128_type_node
+ = build_pointer_type (build_qualified_type (dfloat128_type_internal_node,
+ TYPE_QUAL_CONST));
+ else
+ ptr_dfloat128_type_node = NULL;
+
ptr_long_long_integer_type_node
= build_pointer_type
(build_qualified_type (long_long_integer_type_internal_node,
@@ -2392,16 +2392,23 @@ write_fntype_init (char *str)
must guard against that. */
int tf_found = strstr (str, "tf") != NULL;
+ /* Similarly, look for decimal float tokens. */
+ int dfp_found = (strstr (str, "dd") != NULL
+ || strstr (str, "td") != NULL
+ || strstr (str, "sd") != NULL);
+
/* Avoid side effects of strtok on the original string by using a copy. */
char *buf = (char *) malloc (strlen (str) + 1);
strcpy (buf, str);
if (tf_found)
fprintf (init_file, " if (float128_type_node)\n ");
+ else if (dfp_found)
+ fprintf (init_file, " if (dfloat64_type_node)\n ");
fprintf (init_file, " %s\n = build_function_type_list (", buf);
tok = strtok (buf, "_");
- write_type_node (tok, tf_found);
+ write_type_node (tok, tf_found || dfp_found);
tok = strtok (0, "_");
assert (tok);
assert (!strcmp (tok, "ftype"));
@@ -2413,7 +2420,7 @@ write_fntype_init (char *str)
/* Note: A function with no arguments ends with '_ftype_v'. */
while (tok && strcmp (tok, "v"))
{
- write_type_node (tok, tf_found);
+ write_type_node (tok, tf_found || dfp_found);
tok = strtok (0, "_");
fprintf (init_file, ",\n\t\t\t\t");
}
@@ -2612,6 +2619,11 @@ write_init_bif_table ()
must guard against that. */
int tf_found = strstr (bifs[i].fndecl, "tf") != NULL;
+ /* Similarly, look for decimal float tokens. */
+ int dfp_found = (strstr (bifs[i].fndecl, "dd") != NULL
+ || strstr (bifs[i].fndecl, "td") != NULL
+ || strstr (bifs[i].fndecl, "sd") != NULL);
+
fprintf (init_file,
" if (new_builtins_are_live)\n");
fprintf (init_file, " {\n");
@@ -2621,6 +2633,11 @@ write_init_bif_table ()
fprintf (init_file, " if (float128_type_node)\n");
fprintf (init_file, " {\n");
}
+ else if (dfp_found)
+ {
+ fprintf (init_file, " if (dfloat64_type_node)\n");
+ fprintf (init_file, " {\n");
+ }
fprintf (init_file,
" rs6000_builtin_decls_x[(int)RS6000_BIF_%s] = t\n",
@@ -2659,7 +2676,7 @@ write_init_bif_table ()
fprintf (init_file, " TREE_READONLY (t) = 1;\n");
}
- if (tf_found)
+ if (tf_found || dfp_found)
{
fprintf (init_file, " }\n");
fprintf (init_file, " else\n");
@@ -2696,6 +2713,11 @@ write_init_ovld_table ()
must guard against that. */
int tf_found = strstr (ovlds[i].fndecl, "tf") != NULL;
+ /* Similarly, look for decimal float tokens. */
+ int dfp_found = (strstr (ovlds[i].fndecl, "dd") != NULL
+ || strstr (ovlds[i].fndecl, "td") != NULL
+ || strstr (ovlds[i].fndecl, "sd") != NULL);
+
/* The fndecl for an overload is arbitrarily the first one
for the overload. We sort out the real types when
processing the overload in the gcc front end. */
@@ -2708,6 +2730,11 @@ write_init_ovld_table ()
fprintf (init_file, " if (float128_type_node)\n");
fprintf (init_file, " {\n");
}
+ else if (dfp_found)
+ {
+ fprintf (init_file, " if (dfloat64_type_node)\n");
+ fprintf (init_file, " {\n");
+ }
fprintf (init_file,
" rs6000_builtin_decls_x[(int)RS6000_OVLD_%s] = t\n",
@@ -2725,7 +2752,7 @@ write_init_ovld_table ()
fprintf (init_file,
" NULL, NULL_TREE);\n");
- if (tf_found)
+ if (tf_found || dfp_found)
fprintf (init_file, " }\n");
fprintf (init_file, " }\n\n");