diff options
author | Christian Bruel <christian.bruel@st.com> | 2015-11-16 10:00:09 +0100 |
---|---|---|
committer | Christian Bruel <chrbr@gcc.gnu.org> | 2015-11-16 10:00:09 +0100 |
commit | 00c02a701007b5bc1c26ffef68abc5ae3c0bab93 (patch) | |
tree | 618ca4ac806ae6d4b390a6bdc01c007183b6b789 /gcc/config | |
parent | da225f53f918c13111f19484e8b87cea023f5be2 (diff) | |
download | gcc-00c02a701007b5bc1c26ffef68abc5ae3c0bab93.zip gcc-00c02a701007b5bc1c26ffef68abc5ae3c0bab93.tar.gz gcc-00c02a701007b5bc1c26ffef68abc5ae3c0bab93.tar.bz2 |
re PR target/65837 ([arm-linux-gnueabihf] lto1 target specific builtin not available)
2015-11-16 Christian Bruel <christian.bruel@st.com>
PR target/65837
* config/arm/arm-protos.h (arm_init_neon_builtins): Declare.
* config/arm/arm.c (arm_valid_target_attribute_tree): Call
arm_init_neon_builtins.
* config/arm/arm-builtins.c (arm_init_neon_builtins): Split into...
(arm_init_neon_builtins_internal)
(arm_init_crypto_builtins_internal):
Test and set neon_set_p, neon_crypto_set_p.
(neon_set_p, neon_crypto_set_p): New static booleans.
From-SVN: r230406
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arm/arm-builtins.c | 164 | ||||
-rw-r--r-- | gcc/config/arm/arm-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 3 |
3 files changed, 95 insertions, 73 deletions
diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c index f73afc2..d007405 100644 --- a/gcc/config/arm/arm-builtins.c +++ b/gcc/config/arm/arm-builtins.c @@ -893,7 +893,7 @@ arm_init_simd_builtin_scalar_types (void) } static void -arm_init_neon_builtins (void) +arm_init_neon_builtins_internal (void) { unsigned int i, fcode = ARM_BUILTIN_NEON_PATTERN_START; @@ -1014,87 +1014,105 @@ arm_init_neon_builtins (void) NULL, NULL_TREE); arm_builtin_decls[fcode] = fndecl; } +} - if (TARGET_CRYPTO && TARGET_HARD_FLOAT) - { - tree V16UQI_type_node = arm_simd_builtin_type (V16QImode, - true, - false); +static void +arm_init_crypto_builtins_internal (void) +{ + tree V16UQI_type_node + = arm_simd_builtin_type (V16QImode, true, false); - tree V4USI_type_node = arm_simd_builtin_type (V4SImode, - true, - false); + tree V4USI_type_node + = arm_simd_builtin_type (V4SImode, true, false); - tree v16uqi_ftype_v16uqi - = build_function_type_list (V16UQI_type_node, V16UQI_type_node, - NULL_TREE); + tree v16uqi_ftype_v16uqi + = build_function_type_list (V16UQI_type_node, V16UQI_type_node, + NULL_TREE); - tree v16uqi_ftype_v16uqi_v16uqi + tree v16uqi_ftype_v16uqi_v16uqi = build_function_type_list (V16UQI_type_node, V16UQI_type_node, V16UQI_type_node, NULL_TREE); - tree v4usi_ftype_v4usi - = build_function_type_list (V4USI_type_node, V4USI_type_node, - NULL_TREE); - - tree v4usi_ftype_v4usi_v4usi - = build_function_type_list (V4USI_type_node, V4USI_type_node, - V4USI_type_node, NULL_TREE); - - tree v4usi_ftype_v4usi_v4usi_v4usi - = build_function_type_list (V4USI_type_node, V4USI_type_node, - V4USI_type_node, V4USI_type_node, - NULL_TREE); - - tree uti_ftype_udi_udi - = build_function_type_list (unsigned_intTI_type_node, - unsigned_intDI_type_node, - unsigned_intDI_type_node, - NULL_TREE); - - #undef CRYPTO1 - #undef CRYPTO2 - #undef CRYPTO3 - #undef C - #undef N - #undef CF - #undef FT1 - #undef FT2 - #undef FT3 - - #define C(U) \ - ARM_BUILTIN_CRYPTO_##U - #define N(L) \ - "__builtin_arm_crypto_"#L - #define FT1(R, A) \ - R##_ftype_##A - #define FT2(R, A1, A2) \ - R##_ftype_##A1##_##A2 - #define FT3(R, A1, A2, A3) \ - R##_ftype_##A1##_##A2##_##A3 - #define CRYPTO1(L, U, R, A) \ - arm_builtin_decls[C (U)] \ - = add_builtin_function (N (L), FT1 (R, A), \ - C (U), BUILT_IN_MD, NULL, NULL_TREE); - #define CRYPTO2(L, U, R, A1, A2) \ - arm_builtin_decls[C (U)] \ - = add_builtin_function (N (L), FT2 (R, A1, A2), \ - C (U), BUILT_IN_MD, NULL, NULL_TREE); + tree v4usi_ftype_v4usi + = build_function_type_list (V4USI_type_node, V4USI_type_node, + NULL_TREE); + + tree v4usi_ftype_v4usi_v4usi + = build_function_type_list (V4USI_type_node, V4USI_type_node, + V4USI_type_node, NULL_TREE); + + tree v4usi_ftype_v4usi_v4usi_v4usi + = build_function_type_list (V4USI_type_node, V4USI_type_node, + V4USI_type_node, V4USI_type_node, + NULL_TREE); - #define CRYPTO3(L, U, R, A1, A2, A3) \ - arm_builtin_decls[C (U)] \ - = add_builtin_function (N (L), FT3 (R, A1, A2, A3), \ + tree uti_ftype_udi_udi + = build_function_type_list (unsigned_intTI_type_node, + unsigned_intDI_type_node, + unsigned_intDI_type_node, + NULL_TREE); + + #undef CRYPTO1 + #undef CRYPTO2 + #undef CRYPTO3 + #undef C + #undef N + #undef CF + #undef FT1 + #undef FT2 + #undef FT3 + + #define C(U) \ + ARM_BUILTIN_CRYPTO_##U + #define N(L) \ + "__builtin_arm_crypto_"#L + #define FT1(R, A) \ + R##_ftype_##A + #define FT2(R, A1, A2) \ + R##_ftype_##A1##_##A2 + #define FT3(R, A1, A2, A3) \ + R##_ftype_##A1##_##A2##_##A3 + #define CRYPTO1(L, U, R, A) \ + arm_builtin_decls[C (U)] \ + = add_builtin_function (N (L), FT1 (R, A), \ + C (U), BUILT_IN_MD, NULL, NULL_TREE); + #define CRYPTO2(L, U, R, A1, A2) \ + arm_builtin_decls[C (U)] \ + = add_builtin_function (N (L), FT2 (R, A1, A2), \ + C (U), BUILT_IN_MD, NULL, NULL_TREE); + + #define CRYPTO3(L, U, R, A1, A2, A3) \ + arm_builtin_decls[C (U)] \ + = add_builtin_function (N (L), FT3 (R, A1, A2, A3), \ C (U), BUILT_IN_MD, NULL, NULL_TREE); - #include "crypto.def" - - #undef CRYPTO1 - #undef CRYPTO2 - #undef CRYPTO3 - #undef C - #undef N - #undef FT1 - #undef FT2 - #undef FT3 + #include "crypto.def" + + #undef CRYPTO1 + #undef CRYPTO2 + #undef CRYPTO3 + #undef C + #undef N + #undef FT1 + #undef FT2 + #undef FT3 +} + +static bool neon_set_p = false; +static bool neon_crypto_set_p = false; + +void +arm_init_neon_builtins (void) +{ + if (! neon_set_p) + { + neon_set_p = true; + arm_init_neon_builtins_internal (); + } + + if (!neon_crypto_set_p && TARGET_CRYPTO && TARGET_HARD_FLOAT) + { + neon_crypto_set_p = true; + arm_init_crypto_builtins_internal (); } } diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index f9b12764..8e73753 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -214,6 +214,7 @@ extern void arm_mark_dllimport (tree); extern bool arm_change_mode_p (tree); #endif +extern void arm_init_neon_builtins (void); extern tree arm_valid_target_attribute_tree (tree, struct gcc_options *, struct gcc_options *); extern void arm_pr_long_calls (struct cpp_reader *); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 10c4348..98b5c82 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -29846,6 +29846,9 @@ arm_valid_target_attribute_tree (tree args, struct gcc_options *opts, /* Do any overrides, such as global options arch=xxx. */ arm_option_override_internal (opts, opts_set); + if (TARGET_NEON) + arm_init_neon_builtins (); + return build_target_option_node (opts); } |