mirror of git://gcc.gnu.org/git/gcc.git
[ARM] Hide existing float16 intrinsics unless we have a scalar __fp16 type
gcc/: * 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. gcc/testsuite/: * lib/target-supports.exp (check_effective_target_arm_neon_fp16_ok_nocache): Add flag variants with -mfp16-format=ieee. From-SVN: r227033
This commit is contained in:
parent
30aa6349e1
commit
50399bb138
|
|
@ -1,3 +1,15 @@
|
||||||
|
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>
|
2015-08-20 Richard Sandiford <richard.sandiford@arm.com>
|
||||||
|
|
||||||
* config/i386/predicates.md (vector_all_ones_operand): Use
|
* config/i386/predicates.md (vector_all_ones_operand): Use
|
||||||
|
|
|
||||||
|
|
@ -769,13 +769,6 @@ arm_init_simd_builtin_types (void)
|
||||||
int nelts = sizeof (arm_simd_types) / sizeof (arm_simd_types[0]);
|
int nelts = sizeof (arm_simd_types) / sizeof (arm_simd_types[0]);
|
||||||
tree tdecl;
|
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
|
/* 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
|
ABI, they get initialized using the old interface, and don't get
|
||||||
an entry in our mangling table, consequently, they get default
|
an entry in our mangling table, consequently, they get default
|
||||||
|
|
@ -823,6 +816,8 @@ arm_init_simd_builtin_types (void)
|
||||||
mangling. */
|
mangling. */
|
||||||
|
|
||||||
/* Continue with standard types. */
|
/* 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[Float16x4_t].eltype = arm_simd_floatHF_type_node;
|
||||||
arm_simd_types[Float32x2_t].eltype = float_type_node;
|
arm_simd_types[Float32x2_t].eltype = float_type_node;
|
||||||
arm_simd_types[Float32x4_t].eltype = float_type_node;
|
arm_simd_types[Float32x4_t].eltype = float_type_node;
|
||||||
|
|
@ -1702,10 +1697,12 @@ arm_init_iwmmxt_builtins (void)
|
||||||
static void
|
static void
|
||||||
arm_init_fp16_builtins (void)
|
arm_init_fp16_builtins (void)
|
||||||
{
|
{
|
||||||
tree fp16_type = make_node (REAL_TYPE);
|
arm_simd_floatHF_type_node = make_node (REAL_TYPE);
|
||||||
TYPE_PRECISION (fp16_type) = 16;
|
TYPE_PRECISION (arm_simd_floatHF_type_node) = GET_MODE_PRECISION (HFmode);
|
||||||
layout_type (fp16_type);
|
layout_type (arm_simd_floatHF_type_node);
|
||||||
(*lang_hooks.types.register_builtin_type) (fp16_type, "__fp16");
|
if (arm_fp16_format)
|
||||||
|
(*lang_hooks.types.register_builtin_type) (arm_simd_floatHF_type_node,
|
||||||
|
"__fp16");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1750,12 +1747,13 @@ arm_init_builtins (void)
|
||||||
if (TARGET_REALLY_IWMMXT)
|
if (TARGET_REALLY_IWMMXT)
|
||||||
arm_init_iwmmxt_builtins ();
|
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)
|
if (TARGET_NEON)
|
||||||
arm_init_neon_builtins ();
|
arm_init_neon_builtins ();
|
||||||
|
|
||||||
if (arm_fp16_format)
|
|
||||||
arm_init_fp16_builtins ();
|
|
||||||
|
|
||||||
if (TARGET_CRC32)
|
if (TARGET_CRC32)
|
||||||
arm_init_crc32_builtins ();
|
arm_init_crc32_builtins ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,9 @@ typedef __simd64_int8_t int8x8_t;
|
||||||
typedef __simd64_int16_t int16x4_t;
|
typedef __simd64_int16_t int16x4_t;
|
||||||
typedef __simd64_int32_t int32x2_t;
|
typedef __simd64_int32_t int32x2_t;
|
||||||
typedef __builtin_neon_di int64x1_t;
|
typedef __builtin_neon_di int64x1_t;
|
||||||
|
#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
|
||||||
typedef __simd64_float16_t float16x4_t;
|
typedef __simd64_float16_t float16x4_t;
|
||||||
|
#endif
|
||||||
typedef __simd64_float32_t float32x2_t;
|
typedef __simd64_float32_t float32x2_t;
|
||||||
typedef __simd64_poly8_t poly8x8_t;
|
typedef __simd64_poly8_t poly8x8_t;
|
||||||
typedef __simd64_poly16_t poly16x4_t;
|
typedef __simd64_poly16_t poly16x4_t;
|
||||||
|
|
@ -6220,21 +6222,25 @@ vcvtq_u32_f32 (float32x4_t __a)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ((__ARM_FP & 0x2) != 0)
|
#if ((__ARM_FP & 0x2) != 0)
|
||||||
|
#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
|
||||||
__extension__ static __inline float16x4_t __attribute__ ((__always_inline__))
|
__extension__ static __inline float16x4_t __attribute__ ((__always_inline__))
|
||||||
vcvt_f16_f32 (float32x4_t __a)
|
vcvt_f16_f32 (float32x4_t __a)
|
||||||
{
|
{
|
||||||
return (float16x4_t)__builtin_neon_vcvtv4hfv4sf (__a);
|
return (float16x4_t)__builtin_neon_vcvtv4hfv4sf (__a);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ((__ARM_FP & 0x2) != 0)
|
#if ((__ARM_FP & 0x2) != 0)
|
||||||
|
#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
|
||||||
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
|
__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
|
||||||
vcvt_f32_f16 (float16x4_t __a)
|
vcvt_f32_f16 (float16x4_t __a)
|
||||||
{
|
{
|
||||||
return (float32x4_t)__builtin_neon_vcvtv4sfv4hf (__a);
|
return (float32x4_t)__builtin_neon_vcvtv4sfv4hf (__a);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
|
__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
|
||||||
vcvt_n_s32_f32 (float32x2_t __a, const int __b)
|
vcvt_n_s32_f32 (float32x2_t __a, const int __b)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
PR c++/67065
|
PR c++/67065
|
||||||
|
|
|
||||||
|
|
@ -2714,7 +2714,11 @@ proc check_effective_target_arm_neon_fp16_ok_nocache { } {
|
||||||
set et_arm_neon_fp16_flags ""
|
set et_arm_neon_fp16_flags ""
|
||||||
if { [check_effective_target_arm32] } {
|
if { [check_effective_target_arm32] } {
|
||||||
foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp16"
|
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 {
|
if { [check_no_compiler_messages_nocache arm_neon_fp_16_ok object {
|
||||||
#include "arm_neon.h"
|
#include "arm_neon.h"
|
||||||
float16x4_t
|
float16x4_t
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue