aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1996-02-09 22:25:39 +0000
committerDoug Evans <dje@gnu.org>1996-02-09 22:25:39 +0000
commit258ae59d66b7d11bffebd6917492030f8fbca189 (patch)
tree2d4e3403e543c3cea765486211660344e0ae4fe4 /gcc
parent95726648efb29340078bdea2a882341c867434ba (diff)
downloadgcc-258ae59d66b7d11bffebd6917492030f8fbca189.zip
gcc-258ae59d66b7d11bffebd6917492030f8fbca189.tar.gz
gcc-258ae59d66b7d11bffebd6917492030f8fbca189.tar.bz2
Move pic sethi ahead of non-pic sethi and document why.
From-SVN: r11186
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/sparc/sparc.md34
1 files changed, 18 insertions, 16 deletions
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index d454a6f..5f41d95 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1467,22 +1467,6 @@
;; is not an "arith_operand".
[(set_attr "length" "1")])
-(define_insn "*sethi_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (high:SI (match_operand 1 "" "")))]
- "check_pic (1)"
- "sethi %%hi(%a1),%0"
- [(set_attr "type" "move")
- (set_attr "length" "1")])
-
-(define_insn "*sethi_hi"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (high:HI (match_operand 1 "" "")))]
- "check_pic (1)"
- "sethi %%hi(%a1),%0"
- [(set_attr "type" "move")
- (set_attr "length" "1")])
-
;; For PIC, symbol_refs are put inside unspec so that the optimizer will not
;; confuse them with real addresses.
(define_insn "pic_lo_sum_si"
@@ -1497,6 +1481,8 @@
;; is not an "arith_operand".
[(set_attr "length" "1")])
+;; The PIC version of sethi must appear before the non-pic case so that
+;; the unspec will not be matched as part of the operand.
;; For PIC, symbol_refs are put inside unspec so that the optimizer will not
;; confuse them with real addresses.
(define_insn "pic_sethi_si"
@@ -1507,6 +1493,22 @@
[(set_attr "type" "move")
(set_attr "length" "1")])
+(define_insn "*sethi_si"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (high:SI (match_operand 1 "" "")))]
+ "check_pic (1)"
+ "sethi %%hi(%a1),%0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "*sethi_hi"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (high:HI (match_operand 1 "" "")))]
+ "check_pic (1)"
+ "sethi %%hi(%a1),%0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
(define_insn "get_pc_sp32"
[(set (pc) (label_ref (match_operand 0 "" "")))
(set (reg:SI 15) (label_ref (match_dup 0)))]