diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-06 02:42:36 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-06 02:42:36 +0000 |
commit | 3f8d8851e9acac2a6d6cfb9e19c7236e5e9e261b (patch) | |
tree | f7836b92c63908c33faaad5f099a4d9b7959e030 /gcc/config/pa | |
parent | 9751796f97beaf7ea64712a6d6cd17b0f92c507a (diff) | |
download | gcc-3f8d8851e9acac2a6d6cfb9e19c7236e5e9e261b.tar.gz |
* config/pa/pa.md: Split tgd_load, tld_load and tie_load
into pic and non-pic versions. Mark r19 as used for
tgd_load_pic, tld_load_pic and tie_load_pic. Mark r27 as used
for tgd_load, tld_load and tie_load .
* config/pa/pa.c (legitimize_tls_address): Emit pic or non-pic
version of tgd_load, tld_load and tie_load depending on the
value of flag_pic.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124468 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/pa.c | 15 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 66 |
2 files changed, 63 insertions, 18 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index be55a850052..7c486f1c5d4 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -733,7 +733,10 @@ legitimize_tls_address (rtx addr) { case TLS_MODEL_GLOBAL_DYNAMIC: tmp = gen_reg_rtx (Pmode); - emit_insn (gen_tgd_load (tmp, addr)); + if (flag_pic) + emit_insn (gen_tgd_load_pic (tmp, addr)); + else + emit_insn (gen_tgd_load (tmp, addr)); ret = hppa_tls_call (tmp); break; @@ -741,7 +744,10 @@ legitimize_tls_address (rtx addr) ret = gen_reg_rtx (Pmode); tmp = gen_reg_rtx (Pmode); start_sequence (); - emit_insn (gen_tld_load (tmp, addr)); + if (flag_pic) + emit_insn (gen_tld_load_pic (tmp, addr)); + else + emit_insn (gen_tld_load (tmp, addr)); t1 = hppa_tls_call (tmp); insn = get_insns (); end_sequence (); @@ -757,7 +763,10 @@ legitimize_tls_address (rtx addr) tmp = gen_reg_rtx (Pmode); ret = gen_reg_rtx (Pmode); emit_insn (gen_tp_load (tp)); - emit_insn (gen_tie_load (tmp, addr)); + if (flag_pic) + emit_insn (gen_tie_load_pic (tmp, addr)); + else + emit_insn (gen_tie_load (tmp, addr)); emit_move_insn (ret, gen_rtx_PLUS (Pmode, tp, tmp)); break; diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index c6c6c935864..698579a4ba9 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -39,6 +39,9 @@ (UNSPEC_TLSLDBASE 7) (UNSPEC_TLSIE 8) (UNSPEC_TLSLE 9) + (UNSPEC_TLSGD_PIC 10) + (UNSPEC_TLSLDM_PIC 11) + (UNSPEC_TLSIE_PIC 12) ]) ;; UNSPEC_VOLATILE: @@ -10148,14 +10151,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" (define_insn "tgd_load" [(set (match_operand:SI 0 "register_operand" "=r") (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD)) - (clobber (reg:SI 1))] + (clobber (reg:SI 1)) + (use (reg:SI 27))] "" "* { - if (flag_pic) - return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\"; - else - return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\"; + return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\"; +}" + [(set_attr "type" "multi") + (set_attr "length" "8")]) + +(define_insn "tgd_load_pic" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD_PIC)) + (clobber (reg:SI 1)) + (use (reg:SI 19))] + "" + "* +{ + return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\"; }" [(set_attr "type" "multi") (set_attr "length" "8")]) @@ -10163,14 +10177,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" (define_insn "tld_load" [(set (match_operand:SI 0 "register_operand" "=r") (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM)) - (clobber (reg:SI 1))] + (clobber (reg:SI 1)) + (use (reg:SI 27))] "" "* { - if (flag_pic) - return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\"; - else - return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\"; + return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\"; +}" + [(set_attr "type" "multi") + (set_attr "length" "8")]) + +(define_insn "tld_load_pic" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM_PIC)) + (clobber (reg:SI 1)) + (use (reg:SI 19))] + "" + "* +{ + return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\"; }" [(set_attr "type" "multi") (set_attr "length" "8")]) @@ -10200,14 +10225,25 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" (define_insn "tie_load" [(set (match_operand:SI 0 "register_operand" "=r") (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE)) - (clobber (reg:SI 1))] + (clobber (reg:SI 1)) + (use (reg:SI 27))] "" "* { - if (flag_pic) - return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\"; - else - return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\"; + return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\"; +}" + [(set_attr "type" "multi") + (set_attr "length" "8")]) + +(define_insn "tie_load_pic" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE_PIC)) + (clobber (reg:SI 1)) + (use (reg:SI 19))] + "" + "* +{ + return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\"; }" [(set_attr "type" "multi") (set_attr "length" "8")]) |