This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[GCC][testsuite][ARM][AArch64] Add ARM v8.6 effective target checks to target-supports.exp
- From: Stam Markianos-Wright <Stam dot Markianos-Wright at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>
- Date: Thu, 12 Dec 2019 10:00:10 +0000
- Subject: [GCC][testsuite][ARM][AArch64] Add ARM v8.6 effective target checks to target-supports.exp
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l/xNc5cnmfjb6TOCHEVB4EwuQT2cES8rAwoZc4GWhwg=; b=gbz9/wWgtGyEYI1buGwuOqNMkuEHAzRVGRpNbKz39681Lo/VsE1OsVvHW1W4wENZV7zYZROiUY+fvvXYKxrXIkd32So4baXMZCyJLhFrdBNQf4n22i20MC7Lrwuhqsc8sPnZMms2q67qj2fxIULPM16HgwUGbmjarrEi9O/+RD/K1r9C/obJkXUHs4coiDNXt2/v3fYT6HOsStD+w3WWqL542PFNRfnpwPdEioXyrPzJ9JABx7vkz7kxX0PZE9ErPE8pK2NXUJp/g0ywtXv8IAK5rkUqc/Ym2AppWfdSu64KGJ83T2JYSCoO+JOzsvh76ayoigRjGHwwiREDTS7JQg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8n+aRMPxNOQnAQgTZrtMe2psl0FjDS/c0iAhOp9cRu3xJO5wz5o+HS+6MK3E1jhrZEIgYDskzL2/M1agFh0mrVbFJ+q2RztJ5QVLAKWXj5IEdGUtOIjwIaXGiiuWWXiljIwBFfyVfG8GjmUpUFKCkJKDoQo8qrQjAOgz5kibDQOX255wUwZ+BaiushhPA7nZ0hP7nx1gVKR+8umfTClymGZ4OkkMULEkqiCjcRlMpGHXXT1JNHSiAFRoAFHetexFATXcwKtX0x8oyfyExkOgzJe+xU+WVed/48Er+P+Enyi2zFg0RSmbU2gDfixwZkh06FmM9HHeVoi+KhE6Am7kg==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Stam dot Markianos-Wright at arm dot com;
Hi all,
This small patch adds support for the ARM v8.6 extensions +bf16 and
+i8mm to the testsuite. This will be tested through other upcoming
patches, which is why we are not providing any explicit tests here.
Ok for trunk?
Also I don't have commit rights, so if someone could commit on my
behalf, that would be great :)
The functionality here depends on CLI patches:
https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02415.html
https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02195.html
but this patch applies cleanly without them, too.
Cheers,
Stam
gcc/testsuite/ChangeLog:
2019-12-11 Stam Markianos-Wright <stam.markianos-wright@arm.com>
* lib/target-supports.exp
(check_effective_target_arm_v8_2a_i8mm_ok_nocache): New.
(check_effective_target_arm_v8_2a_i8mm_ok): New.
(add_options_for_arm_v8_2a_i8mm): New.
(check_effective_target_arm_v8_2a_bf16_neon_ok_nocache): New.
(check_effective_target_arm_v8_2a_bf16_neon_ok): New.
(add_options_for_arm_v8_2a_bf16_neon): New.
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5b4cc02f921..36fb63e9929 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4781,6 +4781,49 @@ proc add_options_for_arm_v8_2a_dotprod_neon { flags } {
return "$flags $et_arm_v8_2a_dotprod_neon_flags"
}
+# Return 1 if the target supports ARMv8.2+i8mm Adv.SIMD Dot Product
+# instructions, 0 otherwise. The test is valid for ARM and for AArch64.
+# Record the command line options needed.
+
+proc check_effective_target_arm_v8_2a_i8mm_ok_nocache { } {
+ global et_arm_v8_2a_i8mm_flags
+ set et_arm_v8_2a_i8mm_flags ""
+
+ if { ![istarget arm*-*-*] && ![istarget aarch64*-*-*] } {
+ return 0;
+ }
+
+ # Iterate through sets of options to find the compiler flags that
+ # need to be added to the -march option.
+ foreach flags {"" "-mfloat-abi=hard -mfpu=neon-fp-armv8" "-mfloat-abi=softfp -mfpu=neon-fp-armv8" } {
+ if { [check_no_compiler_messages_nocache \
+ arm_v8_2a_i8mm_ok object {
+ #include <arm_neon.h>
+ #if !defined (__ARM_FEATURE_MATMUL_INT8)
+ #error "__ARM_FEATURE_MATMUL_INT8 not defined"
+ #endif
+ } "$flags -march=armv8.2-a+i8mm"] } {
+ set et_arm_v8_2a_i8mm_flags "$flags -march=armv8.2-a+i8mm"
+ return 1
+ }
+ }
+
+ return 0;
+}
+
+proc check_effective_target_arm_v8_2a_i8mm_ok { } {
+ return [check_cached_effective_target arm_v8_2a_i8mm_ok \
+ check_effective_target_arm_v8_2a_i8mm_ok_nocache]
+}
+
+proc add_options_for_arm_v8_2a_i8mm { flags } {
+ if { ! [check_effective_target_arm_v8_2a_i8mm_ok] } {
+ return "$flags"
+ }
+ global et_arm_v8_2a_i8mm_flags
+ return "$flags $et_arm_v8_2a_i8mm_flags"
+}
+
# Return 1 if the target supports FP16 VFMAL and VFMSL
# instructions, 0 otherwise.
# Record the command line options needed.
@@ -4826,6 +4869,45 @@ proc add_options_for_arm_fp16fml_neon { flags } {
return "$flags $et_arm_fp16fml_neon_flags"
}
+# Return 1 if the target supports BFloat16 SIMD instructions, 0 otherwise.
+# The test is valid for ARM and for AArch64.
+
+proc check_effective_target_arm_v8_2a_bf16_neon_ok_nocache { } {
+ global et_arm_v8_2a_bf16_neon_flags
+ set et_arm_v8_2a_bf16_neon_flags ""
+
+ if { ![istarget arm*-*-*] && ![istarget aarch64*-*-*] } {
+ return 0;
+ }
+
+ foreach flags {"" "-mfloat-abi=hard -mfpu=neon-fp-armv8" "-mfloat-abi=softfp -mfpu=neon-fp-armv8" } {
+ if { [check_no_compiler_messages_nocache arm_v8_2a_bf16_neon_ok object {
+ #include <arm_neon.h>
+ #if !defined (__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
+ #error "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC not defined"
+ #endif
+ } "$flags -march=armv8.2-a+bf16"] } {
+ set et_arm_v8_2a_bf16_neon_flags "$flags -march=armv8.2-a+bf16"
+ return 1
+ }
+ }
+
+ return 0;
+}
+
+proc check_effective_target_arm_v8_2a_bf16_neon_ok { } {
+ return [check_cached_effective_target arm_v8_2a_bf16_neon_ok \
+ check_effective_target_arm_v8_2a_bf16_neon_ok_nocache]
+}
+
+proc add_options_for_arm_v8_2a_bf16_neon { flags } {
+ if { ! [check_effective_target_arm_v8_2a_bf16_neon_ok] } {
+ return "$flags"
+ }
+ global et_arm_v8_2a_bf16_neon_flags
+ return "$flags $et_arm_v8_2a_bf16_neon_flags"
+}
+
# Return 1 if the target supports executing ARMv8 NEON instructions, 0
# otherwise.