This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH v2 4/9] S/390: Do not use signaling vector comparisons on z13
- From: Ilya Leoshkevich <iii at linux dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: richard dot sandiford at arm dot com, segher at kernel dot crashing dot org, Ilya Leoshkevich <iii at linux dot ibm dot com>
- Date: Thu, 22 Aug 2019 15:45:46 +0200
- Subject: [PATCH v2 4/9] S/390: Do not use signaling vector comparisons on z13
- References: <20190822134551.18924-1-iii@linux.ibm.com>
z13 supports only non-signaling vector comparisons. This means we
cannot vectorize LT, LE, GT, GE and LTGT when compiling for z13. Notify
middle-end about this using more restrictive operator predicate in
vcond<V_HW:mode><V_HW2:mode>.
gcc/ChangeLog:
2019-08-21 Ilya Leoshkevich <iii@linux.ibm.com>
* config/s390/vector.md (vcond_comparison_operator): New
predicate.
(vcond<V_HW:mode><V_HW2:mode>): Use vcond_comparison_operator.
---
gcc/config/s390/vector.md | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index 0702e1de835..d7a266c5605 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -614,10 +614,30 @@
operands[2] = GEN_INT (GET_MODE_NUNITS (<MODE>mode) - 1);
})
+(define_predicate "vcond_comparison_operator"
+ (match_operand 0 "comparison_operator")
+{
+ if (!HONOR_NANS (GET_MODE (XEXP (op, 0)))
+ && !HONOR_NANS (GET_MODE (XEXP (op, 1))))
+ return true;
+ switch (GET_CODE (op))
+ {
+ case LE:
+ case LT:
+ case GE:
+ case GT:
+ case LTGT:
+ /* Signaling vector comparisons are supported only on z14+. */
+ return TARGET_Z14;
+ default:
+ return true;
+ }
+})
+
(define_expand "vcond<V_HW:mode><V_HW2:mode>"
[(set (match_operand:V_HW 0 "register_operand" "")
(if_then_else:V_HW
- (match_operator 3 "comparison_operator"
+ (match_operator 3 "vcond_comparison_operator"
[(match_operand:V_HW2 4 "register_operand" "")
(match_operand:V_HW2 5 "nonmemory_operand" "")])
(match_operand:V_HW 1 "nonmemory_operand" "")
--
2.21.0