re PR rtl-optimization/10588 ([PPC] i==0||j==0 should use cntlzw and srawi)

* config/rs6000/rs6000.md (call_indirect_nonlocal_aix32): Prefer
	CTR to LR.
	(call_indirect_nonlocal_aix64): Same.
	(call_value_indirect_nonlocal_aix32): Same.
	(call_value_indirect_nonlocal_aix64): Same.

	PR target/10588
	(eq): Use CLZ splitter for compare with zero.

From-SVN: r100759
This commit is contained in:
David Edelsohn 2005-06-08 14:46:09 +00:00 committed by David Edelsohn
parent 625b02b215
commit 70ae01917f
2 changed files with 66 additions and 20 deletions

View File

@ -1,3 +1,14 @@
2005-06-08 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.md (call_indirect_nonlocal_aix32): Prefer
CTR to LR.
(call_indirect_nonlocal_aix64): Same.
(call_value_indirect_nonlocal_aix32): Same.
(call_value_indirect_nonlocal_aix64): Same.
PR target/10588
(eq): Use CLZ splitter for compare with zero.
2005-06-08 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.c (bfin_return_in_memory): Simplify; return

View File

@ -10247,13 +10247,13 @@
;; and < 0 if they were not.
(define_insn "*call_indirect_nonlocal_aix32"
[(call (mem:SI (match_operand:SI 0 "register_operand" "cl"))
(match_operand 1 "" "g"))
[(call (mem:SI (match_operand:SI 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
(use (reg:SI 2))
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (match_scratch:SI 2 "=l"))]
(clobber (match_scratch:SI 2 "=l,l"))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"b%T0l\;{l|lwz} 2,20(1)"
[(set_attr "type" "jmpreg")
@ -10272,13 +10272,13 @@
(set_attr "length" "8")])
(define_insn "*call_indirect_nonlocal_aix64"
[(call (mem:SI (match_operand:DI 0 "register_operand" "cl"))
(match_operand 1 "" "g"))
[(call (mem:SI (match_operand:DI 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
(use (reg:DI 2))
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (match_scratch:SI 2 "=l"))]
(clobber (match_scratch:SI 2 "=l,l"))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"b%T0l\;ld 2,40(1)"
[(set_attr "type" "jmpreg")
@ -10298,13 +10298,13 @@
(define_insn "*call_value_indirect_nonlocal_aix32"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "register_operand" "cl"))
(match_operand 2 "" "g")))
(call (mem:SI (match_operand:SI 1 "register_operand" "c,*l"))
(match_operand 2 "" "g,g")))
(use (reg:SI 2))
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (match_scratch:SI 3 "=l"))]
(clobber (match_scratch:SI 3 "=l,l"))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"b%T1l\;{l|lwz} 2,20(1)"
[(set_attr "type" "jmpreg")
@ -10325,13 +10325,13 @@
(define_insn "*call_value_indirect_nonlocal_aix64"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "cl"))
(match_operand 2 "" "g")))
(call (mem:SI (match_operand:DI 1 "register_operand" "c,*l"))
(match_operand 2 "" "g,g")))
(use (reg:DI 2))
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (match_scratch:SI 3 "=l"))]
(clobber (match_scratch:SI 3 "=l,l"))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"b%T1l\;ld 2,40(1)"
[(set_attr "type" "jmpreg")
@ -11472,11 +11472,11 @@
[(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
(eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
(match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I")))
(clobber (match_scratch:SI 3 "=r,&r,r,r,r"))]
(clobber (match_scratch:SI 3 "=r,X,r,r,r"))]
"TARGET_32BIT"
"@
xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
{sfi|subfic} %3,%1,0\;{ae|adde} %0,%3,%1
#
{xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
{xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
{sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0"
@ -11487,17 +11487,31 @@
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
(eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
(match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
(clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
(clobber (match_scratch:DI 3 "=r,X,r,r,r"))]
"TARGET_64BIT"
"@
xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0
subfic %3,%1,0\;adde %0,%3,%1
#
xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0
xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0
subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0"
[(set_attr "type" "three,two,three,three,three")
(set_attr "length" "12,8,12,12,12")])
(define_split
[(set (match_operand:GPR 0 "gpc_reg_operand" "")
(eq:GPR (match_operand:GPR 1 "gpc_reg_operand" "")
(match_operand:GPR 2 "zero_constant" "")))
(clobber (match_scratch:GPR 3 ""))]
""
[(set (match_dup 0)
(clz:GPR (match_dup 1)))
(set (match_dup 0)
(lshiftrt:GPR (match_dup 0) (match_dup 4)))]
{
operands[4] = GEN_INT (exact_log2 (GET_MODE_BITSIZE (<MODE>mode)));
})
(define_insn ""
[(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
(compare:CC
@ -11506,11 +11520,11 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
(eq:SI (match_dup 1) (match_dup 2)))
(clobber (match_scratch:SI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
(clobber (match_scratch:SI 3 "=r,X,r,r,r,r,X,r,r,r"))]
"TARGET_32BIT"
"@
xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
{sfi|subfic} %3,%1,0\;{ae.|adde.} %0,%3,%1
#
{xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
{xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
{sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
@ -11548,11 +11562,11 @@
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
(eq:DI (match_dup 1) (match_dup 2)))
(clobber (match_scratch:DI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
(clobber (match_scratch:DI 3 "=r,X,r,r,r,r,X,r,r,r"))]
"TARGET_64BIT"
"@
xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
subfic %3,%1,0\;adde. %0,%3,%1
#
xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0
xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0
subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
@ -11582,6 +11596,27 @@
(const_int 0)))]
"")
(define_split
[(set (match_operand:CC 4 "cc_reg_operand" "")
(compare:CC
(eq:GPR (match_operand:GPR 1 "gpc_reg_operand" "")
(match_operand:GPR 2 "zero_constant" ""))
(const_int 0)))
(set (match_operand:GPR 0 "gpc_reg_operand" "")
(eq:GPR (match_dup 1) (match_dup 2)))
(clobber (match_scratch:GPR 3 ""))]
""
[(set (match_dup 0)
(clz:GPR (match_dup 1)))
(parallel [(set (match_dup 4)
(compare:CC (lshiftrt:GPR (match_dup 0) (match_dup 5))
(const_int 0)))
(set (match_dup 0)
(lshiftrt:GPR (match_dup 0) (match_dup 5)))])]
{
operands[5] = GEN_INT (exact_log2 (GET_MODE_BITSIZE (<MODE>mode)));
})
;; We have insns of the form shown by the first define_insn below. If
;; there is something inside the comparison operation, we must split it.
(define_split