Commit 265c835f by Richard Henderson Committed by Richard Henderson

rx: Cleanup non-VOIDmode SETs.

SET should always have VOIDmode.  A number of places used
SImode or QImode for the mode of the SET rtx itself.

From-SVN: r168925
parent b4d83be3
2011-01-17 Richard Henderson <rth@redhat.com>
* config/rx/rx.c (gen_rx_store_vector): Use VOIDmode for gen_rtx_SET.
(gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise.
* config/rx/rx.md (pop_and_return): Use VOIDmode for SET.
(stack_push, stack_pushm, stack_pop, stack_popm): Likewise.
(bitset, bitset_in_memory): Likewise.
(bitinvert, bitinvert_in_memory): Likewise.
(bitclr, bitclr_in_memory): Likewise.
(insv, sync_lock_test_and_setsi, movstr, rx_movstr): Likewise.
(rx_strend, rx_cmpstrn): Likewise.
(rx_setmem): Likewise. Make the source BLKmode to match the dest.
(bitop peep2 patterns): Remove.
* config/rx/rx.c (rx_match_ccmode): New.
* config/rx/rx-protos.h: Update.
* config/rx/rx.md (abssi2): Clobber, don't set flags.
......
......@@ -1249,13 +1249,13 @@ gen_rx_store_vector (unsigned int low, unsigned int high)
vector = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
XVECEXP (vector, 0, 0) =
gen_rtx_SET (SImode, stack_pointer_rtx,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
gen_rtx_MINUS (SImode, stack_pointer_rtx,
GEN_INT ((count - 1) * UNITS_PER_WORD)));
for (i = 0; i < count - 1; i++)
XVECEXP (vector, 0, i + 1) =
gen_rtx_SET (SImode,
gen_rtx_SET (VOIDmode,
gen_rtx_MEM (SImode,
gen_rtx_MINUS (SImode, stack_pointer_rtx,
GEN_INT ((i + 1) * UNITS_PER_WORD))),
......@@ -1479,12 +1479,12 @@ gen_rx_rtsd_vector (unsigned int adjust, unsigned int low, unsigned int high)
vector = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
XVECEXP (vector, 0, 0) =
gen_rtx_SET (SImode, stack_pointer_rtx,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
plus_constant (stack_pointer_rtx, adjust));
for (i = 0; i < count - 2; i++)
XVECEXP (vector, 0, i + 1) =
gen_rtx_SET (SImode,
gen_rtx_SET (VOIDmode,
gen_rtx_REG (SImode, low + i),
gen_rtx_MEM (SImode,
i == 0 ? stack_pointer_rtx
......@@ -1508,13 +1508,13 @@ gen_rx_popm_vector (unsigned int low, unsigned int high)
vector = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
XVECEXP (vector, 0, 0) =
gen_rtx_SET (SImode, stack_pointer_rtx,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
plus_constant (stack_pointer_rtx,
(count - 1) * UNITS_PER_WORD));
for (i = 0; i < count - 1; i++)
XVECEXP (vector, 0, i + 1) =
gen_rtx_SET (SImode,
gen_rtx_SET (VOIDmode,
gen_rtx_REG (SImode, low + i),
gen_rtx_MEM (SImode,
i == 0 ? stack_pointer_rtx
......
......@@ -429,7 +429,7 @@
(define_insn "pop_and_return"
[(match_parallel 1 "rx_rtsd_vector"
[(set:SI (reg:SI SP_REG)
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(match_operand:SI 0 "const_int_operand" "n")))])]
"reload_completed"
......@@ -656,10 +656,10 @@
)
(define_insn "stack_push"
[(set:SI (reg:SI SP_REG)
[(set (reg:SI SP_REG)
(minus:SI (reg:SI SP_REG)
(const_int 4)))
(set:SI (mem:SI (reg:SI SP_REG))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 0 "register_operand" "r"))]
""
"push.l\t%0"
......@@ -668,7 +668,7 @@
(define_insn "stack_pushm"
[(match_parallel 1 "rx_store_multiple_vector"
[(set:SI (reg:SI SP_REG)
[(set (reg:SI SP_REG)
(minus:SI (reg:SI SP_REG)
(match_operand:SI 0 "const_int_operand" "n")))])]
"reload_completed"
......@@ -681,9 +681,9 @@
)
(define_insn "stack_pop"
[(set:SI (match_operand:SI 0 "register_operand" "=r")
[(set (match_operand:SI 0 "register_operand" "=r")
(mem:SI (reg:SI SP_REG)))
(set:SI (reg:SI SP_REG)
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(const_int 4)))]
""
......@@ -694,7 +694,7 @@
(define_insn "stack_popm"
[(match_parallel 1 "rx_load_multiple_vector"
[(set:SI (reg:SI SP_REG)
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(match_operand:SI 0 "const_int_operand" "n")))])]
"reload_completed"
......@@ -1525,7 +1525,7 @@
;; of three instructions at a time.
(define_insn "bitset"
[(set:SI (match_operand:SI 0 "register_operand" "=r")
[(set (match_operand:SI 0 "register_operand" "=r")
(ior:SI (match_operand:SI 1 "register_operand" "0")
(ashift:SI (const_int 1)
(match_operand:SI 2 "nonmemory_operand" "ri"))))]
......@@ -1535,7 +1535,7 @@
)
(define_insn "bitset_in_memory"
[(set:QI (match_operand:QI 0 "memory_operand" "=m")
[(set (match_operand:QI 0 "memory_operand" "=m")
(ior:QI (match_operand:QI 1 "memory_operand" "0")
(ashift:QI (const_int 1)
(match_operand:QI 2 "nonmemory_operand" "ri"))))]
......@@ -1545,48 +1545,8 @@
(set_attr "timings" "34")]
)
;; (set (reg A) (const_int 1))
;; (set (reg A) (ashift (reg A) (reg B)))
;; (set (reg C) (ior (reg A) (reg C)))
(define_peephole2
[(set:SI (match_operand:SI 0 "register_operand" "")
(const_int 1))
(set:SI (match_dup 0)
(ashift:SI (match_dup 0)
(match_operand:SI 1 "register_operand" "")))
(set:SI (match_operand:SI 2 "register_operand" "")
(ior:SI (match_dup 0)
(match_dup 2)))]
"dead_or_set_p (insn, operands[0])"
[(set:SI (match_dup 2)
(ior:SI (match_dup 2)
(ashift:SI (const_int 1)
(match_dup 1))))]
)
;; (set (reg A) (const_int 1))
;; (set (reg A) (ashift (reg A) (reg B)))
;; (set (reg A) (ior (reg A) (reg C)))
;; (set (reg C) (reg A)
(define_peephole2
[(set:SI (match_operand:SI 0 "register_operand" "")
(const_int 1))
(set:SI (match_dup 0)
(ashift:SI (match_dup 0)
(match_operand:SI 1 "register_operand" "")))
(set:SI (match_dup 0)
(ior:SI (match_dup 0)
(match_operand:SI 2 "register_operand" "")))
(set:SI (match_dup 2) (match_dup 0))]
"dead_or_set_p (insn, operands[0])"
[(set:SI (match_dup 2)
(ior:SI (match_dup 2)
(ashift:SI (const_int 1)
(match_dup 1))))]
)
(define_insn "bitinvert"
[(set:SI (match_operand:SI 0 "register_operand" "+r")
[(set (match_operand:SI 0 "register_operand" "+r")
(xor:SI (match_operand:SI 1 "register_operand" "0")
(ashift:SI (const_int 1)
(match_operand:SI 2 "nonmemory_operand" "ri"))))]
......@@ -1596,7 +1556,7 @@
)
(define_insn "bitinvert_in_memory"
[(set:QI (match_operand:QI 0 "memory_operand" "+m")
[(set (match_operand:QI 0 "memory_operand" "+m")
(xor:QI (match_operand:QI 1 "register_operand" "0")
(ashift:QI (const_int 1)
(match_operand:QI 2 "nonmemory_operand" "ri"))))]
......@@ -1606,52 +1566,12 @@
(set_attr "timings" "33")]
)
;; (set (reg A) (const_int 1))
;; (set (reg A) (ashift (reg A) (reg B)))
;; (set (reg C) (xor (reg A) (reg C)))
(define_peephole2
[(set:SI (match_operand:SI 0 "register_operand" "")
(const_int 1))
(set:SI (match_dup 0)
(ashift:SI (match_dup 0)
(match_operand:SI 1 "register_operand" "")))
(set:SI (match_operand:SI 2 "register_operand" "")
(xor:SI (match_dup 0)
(match_dup 2)))]
"dead_or_set_p (insn, operands[0])"
[(set:SI (match_dup 2)
(xor:SI (match_dup 2)
(ashift:SI (const_int 1)
(match_dup 1))))]
""
)
;; (set (reg A) (const_int 1))
;; (set (reg A) (ashift (reg A) (reg B)))
;; (set (reg A) (xor (reg A) (reg C)))
;; (set (reg C) (reg A))
(define_peephole2
[(set:SI (match_operand:SI 0 "register_operand" "")
(const_int 1))
(set:SI (match_dup 0)
(ashift:SI (match_dup 0)
(match_operand:SI 1 "register_operand" "")))
(set:SI (match_dup 0)
(xor:SI (match_dup 0)
(match_operand:SI 2 "register_operand" "")))
(set:SI (match_dup 2) (match_dup 0))]
"dead_or_set_p (insn, operands[0])"
[(set:SI (match_dup 2)
(xor:SI (match_dup 2)
(ashift:SI (const_int 1)
(match_dup 1))))]
""
)
(define_insn "bitclr"
[(set:SI (match_operand:SI 0 "register_operand" "=r")
[(set (match_operand:SI 0 "register_operand" "=r")
(and:SI (match_operand:SI 1 "register_operand" "0")
(not:SI (ashift:SI (const_int 1)
(not:SI
(ashift:SI
(const_int 1)
(match_operand:SI 2 "nonmemory_operand" "ri")))))]
""
"bclr\t%2, %0"
......@@ -1659,9 +1579,11 @@
)
(define_insn "bitclr_in_memory"
[(set:QI (match_operand:QI 0 "memory_operand" "=m")
[(set (match_operand:QI 0 "memory_operand" "=m")
(and:QI (match_operand:QI 1 "memory_operand" "0")
(not:QI (ashift:QI (const_int 1)
(not:QI
(ashift:QI
(const_int 1)
(match_operand:QI 2 "nonmemory_operand" "ri")))))]
""
"bclr\t%2, %0.B"
......@@ -1669,48 +1591,8 @@
(set_attr "timings" "34")]
)
;; (set (reg A) (const_int -2))
;; (set (reg A) (rotate (reg A) (reg B)))
;; (set (reg C) (and (reg A) (reg C)))
(define_peephole2
[(set:SI (match_operand:SI 0 "register_operand" "")
(const_int -2))
(set:SI (match_dup 0)
(rotate:SI (match_dup 0)
(match_operand:SI 1 "register_operand" "")))
(set:SI (match_operand:SI 2 "register_operand" "")
(and:SI (match_dup 0)
(match_dup 2)))]
"dead_or_set_p (insn, operands[0])"
[(set:SI (match_dup 2)
(and:SI (match_dup 2)
(not:SI (ashift:SI (const_int 1)
(match_dup 1)))))]
)
;; (set (reg A) (const_int -2))
;; (set (reg A) (rotate (reg A) (reg B)))
;; (set (reg A) (and (reg A) (reg C)))
;; (set (reg C) (reg A)
(define_peephole2
[(set:SI (match_operand:SI 0 "register_operand" "")
(const_int -2))
(set:SI (match_dup 0)
(rotate:SI (match_dup 0)
(match_operand:SI 1 "register_operand" "")))
(set:SI (match_dup 0)
(and:SI (match_dup 0)
(match_operand:SI 2 "register_operand" "")))
(set:SI (match_dup 2) (match_dup 0))]
"dead_or_set_p (insn, operands[0])"
[(set:SI (match_dup 2)
(and:SI (match_dup 2)
(not:SI (ashift:SI (const_int 1)
(match_dup 1)))))]
)
(define_expand "insv"
[(set:SI (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand") ;; Destination
[(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand") ;; Destination
(match_operand 1 "immediate_operand") ;; # of bits to set
(match_operand 2 "immediate_operand")) ;; Starting bit
(match_operand 3 "immediate_operand"))] ;; Bits to insert
......@@ -1725,9 +1607,9 @@
;; Atomic exchange operation.
(define_insn "sync_lock_test_and_setsi"
[(set:SI (match_operand:SI 0 "register_operand" "=r,r")
[(set (match_operand:SI 0 "register_operand" "=r,r")
(match_operand:SI 1 "rx_compare_operand" "=r,Q"))
(set:SI (match_dup 1)
(set (match_dup 1)
(match_operand:SI 2 "register_operand" "0,0"))]
""
"xchg\t%1, %0"
......@@ -1738,7 +1620,7 @@
;; Block move functions.
(define_expand "movstr"
[(set:SI (match_operand:BLK 1 "memory_operand") ;; Dest
[(set (match_operand:BLK 1 "memory_operand") ;; Dest
(match_operand:BLK 2 "memory_operand")) ;; Source
(use (match_operand:SI 0 "register_operand")) ;; Updated Dest
]
......@@ -1763,7 +1645,7 @@
)
(define_insn "rx_movstr"
[(set:SI (mem:BLK (reg:SI 1))
[(set (mem:BLK (reg:SI 1))
(mem:BLK (reg:SI 2)))
(unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVSTR)
(clobber (reg:SI 1))
......@@ -1776,7 +1658,7 @@
)
(define_insn "rx_strend"
[(set:SI (match_operand:SI 0 "register_operand" "=r")
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
(reg:SI 3)] UNSPEC_STRLEN))
(clobber (reg:SI 1))
......@@ -1858,8 +1740,8 @@
)
(define_insn "rx_setmem"
[(set:BLK (mem:BLK (reg:SI 1)) (reg 2))
(unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_SETMEM)
[(set (mem:BLK (reg:SI 1))
(unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_SETMEM))
(clobber (reg:SI 1))
(clobber (reg:SI 3))]
""
......@@ -1912,7 +1794,7 @@
)
(define_insn "rx_cmpstrn"
[(set:SI (match_operand:SI 0 "register_operand" "=r")
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec_volatile:SI [(reg:SI 1) (reg:SI 2) (reg:SI 3)]
UNSPEC_CMPSTRN))
(use (match_operand:BLK 1 "memory_operand" "m"))
......
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