* [Patch AArch64] Add support for TARGET_BUILTIN_DECL
@ 2012-11-21 15:05 James Greenhalgh
2012-11-26 12:31 ` Marcus Shawcroft
0 siblings, 1 reply; 2+ messages in thread
From: James Greenhalgh @ 2012-11-21 15:05 UTC (permalink / raw)
To: gcc-patches; +Cc: marcus.shawcroft
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
Hi,
This patch wires up support for TARGET_BUILTIN_DECL in the AArch64
backend.
Is this OK to commit?
Thanks,
James Greenhalgh
---
gcc/
2012-11-21 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64-builtins.c (aarch64_builtin_decls): New.
(aarch64_init_simd_builtins): Store declaration after builtin
initialisation.
(aarch64_builtin_decl): New.
* config/aarch64/aarch64-protos.h (aarch64_builtin_decl): New.
* config/aarch64/aarch64.c (TARGET_BUILTIN_DECL): Define.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Patch-AArch64-Add-support-for-TARGET_BUILTIN_DECL.patch --]
[-- Type: text/x-patch; name=0001-Patch-AArch64-Add-support-for-TARGET_BUILTIN_DECL.patch, Size: 2380 bytes --]
diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index 0ce57d3..2cdda0f 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -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,
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index b5a32b3..ab84257 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -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 */
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index d4708bf..6241ba5 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch AArch64] Add support for TARGET_BUILTIN_DECL
2012-11-21 15:05 [Patch AArch64] Add support for TARGET_BUILTIN_DECL James Greenhalgh
@ 2012-11-26 12:31 ` Marcus Shawcroft
0 siblings, 0 replies; 2+ messages in thread
From: Marcus Shawcroft @ 2012-11-26 12:31 UTC (permalink / raw)
To: James Greenhalgh; +Cc: gcc-patches
On 21/11/12 15:05, James Greenhalgh wrote:
>
> Hi,
>
> This patch wires up support for TARGET_BUILTIN_DECL in the AArch64
> backend.
>
> Is this OK to commit?
>
> Thanks,
> James Greenhalgh
>
> ---
> gcc/
>
> 2012-11-21 James Greenhalgh <james.greenhalgh@arm.com>
>
> * config/aarch64/aarch64-builtins.c (aarch64_builtin_decls): New.
> (aarch64_init_simd_builtins): Store declaration after builtin
> initialisation.
> (aarch64_builtin_decl): New.
> * config/aarch64/aarch64-protos.h (aarch64_builtin_decl): New.
> * config/aarch64/aarch64.c (TARGET_BUILTIN_DECL): Define.
>
OK and please back port to ARM/aarch64-4.7-branch
Thanks
/Marcus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-26 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 15:05 [Patch AArch64] Add support for TARGET_BUILTIN_DECL James Greenhalgh
2012-11-26 12:31 ` Marcus Shawcroft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).