@item arm_neon_fp16_hw
Test system supports executing Neon half-precision float instructions.
-(Implies previous.)
+(Implies @code(arm_neon_fp16_ok).)
@item arm_fp16_alternative_ok
ARM target supports the ARM FP16 alternative format. Some multilibs
may be incompatible with the options needed.
+@item arm_fp16_alternative_hw
+Test system supports executing VFP half-precision floating-point
+instructions in the ARM FP16 alternative format. (Implies
+@code(arm_fp16_alternative_ok).)
+
@item arm_fp16_none_ok
ARM target supports specifying none as the ARM FP16 format.
/* Test various operators on __fp16 and mixed __fp16/float operands. */
/* { dg-do run { target arm*-*-* } } */
-/* { dg-require-effective-target arm_fp16_alternative_ok } */
+/* { dg-require-effective-target arm_fp16_alternative_hw } */
/* { dg-add-options arm_fp16_alternative } */
#include "arm-fp16-ops.h"
/* Test various operators on __fp16 and mixed __fp16/float operands. */
/* { dg-do run { target arm*-*-* } } */
-/* { dg-require-effective-target arm_fp16_alternative_ok } */
+/* { dg-require-effective-target arm_fp16_alternative_hw } */
/* { dg-options "-ffast-math" } */
/* { dg-add-options arm_fp16_alternative } */
/* Test floating-point conversions. Standard types and __fp16. */
/* { dg-do run { target arm*-*-* } } */
-/* { dg-require-effective-target arm_fp16_alternative_ok }
+/* { dg-require-effective-target arm_fp16_alternative_hw } */
/* { dg-add-options arm_fp16_alternative } */
#include "fp-int-convert.h"
/* Test various operators on __fp16 and mixed __fp16/float operands. */
/* { dg-do run { target arm*-*-* } } */
-/* { dg-require-effective-target arm_fp16_alternative_ok }
+/* { dg-require-effective-target arm_fp16_alternative_hw } */
/* { dg-add-options arm_fp16_alternative } */
#include "arm-fp16-ops.h"
/* Test various operators on __fp16 and mixed __fp16/float operands. */
/* { dg-do run { target arm*-*-* } } */
-/* { dg-require-effective-target arm_fp16_alternative_ok }
+/* { dg-require-effective-target arm_fp16_alternative_hw } */
/* { dg-options "-ffast-math" } */
/* { dg-add-options arm_fp16_alternative } */
check_effective_target_arm_fp16_alternative_ok_nocache]
}
+# Return 1 if the target supports executing FP16 alternative format
+# instructions selected by arm_fp16_alternative_ok.
+
+proc check_effective_target_arm_fp16_alternative_hw { } {
+ if { ! [check_effective_target_arm_fp16_alternative_ok] } {
+ return 0
+ }
+
+ global et_arm_fp16_alternative_flags
+ check_runtime arm_fp16_alternative_hw {
+ int
+ main (int argc, char **argv)
+ {
+ __fp16 a = 1.0;
+ float r;
+ asm ("vcvtb.f32.f16 %0, %1"
+ : "=w" (r) : "w" (a)
+ : /* No clobbers. */);
+ return (r == 1.0) ? 0 : 1;
+ }
+ } "$et_arm_fp16_alternative_flags"
+}
+
# Return 1 if this is an ARM target supports specifying the FP16 none
# format. Some multilibs may be incompatible with the options needed.