+2016-09-23 Matthew Wahab <matthew.wahab@arm.com>
+
+ * doc/sourcebuild.texi (ARM-specific attributes): Add entries for
+ arm_fp16_alternative_ok and arm_fp16_none_ok.
+
2016-09-23 Martin Liska <mliska@suse.cz>
* ipa-icf.c (sem_variable::merge): Replace adress
Test system supports executing Neon half-precision float instructions.
(Implies previous.)
+@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_none_ok
+ARM target supports specifying none as the ARM FP16 format.
+
@item arm_thumb1_ok
ARM target generates Thumb-1 code for @code{-mthumb}.
+2016-09-23 Matthew Wahab <matthew.wahab@arm.com>
+
+ * g++.dg/ext/arm-fp16/arm-fp16-ops-3.C: Use
+ arm_fp16_alternative_ok.
+ * g++.dg/ext/arm-fp16/arm-fp16-ops-4.C: Likewise.
+ * gcc.dg/torture/arm-fp16-int-convert-alt.c: Likewise.
+ * gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c: Likewise.
+ * gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-1.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-10.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-11.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-12.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-2.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-3.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-4.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-5.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-6.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-7.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-8.c: Likewise.
+ * gcc.target/arm/fp16-compile-alt-9.c: Likewise.
+ * gcc.target/arm/fp16-compile-none-1.c: Use arm_fp16_none_ok.
+ * gcc.target/arm/fp16-compile-none-2.c: Likewise.
+ * gcc.target/arm/fp16-rounding-alt-1.c: Use
+ arm_fp16_alternative_ok.
+ * lib/target-supports.exp
+ (check_effective_target_arm_fp16_alternative_ok_nocache): New.
+ (check_effective_target_arm_fp16_alternative_ok): New.
+ (check_effective_target_arm_fp16_none_ok_nocache): New.
+ (check_effective_target_arm_fp16_none_ok): New.
+
2016-09-23 Martin Liska <mliska@suse.cz>
* gcc.dg/ipa/pr77653.c: Replace adress
/* Test various operators on __fp16 and mixed __fp16/float operands. */
/* { dg-do run { target arm*-*-* } } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=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-options "-mfp16-format=alternative -ffast-math" } */
#include "arm-fp16-ops.h"
/* Test floating-point conversions. Standard types and __fp16. */
/* { dg-do run { target arm*-*-* } } */
+/* { dg-require-effective-target arm_fp16_alternative_ok }
/* { dg-options "-mfp16-format=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-options "-mfp16-format=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-options "-mfp16-format=alternative -ffast-math" } */
#include "arm-fp16-ops.h"
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
__fp16 xx = 0.0;
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative -pedantic -std=gnu99" } */
#include <math.h>
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative -pedantic -std=gnu99" } */
#include <math.h>
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
float xx __attribute__((mode(HF))) = 0.0;
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* This number is the maximum value representable in the alternative
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative -pedantic" } */
/* This number overflows the range of the alternative encoding. Since this
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
/* Encoding taken from: http://en.wikipedia.org/wiki/Half_precision */
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_none_ok } */
/* { dg-options "-mfp16-format=none" } */
/* __fp16 type name is not recognized unless you explicitly enable it
/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp16_none_ok } */
/* { dg-options "-mfp16-format=none" } */
/* mode(HF) attributes are not recognized unless you explicitly enable
from double to __fp16. */
/* { dg-do run } */
+/* { dg-require-effective-target arm_fp16_alternative_ok } */
/* { dg-options "-mfp16-format=alternative" } */
#include <stdlib.h>
return "$flags $et_arm_neon_fp16_flags"
}
+# Return 1 if this is an ARM target supporting the FP16 alternative
+# format. Some multilibs may be incompatible with the options needed. Also
+# set et_arm_neon_fp16_flags to the best options to add.
+
+proc check_effective_target_arm_fp16_alternative_ok_nocache { } {
+ global et_arm_neon_fp16_flags
+ 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"} {
+ if { [check_no_compiler_messages_nocache \
+ arm_fp16_alternative_ok object {
+ #if !defined (__ARM_FP16_FORMAT_ALTERNATIVE)
+ #error __ARM_FP16_FORMAT_ALTERNATIVE not defined
+ #endif
+ } "$flags -mfp16-format=alternative"] } {
+ set et_arm_neon_fp16_flags "$flags -mfp16-format=alternative"
+ return 1
+ }
+ }
+ }
+
+ return 0
+}
+
+proc check_effective_target_arm_fp16_alternative_ok { } {
+ return [check_cached_effective_target arm_fp16_alternative_ok \
+ check_effective_target_arm_fp16_alternative_ok_nocache]
+}
+
+# Return 1 if this is an ARM target supports specifying the FP16 none
+# format. Some multilibs may be incompatible with the options needed.
+
+proc check_effective_target_arm_fp16_none_ok_nocache { } {
+ if { [check_effective_target_arm32] } {
+ foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp16"
+ "-mfpu=neon-fp16 -mfloat-abi=softfp"} {
+ if { [check_no_compiler_messages_nocache \
+ arm_fp16_none_ok object {
+ #if defined (__ARM_FP16_FORMAT_ALTERNATIVE)
+ #error __ARM_FP16_FORMAT_ALTERNATIVE defined
+ #endif
+ #if defined (__ARM_FP16_FORMAT_IEEE)
+ #error __ARM_FP16_FORMAT_IEEE defined
+ #endif
+ } "$flags -mfp16-format=none"] } {
+ return 1
+ }
+ }
+ }
+
+ return 0
+}
+
+proc check_effective_target_arm_fp16_none_ok { } {
+ return [check_cached_effective_target arm_fp16_none_ok \
+ check_effective_target_arm_fp16_none_ok_nocache]
+}
+
# Return 1 if this is an ARM target supporting -mfpu=neon-fp-armv8
# -mfloat-abi=softfp or equivalent options. Some multilibs may be
# incompatible with these options. Also set et_arm_v8_neon_flags to the