Commit 47f59fd4 by Jeffrey A Law Committed by Jeff Law

i386.md (ashlsi3): Turn into a define_expand an anonymous pattern.

        * i386.md (ashlsi3): Turn into a define_expand an anonymous pattern.
        Make the anonymous pattern match when ! optimize_size.
        (ashlsi3 size optimizer): New pattern.

From-SVN: r24980
parent cbca921c
...@@ -6,6 +6,10 @@ Tue Feb 2 20:29:34 1999 Catherine Moore <clm@cygnus.com> ...@@ -6,6 +6,10 @@ Tue Feb 2 20:29:34 1999 Catherine Moore <clm@cygnus.com>
Tue Feb 2 19:43:59 1999 Jeffrey A Law (law@cygnus.com) Tue Feb 2 19:43:59 1999 Jeffrey A Law (law@cygnus.com)
* i386.md (ashlsi3): Turn into a define_expand an anonymous pattern.
Make the anonymous pattern match when ! optimize_size.
(ashlsi3 size optimizer): New pattern.
* intl/Makefile.in (uninstall): Add missing "; \". * intl/Makefile.in (uninstall): Add missing "; \".
Tue Feb 2 18:21:23 1999 Stan Cox <scox@cygnus.com> Tue Feb 2 18:21:23 1999 Stan Cox <scox@cygnus.com>
......
...@@ -4713,11 +4713,46 @@ byte_xor_operation: ...@@ -4713,11 +4713,46 @@ byte_xor_operation:
;; On i486, movl/sall appears slightly faster than leal, but the leal ;; On i486, movl/sall appears slightly faster than leal, but the leal
;; is smaller - use leal for now unless the shift count is 1. ;; is smaller - use leal for now unless the shift count is 1.
(define_insn "ashlsi3" (define_expand "ashlsi3"
[(set (match_operand:SI 0 "nonimmediate_operand" "")
(ashift:SI (match_operand:SI 1 "nonimmediate_operand" "")
(match_operand:SI 2 "nonmemory_operand" "")))]
""
"")
;; For regsiter destinations:
;; add == 2 bytes, move == 2 bytes, shift == 3 bytes, lea == 7 bytes
;;
;; lea loses when optimizing for size
;;
;; Do the math. If the count is 1, using add, else using sal will
;; produce the smallest possible code, even when the source and
;; dest do not match. For a memory destination, sal is the only
;; choice.
;;
;; Do not try to handle case where src and dest do not match. Let regmove
;; and reload handle them. A mov followed by this insn will generate the
;; desired size optimized results.
(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(ashift:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:SI 2 "nonmemory_operand" "cI")))]
"optimize_size"
"*
{
if (REG_P (operands[0]) && operands[2] == const1_rtx)
return AS2 (add%L0,%0,%0);
if (REG_P (operands[2]))
return AS2 (sal%L0,%b2,%0);
return AS2 (sal%L0,%2,%0);
}")
(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand" "=r,rm") [(set (match_operand:SI 0 "nonimmediate_operand" "=r,rm")
(ashift:SI (match_operand:SI 1 "nonimmediate_operand" "r,0") (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "r,0")
(match_operand:SI 2 "nonmemory_operand" "M,cI")))] (match_operand:SI 2 "nonmemory_operand" "M,cI")))]
"" "! optimize_size"
"* "*
{ {
if (REG_P (operands[0]) && REGNO (operands[0]) != REGNO (operands[1])) if (REG_P (operands[0]) && REGNO (operands[0]) != REGNO (operands[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