[committed] Use right shifts to eliminate redundant test/compare insns on the H8

Jeff Law jlaw@tachyum.com
Fri Jun 25 13:25:48 GMT 2021


Now we're moving on to the shifts/rotate patterns for redundant 
test/compare removal.  The first patch is trivial and just adds support 
into select_cc_mode for the right shifts which were missing.  This only 
helps the H8/SX as it's the only variant currently supporting using 
shifts to eliminate redundant test/compare insns, but it'll be needed 
for the other H8 variants soon enough.

This has gone through the usual ~24hr test cycle.  Committing to the trunk.

Jeff
-------------- next part --------------
commit 3a50aed09edc5e69080a0e49851acdb874227256
Author: Jeff Law <jeffreyalaw@gmail.com>
Date:   Fri Jun 25 09:22:28 2021 -0400

    Use right shifts to eliminate redundant test/compare insns on the H8
    
    gcc/
            * config/h8300/h8300.c (select_cc_mode): Handle ASHIFTRT and LSHIFTRT.

diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 511c2b28e40..d8b4bfcbdbe 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -1947,9 +1947,10 @@ h8300_select_cc_mode (enum rtx_code cond, rtx op0, rtx op1)
   if (op1 == const0_rtx
       && (cond == EQ || cond == NE || cond == LT || cond == GE)
       && (GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
-          || GET_CODE (op0) == NEG || GET_CODE (op0) == AND
-          || GET_CODE (op0) == IOR || GET_CODE (op0) == XOR
-          || GET_CODE (op0) == NOT || GET_CODE (op0) == ASHIFT
+	  || GET_CODE (op0) == NEG || GET_CODE (op0) == AND
+	  || GET_CODE (op0) == IOR || GET_CODE (op0) == XOR
+	  || GET_CODE (op0) == NOT || GET_CODE (op0) == ASHIFT
+	  || GET_CODE (op0) == ASHIFTRT || GET_CODE (op0) == LSHIFTRT
 	  || GET_CODE (op0) == MULT || GET_CODE (op0) == SYMBOL_REF
 	  || GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op0) == ZERO_EXTEND
 	  || REG_P (op0) || MEM_P (op0)))


More information about the Gcc-patches mailing list