+2015-01-16 Christian Bruel <christian.bruel@st.com>
+
+ PR target/65837
+ * config/arm/arm-builtins.c (ARM_BUILTIN_CRYPTO_BASE): New enum tag.
+ (arm_init_neon_builtins_internal): Rename arm_init_neon_builtins,
+ (arm_init_crypto_builtins_internal): Rename arm_init_crypto_builtins.
+ use add_builtin_function_ext_scope instead of add_builtin_function.
+ (neon_set_p, neon_crypto_set_p): Remove.
+ (arm_init_builtins): Always call arm_init_neon_builtins and
+ arm_init_crypto_builtins.
+ (arm_expand_builtin): Check that builtins are allowed for the arch.
+ * config/arm/arm-protos.h (arm_init_neon_builtins): Remove prototype.
+ * config/arm/arm.c (arm_valid_target_attribute_tree): Remove
+ arm_init_neon_builtins call.
+
2016-01-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/69117
* ipa-polymorphic-call.c (inlined_polymorphic_ctor_dtor_block_p):
use block_ultimate_origin
(noncall-stmt_may_be_vtbl_ptr_store): Likewise.
-
+
2016-01-13 Sandra Loosemore <sandra@codesourcery.com>
* doc/invoke.texi (Submodel Options): Rename section to
#define CRYPTO3(L, U, M1, M2, M3, M4) \
ARM_BUILTIN_CRYPTO_##U,
+ ARM_BUILTIN_CRYPTO_BASE,
+
#include "crypto.def"
#undef CRYPTO1
"__builtin_neon_uti");
}
+/* Set up all the NEON builtins, even builtins for instructions that are not
+ in the current target ISA to allow the user to compile particular modules
+ with different target specific options that differ from the command line
+ options. Such builtins will be rejected in arm_expand_builtin. */
+
static void
-arm_init_neon_builtins_internal (void)
+arm_init_neon_builtins (void)
{
unsigned int i, fcode = ARM_BUILTIN_NEON_PATTERN_START;
}
static void
-arm_init_crypto_builtins_internal (void)
+arm_init_crypto_builtins (void)
{
tree V16UQI_type_node
= arm_simd_builtin_type (V16QImode, true, false);
#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 ();
- }
-}
-
#undef NUM_DREG_TYPES
#undef NUM_QREG_TYPES
arm_init_neon_builtins which uses it. */
arm_init_fp16_builtins ();
- if (TARGET_NEON)
- arm_init_neon_builtins ();
+ if (TARGET_HARD_FLOAT)
+ {
+ arm_init_neon_builtins ();
+
+ arm_init_crypto_builtins ();
+ }
if (TARGET_CRC32)
arm_init_crc32_builtins ();
static rtx
arm_expand_neon_builtin (int fcode, tree exp, rtx target)
{
+ /* Check in the context of the function making the call whether the
+ builtin is supported. */
+ if (! TARGET_NEON)
+ {
+ fatal_error (input_location,
+ "You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use these intrinsics.");
+ return const0_rtx;
+ }
+
if (fcode == ARM_BUILTIN_NEON_LANE_CHECK)
{
/* Builtin is only to check bounds of the lane passed to some intrinsics
if (fcode >= ARM_BUILTIN_NEON_BASE)
return arm_expand_neon_builtin (fcode, exp, target);
+ /* Check in the context of the function making the call whether the
+ builtin is supported. */
+ if (fcode >= ARM_BUILTIN_CRYPTO_BASE
+ && (!TARGET_CRYPTO || !TARGET_HARD_FLOAT))
+ {
+ fatal_error (input_location,
+ "You must enable crypto intrinsics (e.g. include -mfloat-abi=softfp -mfpu=crypto-neon...) to use these intrinsics.");
+ return const0_rtx;
+ }
+
switch (fcode)
{
case ARM_BUILTIN_GET_FPSCR:
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 *);
/* 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);
}
+2015-01-16 Christian Bruel <christian.bruel@st.com>
+
+ PR target/65837
+ * gcc.target/arm/attr-neon-builtin-fail2.c: New test.
+ * gcc.target/arm/lto/pr65837-attr_0.c: New test.
+ * gcc.target/arm/lto/pr65837_0.c: Fix skip condition and use ACLE name.
+
2016-01-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/69117
--- /dev/null
+/* Check that calling a neon builtin from a function compiled with vfp fails. */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-options "-O2 -mfloat-abi=softfp" } */
+
+extern __simd64_int8_t a, b;
+
+__attribute__ ((target ("fpu=vfp")))
+void
+foo (__simd128_int16_t *p)
+{
+ *p = (__simd128_int16_t)__builtin_neon_vaddlsv8qi (a, b); /* { dg-error "You must enable NEON instructions .*" } */
+
+}
+
--- /dev/null
+/* { dg-lto-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-lto-options {{-flto}} } */
+
+#include "arm_neon.h"
+
+#pragma GCC target ("fpu=neon")
+
+float32x2_t a, b, c, e;
+
+int main()
+{
+ e = vmls_lane_f32 (a, b, c, 0);
+ return 0;
+}
+
/* { dg-lto-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
/* { dg-lto-options {{-flto -mfpu=neon}} } */
/* { dg-suppress-ld-options {-mfpu=neon} } */
int main()
{
- e = __builtin_neon_vmls_lanev2sf (a, b, c, 0);
+ e = vmls_lane_f32 (a, b, c, 0);
return 0;
}