[v3,1/3] testsuite: Support dg-require-effective-target for us{add, sub}

Message ID 20241127202741.771893-2-Akram.Ahmad@arm.com
State New
Headers
Series Match: support additional cases of unsigned scalar arithmetic |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Akram Ahmad Nov. 27, 2024, 8:27 p.m. UTC
  Support for middle-end representation of saturating arithmetic (via
IFN_SAT_ADD or IFN_SAT_SUB) cannot be determined externally, making it
currently impossible to selectively skip relevant tests on targets which
do not support this.

This patch adds new dg-require-effective-target keywords for each of the
unsigned saturating arithmetic optabs, for scalar QImode, HImode,
SImode, and DImode. These can then be used in future tests which focus
on these internal functions.

Currently passes aarch64 regression tests with no additional failures.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Add new effective-target keywords
---
 gcc/testsuite/lib/target-supports.exp | 56 +++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
  

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index d113a08dff7..ec1d73970a1 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4471,6 +4471,62 @@  proc check_effective_target_vect_complex_add_double { } {
 	}}]
 }
 
+# Return 1 if the target supports middle-end representation of saturating
+# addition for QImode, 0 otherwise.
+
+proc check_effective_target_usadd_qimode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# addition for HImode, 0 otherwise.
+
+proc check_effective_target_usadd_himode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# addition for SImode, 0 otherwise.
+
+proc check_effective_target_usadd_simode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# addition for DImode, 0 otherwise.
+
+proc check_effective_target_usadd_dimode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# subtraction for QImode, 0 otherwise.
+
+proc check_effective_target_ussub_qimode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# subtraction for HImode, 0 otherwise.
+
+proc check_effective_target_ussub_himode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# subtraction for SImode, 0 otherwise.
+
+proc check_effective_target_ussub_simode { } {
+    return 0
+}
+
+# Return 1 if the target supports middle-end representation of saturating
+# subtraction for DImode, 0 otherwise.
+
+proc check_effective_target_ussub_dimode { } {
+    return 0
+}
+
 # Return 1 if the target supports signed int->float conversion
 #