public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] s390: Fix up *cmp_and_trap_unsigned_int<mode> constraints [PR104775]
@ 2022-03-05  8:33 Jakub Jelinek
  2022-03-06  9:15 ` Jakub Jelinek
  2022-03-07 10:10 ` Andreas Krebbel
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2022-03-05  8:33 UTC (permalink / raw)
  To: Andreas Krebbel; +Cc: gcc-patches

Hi!

The following testcase fails to assemble due to clgte %r6,0(%r1,%r10)
insn not being accepted by assembler.
My rough understanding is that in the RSY-b insn format the spot
in other formats used for index registers is used instead for M3 what
kind of comparison it is, so this patch follows what other similar
instructions use for constraint (i.e. one without index register).

Bootstrapped on s390x-linux, regtest there still pending, ok for
trunk if it passes it?

2022-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/104775
	* config/s390/s390.md (*cmp_and_trap_unsigned_int<mode>): Use
	S constraint instead of T in the last alternative.

	* gcc.target/s390/pr104775.c: New test.

--- gcc/config/s390/s390.md.jj	2022-02-08 20:08:13.873404137 +0100
+++ gcc/config/s390/s390.md	2022-03-04 14:38:23.252988476 +0100
@@ -9578,7 +9578,7 @@ (define_insn "*cmp_and_trap_signed_int<m
 (define_insn "*cmp_and_trap_unsigned_int<mode>"
   [(trap_if (match_operator 0 "s390_unsigned_integer_comparison"
 	       [(match_operand:GPR 1 "register_operand" "d,d,d")
-		(match_operand:GPR 2 "general_operand"  "d,D,T")])
+		(match_operand:GPR 2 "general_operand"  "d,D,S")])
 	    (const_int 0))]
   "TARGET_Z10"
   "@
--- gcc/testsuite/gcc.target/s390/pr104775.c.jj	2022-03-04 14:49:58.190134898 +0100
+++ gcc/testsuite/gcc.target/s390/pr104775.c	2022-03-04 14:49:42.845352647 +0100
@@ -0,0 +1,14 @@
+/* PR target/104775 */
+/* { dg-do assemble { target s390_zEC12_hw } } */
+/* { dg-options "-O2 -march=zEC12" } */
+
+long a[64];
+void bar (void);
+
+void
+foo (int x, int y)
+{
+  if (x != a[y])
+    bar ();
+  __builtin_trap ();
+}

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] s390: Fix up *cmp_and_trap_unsigned_int<mode> constraints [PR104775]
  2022-03-05  8:33 [PATCH] s390: Fix up *cmp_and_trap_unsigned_int<mode> constraints [PR104775] Jakub Jelinek
@ 2022-03-06  9:15 ` Jakub Jelinek
  2022-03-07 10:10 ` Andreas Krebbel
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2022-03-06  9:15 UTC (permalink / raw)
  To: Andreas Krebbel, gcc-patches

On Sat, Mar 05, 2022 at 09:33:58AM +0100, Jakub Jelinek via Gcc-patches wrote:
> Hi!
> 
> The following testcase fails to assemble due to clgte %r6,0(%r1,%r10)
> insn not being accepted by assembler.
> My rough understanding is that in the RSY-b insn format the spot
> in other formats used for index registers is used instead for M3 what
> kind of comparison it is, so this patch follows what other similar
> instructions use for constraint (i.e. one without index register).
> 
> Bootstrapped on s390x-linux, regtest there still pending, ok for
> trunk if it passes it?

Regression testing passed too.

> 2022-03-05  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/104775
> 	* config/s390/s390.md (*cmp_and_trap_unsigned_int<mode>): Use
> 	S constraint instead of T in the last alternative.
> 
> 	* gcc.target/s390/pr104775.c: New test.

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] s390: Fix up *cmp_and_trap_unsigned_int<mode> constraints [PR104775]
  2022-03-05  8:33 [PATCH] s390: Fix up *cmp_and_trap_unsigned_int<mode> constraints [PR104775] Jakub Jelinek
  2022-03-06  9:15 ` Jakub Jelinek
@ 2022-03-07 10:10 ` Andreas Krebbel
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Krebbel @ 2022-03-07 10:10 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On 3/5/22 09:33, Jakub Jelinek wrote:
> Hi!
> 
> The following testcase fails to assemble due to clgte %r6,0(%r1,%r10)
> insn not being accepted by assembler.
> My rough understanding is that in the RSY-b insn format the spot
> in other formats used for index registers is used instead for M3 what
> kind of comparison it is, so this patch follows what other similar
> instructions use for constraint (i.e. one without index register).
> 
> Bootstrapped on s390x-linux, regtest there still pending, ok for
> trunk if it passes it?
> 
> 2022-03-05  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/104775
> 	* config/s390/s390.md (*cmp_and_trap_unsigned_int<mode>): Use
> 	S constraint instead of T in the last alternative.
> 
> 	* gcc.target/s390/pr104775.c: New test.

Ok. Thanks for the fix!

Bye,

Andreas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-07 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-05  8:33 [PATCH] s390: Fix up *cmp_and_trap_unsigned_int<mode> constraints [PR104775] Jakub Jelinek
2022-03-06  9:15 ` Jakub Jelinek
2022-03-07 10:10 ` Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).