From: Stefan Schulze Frielinghaus Date: Wed, 25 Oct 2023 09:18:14 +0000 (+0200) Subject: s390: Fix constraint for insn *cmphi_ccu X-Git-Tag: basepoints/gcc-15~4270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74a7bb2c508200651451af04ea81f1d7d0856e5d;p=thirdparty%2Fgcc.git s390: Fix constraint for insn *cmphi_ccu Currently for an unsigned 16-bit comparison between memory and an immediate where the high bit is set, a clc is emitted. This is because the constant is created for mode HI and therefore sign extended. This means constraint D does not hold anymore. Since the mode already restricts the immediate to 16 bit, it is enough to make use of constraint n and chop of the high bits in the output template. gcc/ChangeLog: * config/s390/s390.md (*cmphi_ccu): For immediate operand 1 make use of constraint n instead of D and chop of high bits in the output template. --- diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index e30795a00ab1..685bb288b088 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1356,13 +1356,13 @@ (define_insn "*cmphi_ccu" [(set (reg CC_REGNUM) (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,Q,BQ") - (match_operand:HI 1 "general_operand" "Q,S,D,BQ,Q")))] + (match_operand:HI 1 "general_operand" "Q,S,n,BQ,Q")))] "s390_match_ccmode (insn, CCUmode) && !register_operand (operands[1], HImode)" "@ clm\t%0,3,%S1 clmy\t%0,3,%S1 - clhhsi\t%0,%1 + clhhsi\t%0,%x1 # #" [(set_attr "op_type" "RS,RSY,SIL,SS,SS")