This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Final tidbits for sparc64 PIC support
- To: egcs at cygnus dot com
- Subject: Final tidbits for sparc64 PIC support
- From: "David S. Miller" <davem at jenolan dot rutgers dot edu>
- Date: Thu, 2 Oct 1997 12:18:29 -0400
- CC: dje at cygnus dot com
I had omitted these from my original merge by mistake.
Thu Oct 2 12:14:54 1997 David S. Miller <davem@tanya.rutgers.edu>
* config/sparc/sparc.md (pic_{lo_sum,sethi}_di): New patterns
necessary for PIC support on sparc64.
--- config/sparc/sparc.md.~1~ Wed Sep 24 21:03:13 1997
+++ config/sparc/sparc.md Thu Oct 2 12:14:31 1997
@@ -1505,6 +1505,14 @@
;; is not an "arith_operand".
[(set_attr "length" "1")])
+(define_insn "pic_lo_sum_di"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (lo_sum:SI (match_operand:DI 1 "register_operand" "r")
+ (unspec:SI [(match_operand:DI 2 "immediate_operand" "in")] 0)))]
+ "TARGET_ARCH64 && flag_pic"
+ "add %1,%%lo(%a2),%0"
+ [(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
@@ -1513,6 +1521,14 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(high:SI (unspec:SI [(match_operand 1 "" "")] 0)))]
"flag_pic && check_pic (1)"
+ "sethi %%hi(%a1),%0"
+ [(set_attr "type" "move")
+ (set_attr "length" "1")])
+
+(define_insn "pic_sethi_di"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (high:SI (unspec:SI [(match_operand 1 "" "")] 0)))]
+ "TARGET_ARCH64 && flag_pic && check_pic (1)"
"sethi %%hi(%a1),%0"
[(set_attr "type" "move")
(set_attr "length" "1")])