Commit 57f5eef0 by Richard Earnshaw

[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
parent 4003023f
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> 2009-11-04 Nick Clifton <nickc@redhat.com>
* defaults.h (CONSTANT_ADDRESS_P): Provide a default definition. * defaults.h (CONSTANT_ADDRESS_P): Provide a default definition.
...@@ -6770,6 +6770,7 @@ ...@@ -6770,6 +6770,7 @@
(const_int 6) (const_int 6)
(const_int 8))))] (const_int 8))))]
) )
(define_insn "*movsi_cbranchsi4" (define_insn "*movsi_cbranchsi4"
[(set (pc) [(set (pc)
(if_then_else (if_then_else
...@@ -6833,6 +6834,45 @@ ...@@ -6833,6 +6834,45 @@
(const_int 10)))))] (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" (define_insn "*negated_cbranchsi4"
[(set (pc) [(set (pc)
(if_then_else (if_then_else
......
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> 2009-11-04 Revital Eres <eres@il.ibm.com>
* gcc.target/powerpc/vsx-vectorize-3.c: Adjust tetcase following * gcc.target/powerpc/vsx-vectorize-3.c: Adjust tetcase following
......
/* { 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);
}
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