+2015-08-20 Alan Lawrence <alan.lawrence@arm.com>
+
+ * config/arm/arm-builtins.c (arm_init_simd_builtin_types): Move
+ initialization of HFmode scalar type (float16_t) to...
+ (arm_init_fp16_builtins): ... Here. Combine with __fp16 initialization
+ code.
+
+ (arm_init_builtins): Call arm_init_fp16_builtins earlier and always.
+
+ * config/arm/arm_neon.h (vcvt_f16_f32, vcvt_f32_f16): Condition on
+ having an -mfp16-format.
+
2015-08-20 Richard Sandiford <richard.sandiford@arm.com>
* config/i386/predicates.md (vector_all_ones_operand): Use
int nelts = sizeof (arm_simd_types) / sizeof (arm_simd_types[0]);
tree tdecl;
- /* Initialize the HFmode scalar type. */
- arm_simd_floatHF_type_node = make_node (REAL_TYPE);
- TYPE_PRECISION (arm_simd_floatHF_type_node) = GET_MODE_PRECISION (HFmode);
- layout_type (arm_simd_floatHF_type_node);
- (*lang_hooks.types.register_builtin_type) (arm_simd_floatHF_type_node,
- "__builtin_neon_hf");
-
/* Poly types are a world of their own. In order to maintain legacy
ABI, they get initialized using the old interface, and don't get
an entry in our mangling table, consequently, they get default
mangling. */
/* Continue with standard types. */
+ /* The __builtin_simd{64,128}_float16 types are kept private unless
+ we have a scalar __fp16 type. */
arm_simd_types[Float16x4_t].eltype = arm_simd_floatHF_type_node;
arm_simd_types[Float32x2_t].eltype = float_type_node;
arm_simd_types[Float32x4_t].eltype = float_type_node;
static void
arm_init_fp16_builtins (void)
{
- tree fp16_type = make_node (REAL_TYPE);
- TYPE_PRECISION (fp16_type) = 16;
- layout_type (fp16_type);
- (*lang_hooks.types.register_builtin_type) (fp16_type, "__fp16");
+ arm_simd_floatHF_type_node = make_node (REAL_TYPE);
+ TYPE_PRECISION (arm_simd_floatHF_type_node) = GET_MODE_PRECISION (HFmode);
+ layout_type (arm_simd_floatHF_type_node);
+ if (arm_fp16_format)
+ (*lang_hooks.types.register_builtin_type) (arm_simd_floatHF_type_node,
+ "__fp16");
}
static void
if (TARGET_REALLY_IWMMXT)
arm_init_iwmmxt_builtins ();
+ /* This creates the arm_simd_floatHF_type_node so must come before
+ arm_init_neon_builtins which uses it. */
+ arm_init_fp16_builtins ();
+
if (TARGET_NEON)
arm_init_neon_builtins ();
- if (arm_fp16_format)
- arm_init_fp16_builtins ();
-
if (TARGET_CRC32)
arm_init_crc32_builtins ();
typedef __simd64_int16_t int16x4_t;
typedef __simd64_int32_t int32x2_t;
typedef __builtin_neon_di int64x1_t;
+#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
typedef __simd64_float16_t float16x4_t;
+#endif
typedef __simd64_float32_t float32x2_t;
typedef __simd64_poly8_t poly8x8_t;
typedef __simd64_poly16_t poly16x4_t;
}
#if ((__ARM_FP & 0x2) != 0)
+#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
__extension__ static __inline float16x4_t __attribute__ ((__always_inline__))
vcvt_f16_f32 (float32x4_t __a)
{
return (float16x4_t)__builtin_neon_vcvtv4hfv4sf (__a);
}
-
#endif
+#endif
+
#if ((__ARM_FP & 0x2) != 0)
+#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
vcvt_f32_f16 (float16x4_t __a)
{
return (float32x4_t)__builtin_neon_vcvtv4sfv4hf (__a);
}
-
#endif
+#endif
+
__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
vcvt_n_s32_f32 (float32x2_t __a, const int __b)
{
+2015-08-20 Alan Lawrence <alan.lawrence@arm.com>
+
+ * lib/target-supports.exp
+ (check_effective_target_arm_neon_fp16_ok_nocache): Add flag variants
+ with -mfp16-format=ieee.
+
2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67065
set et_arm_neon_fp16_flags ""
if { [check_effective_target_arm32] } {
foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp16"
- "-mfpu=neon-fp16 -mfloat-abi=softfp"} {
+ "-mfpu=neon-fp16 -mfloat-abi=softfp"
+ "-mfp16-format=ieee"
+ "-mfloat-abi=softfp -mfp16-format=ieee"
+ "-mfpu=neon-fp16 -mfp16-format=ieee"
+ "-mfpu=neon-fp16 -mfloat-abi=softfp -mfp16-format=ieee"} {
if { [check_no_compiler_messages_nocache arm_neon_fp_16_ok object {
#include "arm_neon.h"
float16x4_t