Updated Patch for i386.md to remove redundant integer push patterns
John Wehle
john@feith.com
Sat Jan 17 13:06:00 GMT 1998
This patch replaces the one sent earlier today. This patch
is a little simplier and also takes care of a case previously
missed.
ChangeLog:
Sat Jan 17 15:54:15 EST 1998 John Wehle (john@feith.com)
* i386.md: Remove redundant integer push patterns.
Don't bother checking for TARGET_PUSH_MEMORY when
pushing constants or registers.
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i386/i386.md.ORIGINAL Wed Nov 5 14:29:37 1997
--- gcc/config/i386/i386.md Sat Jan 17 15:33:52 1998
***************
*** 834,856 ****
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
- (match_operand:SI 1 "general_operand" "g"))]
- "TARGET_PUSH_MEMORY"
- "push%L0 %1")
-
- ;; If not a 386, it is faster to move MEM to a REG and then push, rather than
- ;; push MEM directly.
-
- (define_insn ""
- [(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "ri"))]
! "!TARGET_PUSH_MEMORY && TARGET_MOVE"
"push%L0 %1")
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
! (match_operand:SI 1 "nonmemory_operand" "ri"))]
! "!TARGET_PUSH_MEMORY && !TARGET_MOVE"
"push%L0 %1")
;; General case of fullword move.
--- 834,849 ----
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "ri"))]
! ""
"push%L0 %1")
+ ;; On a 386, it is faster to push MEM directly.
+
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
! (match_operand:SI 1 "memory_operand" "m"))]
! "TARGET_PUSH_MEMORY"
"push%L0 %1")
;; General case of fullword move.
***************
*** 911,930 ****
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
- (match_operand:HI 1 "general_operand" "g"))]
- "TARGET_PUSH_MEMORY"
- "push%W0 %1")
-
- (define_insn ""
- [(set (match_operand:HI 0 "push_operand" "=<")
(match_operand:HI 1 "nonmemory_operand" "ri"))]
! "!TARGET_PUSH_MEMORY && TARGET_MOVE"
"push%W0 %1")
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
! (match_operand:HI 1 "nonmemory_operand" "ri"))]
! "!TARGET_PUSH_MEMORY && !TARGET_MOVE"
"push%W0 %1")
;; On i486, an incl and movl are both faster than incw and movw.
--- 904,917 ----
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
(match_operand:HI 1 "nonmemory_operand" "ri"))]
! ""
"push%W0 %1")
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<")
! (match_operand:HI 1 "memory_operand" "m"))]
! "TARGET_PUSH_MEMORY"
"push%W0 %1")
;; On i486, an incl and movl are both faster than incw and movw.
***************
*** 1038,1059 ****
[(set (match_operand:QI 0 "push_operand" "=<")
(match_operand:QI 1 "const_int_operand" "n"))]
""
! "* return AS1 (push%W0,%1);")
(define_insn ""
[(set (match_operand:QI 0 "push_operand" "=<")
(match_operand:QI 1 "register_operand" "q"))]
! "!TARGET_MOVE"
! "*
! {
! operands[1] = gen_rtx (REG, HImode, REGNO (operands[1]));
! return AS1 (push%W0,%1);
! }")
!
! (define_insn ""
! [(set (match_operand:QI 0 "push_operand" "=<")
! (match_operand:QI 1 "register_operand" "q"))]
! "TARGET_MOVE"
"*
{
operands[1] = gen_rtx (REG, HImode, REGNO (operands[1]));
--- 1025,1036 ----
[(set (match_operand:QI 0 "push_operand" "=<")
(match_operand:QI 1 "const_int_operand" "n"))]
""
! "push%W0,%1")
(define_insn ""
[(set (match_operand:QI 0 "push_operand" "=<")
(match_operand:QI 1 "register_operand" "q"))]
! ""
"*
{
operands[1] = gen_rtx (REG, HImode, REGNO (operands[1]));
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
More information about the Gcc-bugs
mailing list