Comments
Patch
@@ -304,6 +304,8 @@ enum aarch64_builtins
#undef VAR10
#undef VAR11
+static GTY(()) tree aarch64_builtin_decls[AARCH64_BUILTIN_MAX];
+
#define NUM_DREG_TYPES 6
#define NUM_QREG_TYPES 6
@@ -611,6 +613,7 @@ aarch64_init_simd_builtins (void)
};
char namebuf[60];
tree ftype = NULL;
+ tree fndecl = NULL;
int is_load = 0;
int is_store = 0;
@@ -951,8 +954,9 @@ aarch64_init_simd_builtins (void)
snprintf (namebuf, sizeof (namebuf), "__builtin_aarch64_%s%s",
d->name, modenames[d->mode]);
- add_builtin_function (namebuf, ftype, fcode, BUILT_IN_MD, NULL,
- NULL_TREE);
+ fndecl = add_builtin_function (namebuf, ftype, fcode, BUILT_IN_MD,
+ NULL, NULL_TREE);
+ aarch64_builtin_decls[fcode] = fndecl;
}
}
@@ -963,6 +967,15 @@ aarch64_init_builtins (void)
aarch64_init_simd_builtins ();
}
+tree
+aarch64_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= AARCH64_BUILTIN_MAX)
+ return error_mark_node;
+
+ return aarch64_builtin_decls[code];
+}
+
typedef enum
{
SIMD_ARG_COPY_TO_REG,
@@ -234,5 +234,6 @@ rtx aarch64_expand_builtin (tree exp,
rtx subtarget ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED,
int ignore ATTRIBUTE_UNUSED);
+tree aarch64_builtin_decl (unsigned, bool ATTRIBUTE_UNUSED);
#endif /* GCC_AARCH64_PROTOS_H */
@@ -6736,6 +6736,9 @@ aarch64_c_mode_for_suffix (char suffix)
#undef TARGET_CLASS_MAX_NREGS
#define TARGET_CLASS_MAX_NREGS aarch64_class_max_nregs
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL aarch64_builtin_decl
+
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN aarch64_expand_builtin