Commit 781e6f76 by Richard Kenner

(mulhisi3): Add truncate to mulhisi3 to fix bug and change from define_insn to...

(mulhisi3): Add truncate to mulhisi3 to fix bug and change from
define_insn to define_expand to survive register presssure.

From-SVN: r8683
parent 76ebc969
...@@ -1670,14 +1670,34 @@ ...@@ -1670,14 +1670,34 @@
[(set_attr "length" "1,2")]) [(set_attr "length" "1,2")])
;; 32 bit result ;; 32 bit result
(define_insn "mulhisi3" (define_expand "mulhisi3"
[(set (match_dup 3)
(match_operand:HI 1 "general_operand" "g,g"))
(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
(mult:SI (truncate:HI
(match_dup 0))
(match_operand:HI 2 "general_operand" "rR,Qi")))]
"TARGET_45"
"operands[3] = gen_lowpart(HImode, operands[1]);")
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered! [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
(mult:SI (match_operand:HI 1 "register_operand" "%0,0") (mult:SI (truncate:HI
(match_operand:SI 1 "register_operand" "%0,0"))
(match_operand:HI 2 "general_operand" "rR,Qi")))] (match_operand:HI 2 "general_operand" "rR,Qi")))]
"TARGET_45" "TARGET_45"
"mul %2, %0" "mul %2, %0"
[(set_attr "length" "1,2")]) [(set_attr "length" "1,2")])
;(define_insn "mulhisi3"
; [(set (match_operand:SI 0 "register_operand" "=r,r") ; even numbered!
; (mult:SI (truncate:HI
; (match_operand:SI 1 "register_operand" "%0,0"))
; (match_operand:HI 2 "general_operand" "rR,Qi")))]
; "TARGET_45"
; "mul %2, %0"
; [(set_attr "length" "1,2")])
;;- divide ;;- divide
;; how can I use the remainder ? - ;; how can I use the remainder ? -
;; modsidi and move upper register to lower ???? ;; modsidi and move upper register to lower ????
......
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