[multiple changes]

2009-11-04  Richard Earnshaw  <rearnsha@arm.com>

	PR target/40835
	* arm.md (peephole2 patterns for move and compare): New.

2009-11-04  Wei Guozhi  <carrot@google.com>

	PR target/40835
	* gcc.target/arm/pr40835: New testcase.

From-SVN: r153895
This commit is contained in:
Richard Earnshaw 2009-11-04 14:09:55 +00:00
parent 4003023f9d
commit 57f5eef091
4 changed files with 105 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2009-11-04 Richard Earnshaw <rearnsha@arm.com>
PR target/40835
* arm.md (peephole2 patterns for move and compare): New.
2009-11-04 Nick Clifton <nickc@redhat.com>
* defaults.h (CONSTANT_ADDRESS_P): Provide a default definition.

View file

@ -6770,6 +6770,7 @@
(const_int 6)
(const_int 8))))]
)
(define_insn "*movsi_cbranchsi4"
[(set (pc)
(if_then_else
@ -6833,6 +6834,45 @@
(const_int 10)))))]
)
(define_peephole2
[(set (match_operand:SI 0 "low_register_operand" "")
(match_operand:SI 1 "low_register_operand" ""))
(set (pc)
(if_then_else (match_operator 2 "arm_comparison_operator"
[(match_dup 1) (const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
"TARGET_THUMB1"
[(parallel
[(set (pc)
(if_then_else (match_op_dup 2 [(match_dup 1) (const_int 0)])
(label_ref (match_dup 3))
(pc)))
(set (match_dup 0) (match_dup 1))])]
""
)
;; Sigh! This variant shouldn't be needed, but combine often fails to
;; merge cases like this because the op1 is a hard register in
;; CLASS_LIKELY_SPILLED_P.
(define_peephole2
[(set (match_operand:SI 0 "low_register_operand" "")
(match_operand:SI 1 "low_register_operand" ""))
(set (pc)
(if_then_else (match_operator 2 "arm_comparison_operator"
[(match_dup 0) (const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
"TARGET_THUMB1"
[(parallel
[(set (pc)
(if_then_else (match_op_dup 2 [(match_dup 1) (const_int 0)])
(label_ref (match_dup 3))
(pc)))
(set (match_dup 0) (match_dup 1))])]
""
)
(define_insn "*negated_cbranchsi4"
[(set (pc)
(if_then_else

View file

@ -1,3 +1,8 @@
2009-11-04 Wei Guozhi <carrot@google.com>
PR target/40835
* gcc.target/arm/pr40835: New testcase.
2009-11-04 Revital Eres <eres@il.ibm.com>
* gcc.target/powerpc/vsx-vectorize-3.c: Adjust tetcase following

View file

@ -0,0 +1,55 @@
/* { dg-options "-mthumb -Os -march=armv5te" } */
/* { dg-final { scan-assembler-not "cmp" } } */
int bar();
void goo(int, int);
void eq()
{
int v = bar();
if (v == 0)
return;
goo(1, v);
}
void ge()
{
int v = bar();
if (v >= 0)
return;
goo(1, v);
}
void gt()
{
int v = bar();
if (v > 0)
return;
goo(1, v);
}
void lt()
{
int v = bar();
if (v < 0)
return;
goo(1, v);
}
void le()
{
int v = bar();
if (v <= 0)
return;
goo(1, v);
}
unsigned int foo();
void leu()
{
unsigned int v = foo();
if (v <= 0)
return;
goo(1, v);
}