OSDN Git Service

M68K TLS support.
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 May 2009 07:54:44 +0000 (07:54 +0000)
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 May 2009 07:54:44 +0000 (07:54 +0000)
commit869bde6b9946186a3d4b71cb3d48090e16723f57
treee8ce029d9db8c2877121f38cd2a486004490e1d2
parent8d1917fb2f3b7ddca8f4ff321974ff3ac69eeedd
M68K TLS support.
* configure.ac (m68k-*-*): Check if binutils support TLS.
* configure: Regenerate.
* config/m68k/predicates.md (symbolic_operand): Extend comment.
* config/m68k/constraints.md (Cu): New constraint.
* config/m68k/m68k.md (UNSPEC_GOTOFF): Remove.
(UNSPEC_RELOC16, UNSPEC_RELOC32): New constants.
(movsi): Handle TLS symbols.
(addsi3_5200): Handle XTLS symbols, indent.
* config/m68k/m68k-protos.h (m68k_legitimize_tls_address): Declare.
(m68k_tls_reference_p): Declare.
(m68k_legitimize_address): Declare.
(m68k_unwrap_symbol): Declare.
* config/m68k/m68k.opt (mxtls): New option.
* config/m68k/m68k.c (ggc.h): Include.
(m68k_output_dwarf_dtprel): Implement hook.
(TARGET_HAVE_TLS, TARGET_ASM_OUTPUT_DWARF_DTPREL): Define.
(m68k_expand_prologue): Load GOT pointer when function needs it.
(m68k_illegitimate_symbolic_constant_p): Handle TLS symbols.
(m68k_legitimate_constant_address_p): Same.
(m68k_decompose_address): Handle TLS references.
(m68k_get_gp): New static function.
(enum m68k_reloc): New contants.
(TLS_RELOC_P): New macro.
(m68k_wrap_symbol): New static function.
(m68k_unwrap_symbol): New function.
(m68k_final_prescan_insn_1): New static function.
(m68k_final_prescan_insn): New function.
(m68k_move_to_reg, m68k_wrap_symbol_into_got_ref): New static
functions.
(legitimize_pic_address): Handle TLS references..
(m68k_tls_get_addr, m68k_get_tls_get_addr)
(m68k_libcall_value_in_a0_p)
(m68k_call_tls_get_addr, m68k_read_tp, m68k_get_m68k_read_tp)
(m68k_call_m68k_read_tp): Helper variables and functions for ...
(m68k_legitimize_tls_address): Handle TLS references.
(m68k_tls_symbol_p, m68k_tls_reference_p_1, m68k_tls_reference_p):
New functions.
(m68k_legitimize_address): Handle TLS symbols.
(m68k_get_reloc_decoration): New static function.
(m68k_output_addr_const_extra): Handle UNSPEC_RELOC16 and
UNSPEC_RELOC32.
(m68k_output_dwarf_dtprel): Implement hook.
(print_operand_address): Handle UNSPEC_RELOC16 adn UNSPEC_RELOC32.
(m68k_libcall_value): Return result in A0 instead of D0 when asked by
m68k_call_* routines.
(sched_attr_op_type): Handle TLS symbols.
(gt-m68k.h): Include.
* config/m68k/m68k.h (FINAL_PRESCAN_INSN): Define.
(LEGITIMATE_PIC_OPERAND_P): Support TLS.

* gcc.target/m68k/tls-ie.c: New test.
* gcc.target/m68k/tls-le.c: New test.
* gcc.target/m68k/tls-gd.c: New test.
* gcc.target/m68k/tls-ld.c: New test.
* gcc.target/m68k/tls-ie-xgot.c: New test.
* gcc.target/m68k/tls-le-xtls.c: New test.
* gcc.target/m68k/tls-gd-xgot.c: New test.
* gcc.target/m68k/tls-ld-xgot.c: New test.
* gcc.target/m68k/tls-ld-xtls.c: New test.
* gcc.target/m68k/tls-ld-xgot-xtls.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147654 138bc75d-0d04-0410-961f-82ee72b054a4
21 files changed:
gcc/ChangeLog
gcc/config/m68k/constraints.md
gcc/config/m68k/m68k-protos.h
gcc/config/m68k/m68k.c
gcc/config/m68k/m68k.h
gcc/config/m68k/m68k.md
gcc/config/m68k/m68k.opt
gcc/config/m68k/predicates.md
gcc/configure
gcc/configure.ac
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/m68k/tls-gd-xgot.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-gd.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-ie-xgot.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-ie.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-ld-xgot-xtls.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-ld-xgot.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-ld-xtls.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-ld.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-le-xtls.c [new file with mode: 0644]
gcc/testsuite/gcc.target/m68k/tls-le.c [new file with mode: 0644]