Commit 685885b7 by Richard Henderson Committed by Richard Henderson

i386.md (push): Prohibit symbolic constants if flag_pic.

* i386.md (push): Prohibit symbolic constants if flag_pic.
(movsi+1): Likewise for move to non-register.

From-SVN: r17425
parent 11ea364a
Mon Jan 19 21:57:00 1998 Richard Henderson <rth@cygnus.com>
* i386.md (push): Prohibit symbolic constants if flag_pic.
(movsi+1): Likewise for move to non-register.
Mon Jan 19 11:15:38 1998 Jim Wilson <wilson@cygnus.com> Mon Jan 19 11:15:38 1998 Jim Wilson <wilson@cygnus.com>
* alpha.c (mode_mask_operand): Accept 0xffffffff on 32 bit host. * alpha.c (mode_mask_operand): Accept 0xffffffff on 32 bit host.
......
...@@ -834,8 +834,14 @@ ...@@ -834,8 +834,14 @@
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<") [(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "rn"))]
"flag_pic"
"* return AS1 (push%L0,%1);")
(define_insn ""
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "nonmemory_operand" "ri"))] (match_operand:SI 1 "nonmemory_operand" "ri"))]
"" "!flag_pic"
"* return AS1 (push%L0,%1);") "* return AS1 (push%L0,%1);")
;; On a 386, it is faster to push MEM directly. ;; On a 386, it is faster to push MEM directly.
...@@ -876,8 +882,10 @@ ...@@ -876,8 +882,10 @@
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "general_operand" "=g,r") [(set (match_operand:SI 0 "general_operand" "=g,r")
(match_operand:SI 1 "general_operand" "ri,m"))] (match_operand:SI 1 "general_operand" "rn,im"))]
"(!TARGET_MOVE || GET_CODE (operands[0]) != MEM) || (GET_CODE (operands[1]) != MEM)" "((!TARGET_MOVE || GET_CODE (operands[0]) != MEM)
|| (GET_CODE (operands[1]) != MEM))
&& flag_pic"
"* "*
{ {
rtx link; rtx link;
...@@ -896,13 +904,40 @@ ...@@ -896,13 +904,40 @@
/* Fastest way to change a 0 to a 1. */ /* Fastest way to change a 0 to a 1. */
return AS1 (inc%L0,%0); return AS1 (inc%L0,%0);
if (flag_pic && SYMBOLIC_CONST (operands[1])) if (SYMBOLIC_CONST (operands[1]))
return AS2 (lea%L0,%a1,%0); return AS2 (lea%L0,%a1,%0);
return AS2 (mov%L0,%1,%0); return AS2 (mov%L0,%1,%0);
}") }")
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "general_operand" "=g,r")
(match_operand:SI 1 "general_operand" "ri,m"))]
"((!TARGET_MOVE || GET_CODE (operands[0]) != MEM)
|| (GET_CODE (operands[1]) != MEM))
&& !flag_pic"
"*
{
rtx link;
if (operands[1] == const0_rtx && REG_P (operands[0]))
return AS2 (xor%L0,%0,%0);
if (operands[1] == const1_rtx
&& (link = find_reg_note (insn, REG_WAS_0, 0))
/* Make sure the insn that stored the 0 is still present. */
&& ! INSN_DELETED_P (XEXP (link, 0))
&& GET_CODE (XEXP (link, 0)) != NOTE
/* Make sure cross jumping didn't happen here. */
&& no_labels_between_p (XEXP (link, 0), insn)
/* Make sure the reg hasn't been clobbered. */
&& ! reg_set_between_p (operands[0], XEXP (link, 0), insn))
/* Fastest way to change a 0 to a 1. */
return AS1 (inc%L0,%0);
return AS2 (mov%L0,%1,%0);
}")
(define_insn ""
[(set (match_operand:HI 0 "push_operand" "=<") [(set (match_operand:HI 0 "push_operand" "=<")
(match_operand:HI 1 "nonmemory_operand" "ri"))] (match_operand:HI 1 "nonmemory_operand" "ri"))]
"" ""
......
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