This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH ARM/Thumb] PR 14812 fix corner cases withnegate-and-compare


On Sun, 2005-04-03 at 15:54, Richard Earnshaw wrote:

> 2005-04-03  Richard Earnshaw  <richard.earnshaw@arm.com>
> 
> 	PR target/14812
> 	* arm.md (addsi3_compare0_for_combiner): Delete.
> 	(addsi3_compare0_scratch_for_combiner): Delete.
> 	(cmpsi_neg_shiftsi): Delete.
> 	(compare_negsi_si): New pattern.
> 	(cmpsi_negshiftsi_si): New pattern.
> 	(negated_cbranchsi4): Restrict to equality_operator.
> 	
> 	* arm.md (movhi_insn_arch4): delete trailing white space from assembler
> 	template.

Whoops.  I forgot one of the files when committing this patch. 
Fortunately it would have not resulted in bad code, the effect of
omitting this change is that the new patterns would simply not match.

R.

2005-04-04  Richard Earnshaw  <richard.earnshaw@arm.com>
	PR target/14812
	* arm.c (arm_select_cc_mode): Return CC_Zmode when comparing against
	a negated value.


Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.434
diff -p -r1.434 arm.c
*** config/arm/arm.c	1 Apr 2005 15:59:06 -0000	1.434
--- config/arm/arm.c	4 Apr 2005 10:49:21 -0000
*************** arm_select_cc_mode (enum rtx_code op, rt
*** 6100,6105 ****
--- 6100,6112 ----
  	  || GET_CODE (x) == ROTATERT))
      return CC_SWPmode;
  
+   /* This operation is performed swapped, but since we only rely on the Z
+      flag we don't need an additional mode.  */
+   if (GET_MODE (y) == SImode && REG_P (y)
+       && GET_CODE (x) == NEG
+       && (op ==	EQ || op == NE))
+     return CC_Zmode;
+ 
    /* This is a special case that is used by combine to allow a
       comparison of a shifted byte load to be split into a zero-extend
       followed by a comparison of the shifted integer (only valid for

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]