Commit 8894cf34 by Jim Wilson

(truncdisi2): Change from define_expand to define_insn.

(truncdihi2, truncdiqi2): Likewise.

From-SVN: r8055
parent d6f7c0fe
...@@ -1945,49 +1945,37 @@ move\\t%0,%z4\\n\\ ...@@ -1945,49 +1945,37 @@ move\\t%0,%z4\\n\\
(set_attr "mode" "SF") (set_attr "mode" "SF")
(set_attr "length" "1")]) (set_attr "length" "1")])
;; ??? This should be a define expand.
;; The optimizer doesn't deal well with truncate operators, so we completely ;; See the zero_extendsidi2 pattern.
;; avoid them by using define expands here. ;; ??? We tried define expands, but they did not work. Too many shift
;; instructions were optimized away. Perhaps add combiner patterns to
(define_expand "truncdisi2" ;; recognize cases where shifts and truncates can be combined.
[(set (match_operand:DI 2 "register_operand" "=d") (define_insn "truncdisi2"
(ashift:DI (match_operand:DI 1 "register_operand" "d") [(set (match_operand:SI 0 "register_operand" "=d")
(const_int 32))) (truncate:SI (match_operand:DI 1 "register_operand" "d")))]
(set (match_operand:DI 3 "register_operand" "=d")
(ashiftrt:DI (match_dup 2)
(const_int 32)))
(set (match_operand:SI 0 "register_operand" "=d")
(subreg:SI (match_dup 3) 0))]
"TARGET_64BIT" "TARGET_64BIT"
" "dsll\\t%0,%1,32\;dsra\\t%0,%0,32"
{ [(set_attr "type" "darith")
operands[2] = gen_reg_rtx (DImode); (set_attr "mode" "SI")
operands[3] = gen_reg_rtx (DImode); (set_attr "length" "2")])
}")
(define_expand "truncdihi2" (define_insn "truncdihi2"
[(set (match_operand:DI 2 "register_operand" "=d") [(set (match_operand:HI 0 "register_operand" "=d")
(and:DI (match_operand:DI 1 "register_operand" "d") (truncate:HI (match_operand:DI 1 "register_operand" "d")))]
(const_int 65535)))
(set (match_operand:HI 0 "register_operand" "=d")
(subreg:HI (match_dup 2) 0))]
"TARGET_64BIT" "TARGET_64BIT"
" "andi\\t%0,%1,0xffff"
{ [(set_attr "type" "darith")
operands[2] = gen_reg_rtx (DImode); (set_attr "mode" "HI")
}") (set_attr "length" "1")])
(define_expand "truncdiqi2" (define_insn "truncdiqi2"
[(set (match_operand:DI 2 "register_operand" "=d") [(set (match_operand:QI 0 "register_operand" "=d")
(and:DI (match_operand:DI 1 "register_operand" "d") (truncate:QI (match_operand:DI 1 "register_operand" "d")))]
(const_int 255)))
(set (match_operand:QI 0 "register_operand" "=d")
(subreg:QI (match_dup 2) 0))]
"TARGET_64BIT" "TARGET_64BIT"
" "andi\\t%0,%1,0x00ff"
{ [(set_attr "type" "darith")
operands[2] = gen_reg_rtx (DImode); (set_attr "mode" "QI")
}") (set_attr "length" "1")])
;; ;;
;; .................... ;; ....................
......
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