Commit 2c8798a2 by Richard Sandiford Committed by Richard Sandiford

rtlanal.c (canonicalize_condition): Split out duplicated mode check.

gcc/
	* rtlanal.c (canonicalize_condition): Split out duplicated mode check.
	Handle XOR.

gcc/testsuite/
	* gcc.dg/unroll_1.c: Add -fenable-rtl-loop2.

From-SVN: r207076
parent 746cd719
2014-01-25 Richard Sandiford <rdsandiford@googlemail.com>
* rtlanal.c (canonicalize_condition): Split out duplicated mode check.
Handle XOR.
2014-01-25 Jakub Jelinek <jakub@redhat.com> 2014-01-25 Jakub Jelinek <jakub@redhat.com>
* print-rtl.c (in_call_function_usage): New var. * print-rtl.c (in_call_function_usage): New var.
......
...@@ -5051,23 +5051,24 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest, ...@@ -5051,23 +5051,24 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
??? This mode check should perhaps look more like the mode check ??? This mode check should perhaps look more like the mode check
in simplify_comparison in combine. */ in simplify_comparison in combine. */
if (((GET_MODE_CLASS (mode) == MODE_CC)
if ((GET_CODE (SET_SRC (set)) == COMPARE != (GET_MODE_CLASS (inner_mode) == MODE_CC))
|| (((code == NE && mode != VOIDmode
|| (code == LT && inner_mode != VOIDmode)
&& val_signbit_known_set_p (inner_mode, break;
STORE_FLAG_VALUE)) if (GET_CODE (SET_SRC (set)) == COMPARE
|| (((code == NE
|| (code == LT
&& val_signbit_known_set_p (inner_mode,
STORE_FLAG_VALUE))
#ifdef FLOAT_STORE_FLAG_VALUE #ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT || (code == LT
&& SCALAR_FLOAT_MODE_P (inner_mode) && SCALAR_FLOAT_MODE_P (inner_mode)
&& (fsfv = FLOAT_STORE_FLAG_VALUE (inner_mode), && (fsfv = FLOAT_STORE_FLAG_VALUE (inner_mode),
REAL_VALUE_NEGATIVE (fsfv))) REAL_VALUE_NEGATIVE (fsfv)))
#endif #endif
)) ))
&& COMPARISON_P (SET_SRC (set)))) && COMPARISON_P (SET_SRC (set))))
&& (((GET_MODE_CLASS (mode) == MODE_CC)
== (GET_MODE_CLASS (inner_mode) == MODE_CC))
|| mode == VOIDmode || inner_mode == VOIDmode))
x = SET_SRC (set); x = SET_SRC (set);
else if (((code == EQ else if (((code == EQ
|| (code == GE || (code == GE
...@@ -5080,15 +5081,25 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest, ...@@ -5080,15 +5081,25 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
REAL_VALUE_NEGATIVE (fsfv))) REAL_VALUE_NEGATIVE (fsfv)))
#endif #endif
)) ))
&& COMPARISON_P (SET_SRC (set)) && COMPARISON_P (SET_SRC (set)))
&& (((GET_MODE_CLASS (mode) == MODE_CC)
== (GET_MODE_CLASS (inner_mode) == MODE_CC))
|| mode == VOIDmode || inner_mode == VOIDmode))
{ {
reverse_code = 1; reverse_code = 1;
x = SET_SRC (set); x = SET_SRC (set);
} }
else if ((code == EQ || code == NE)
&& GET_CODE (SET_SRC (set)) == XOR)
/* Handle sequences like:
(set op0 (xor X Y))
...(eq|ne op0 (const_int 0))...
in which case:
(eq op0 (const_int 0)) reduces to (eq X Y)
(ne op0 (const_int 0)) reduces to (ne X Y)
This is the form used by MIPS16, for example. */
x = SET_SRC (set);
else else
break; break;
} }
......
2014-01-25 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.dg/unroll_1.c: Add -fenable-rtl-loop2.
2014-01-25 Bernd Edlinger <bernd.edlinger@hotmail.de> 2014-01-25 Bernd Edlinger <bernd.edlinger@hotmail.de>
* gcc.dg/vect/vect-nop-move.c (main): Check for vect runtime. * gcc.dg/vect/vect-nop-move.c (main): Check for vect runtime.
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-rtl-loop2_unroll=stderr -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fdisable-tree-cunrolli -fenable-rtl-loop2_unroll" } */ /* { dg-options "-O2 -fdump-rtl-loop2_unroll=stderr -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fdisable-tree-cunrolli -fenable-rtl-loop2 -fenable-rtl-loop2_unroll" } */
unsigned a[100], b[100]; unsigned a[100], b[100];
inline void bar() inline void bar()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment