aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/frv/frv.md
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2005-02-07 08:06:29 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2005-02-07 08:06:29 +0000
commita701780f52ed57927fdf223faf900ffb48829782 (patch)
treece31f3701b173026f1abff0a74b94c1c8fb110f1 /gcc/config/frv/frv.md
parent888b0310a679f2e28ab2ad9add296559ddf40ce1 (diff)
downloadgcc-a701780f52ed57927fdf223faf900ffb48829782.zip
gcc-a701780f52ed57927fdf223faf900ffb48829782.tar.gz
gcc-a701780f52ed57927fdf223faf900ffb48829782.tar.bz2
frv.md ("tls_indirect_call"): Turn into libcall-like expand.
* config/frv/frv.md ("tls_indirect_call"): Turn into libcall-like expand. ("*tls_indirect_call"): New, reference hard regs directly. * config/frv/frv.c (gen_inlined_tls_plt): Adjust. From-SVN: r94694
Diffstat (limited to 'gcc/config/frv/frv.md')
-rw-r--r--gcc/config/frv/frv.md37
1 files changed, 27 insertions, 10 deletions
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index 94520ef..4515c0b 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -8203,25 +8203,42 @@
[(set_attr "length" "4")
(set_attr "type" "load_or_call")])
-;; Reads GR8 and GR9.
-;; Clobbers GR8.
-;; Modifies GR9.
-(define_insn "tls_indirect_call"
- [(set (match_operand:SI 0 "register_operand" "=D09")
+;; We have to expand this like a libcall (it sort of actually is)
+;; because otherwise sched may move, for example, an insn that sets up
+;; GR8 for a subsequence call before the *tls_indirect_call insn, and
+;; then reload won't be able to fix things up.
+(define_expand "tls_indirect_call"
+ [(set (reg:DI GR8_REG)
+ (match_operand:DI 2 "register_operand" ""))
+ (parallel
+ [(set (reg:SI GR9_REG)
+ (unspec:SI
+ [(match_operand:SI 1 "symbolic_operand" "")
+ (reg:DI GR8_REG)]
+ UNSPEC_TLS_INDIRECT_CALL))
+ (clobber (reg:SI GR8_REG))
+ (clobber (reg:SI LRREG))
+ (use (match_operand:SI 3 "register_operand" ""))])
+ (set (match_operand:SI 0 "register_operand" "")
+ (reg:SI GR9_REG))]
+ "HAVE_AS_TLS")
+
+(define_insn "*tls_indirect_call"
+ [(set (reg:SI GR9_REG)
(unspec:SI
- [(match_operand:SI 1 "symbolic_operand" "")
- (match_operand:DI 2 "register_operand" "D89")]
+ [(match_operand:SI 0 "symbolic_operand" "")
+ (reg:DI GR8_REG)]
UNSPEC_TLS_INDIRECT_CALL))
- (clobber (match_operand:SI 3 "register_operand" "=D08"))
+ (clobber (reg:SI GR8_REG))
(clobber (reg:SI LRREG))
;; If there was a way to represent the fact that we don't need GR9
;; or GR15 to be set before this instruction (it could be in
;; parallel), we could use it here. This change wouldn't apply to
;; call_gettlsoff, thought, since the linker may turn the latter
;; into ldi @(gr15,offset),gr9.
- (use (match_operand:SI 4 "register_operand" "D15"))]
+ (use (match_operand:SI 1 "register_operand" "D15"))]
"HAVE_AS_TLS"
- "calll #gettlsoff(%a1)@(%2,gr0)"
+ "calll #gettlsoff(%a0)@(gr8,gr0)"
[(set_attr "length" "4")
(set_attr "type" "jumpl")])