summaryrefslogtreecommitdiff
path: root/gcc/config/sparc/sparc.md
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-06 12:51:03 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-06 12:51:03 +0000
commit6b122edbab8bb1030b2f9286dfdbdaa9a629707c (patch)
treee5f6c05be89760609fbf122854a81ff757f979ae /gcc/config/sparc/sparc.md
parentf551ed05aad420487fd64f761a4c6d16b0acf1c3 (diff)
downloadgcc-6b122edbab8bb1030b2f9286dfdbdaa9a629707c.tar.gz
* config/sparc/sparc.c (get_pc_symbol): Rename into
add_pc_to_pic_symbol. (get_pc_symbol_name): Rename into add_pc_to_pic_symbol_name. (load_pic_register): Account for previous changes. Use reg_names. Don't create the label twice. * config/sparc/sparc.md (UNSPEC_GET_PC): Rename into UNSPEC_LOAD_PCREL_SYM. (get_pc): Rename into load_pcrel_sym. Add predicate to operands. Remove condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84151 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc/sparc.md')
-rw-r--r--gcc/config/sparc/sparc.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 622f7879cbc..021ddd164b1 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -27,7 +27,7 @@
(define_constants
[(UNSPEC_MOVE_PIC 0)
(UNSPEC_UPDATE_RETURN 1)
- (UNSPEC_GET_PC 2)
+ (UNSPEC_LOAD_PCREL_SYM 2)
(UNSPEC_MOVE_PIC_LABEL 5)
(UNSPEC_SETH44 6)
(UNSPEC_SETM44 7)
@@ -1664,17 +1664,19 @@
[(set_attr "type" "branch")
(set_attr "branch_type" "reg")])
-;; Load program counter insns.
+;; Load in operand 0 the (absolute) address of operand 1, which is a symbolic
+;; value subject to a PC-relative relocation. Operand 2 is a helper function
+;; that adds the PC value at the call point to operand 0.
-(define_insn "get_pc"
- [(clobber (reg:SI 15))
- (set (match_operand 0 "register_operand" "=r")
- (unspec [(match_operand 1 "" "") (match_operand 2 "" "")] UNSPEC_GET_PC))]
- "flag_pic && REGNO (operands[0]) == 23"
+(define_insn "load_pcrel_sym"
+ [(set (match_operand 0 "register_operand" "=r")
+ (unspec [(match_operand 1 "symbolic_operand" "")
+ (match_operand 2 "call_operand_address" "")] UNSPEC_LOAD_PCREL_SYM))
+ (clobber (reg:SI 15))]
+ ""
"sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\tadd\t%0, %%lo(%a1+4), %0"
[(set_attr "type" "multi")
(set_attr "length" "3")])
-
;; Move instructions