From 8950516e0b1ef0bd63acffda8e81ec85f982d0d7 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Fri, 27 May 2011 15:45:56 +0000 Subject: [PATCH] configure.ac (gcc_cv_as_ix86_tlsgdplt): Check for @tlsgdplt 2011-05-27 Rainer Orth Uros Bizjak * configure.ac (gcc_cv_as_ix86_tlsgdplt): Check for @tlsgdplt (HAVE_AS_IX86_TLSGDPTL): Define. (gcc_cv_as_ix86_tlsldmplt): Check for @tlsldmplt. (HAVE_AS_IX86_TLSLDMPLT): Define. * configure: Regenerate. * config.in: Regenerate. * config/i386/i386.c (ix86_print_operand): Handle code 'p'. * config/i386/i386.md (*tls_global_dynamic_32_gnu): If TARGET_SUN_TLS, use @tlsgdplt or @plt. (*tls_global_dynamic_64): Use @plt if TARGET_SUN_TLS. (*tls_local_dynamic_base_32_gnu): If TARGET_SUN_TLS, use @tlsldmplt or @plt. (*tls_local_dynamic_base_64): Use @plt if TARGET_SUN_TLS. Co-Authored-By: Uros Bizjak From-SVN: r174340 --- gcc/ChangeLog | 17 +++++++++++ gcc/config.in | 12 ++++++++ gcc/config/i386/i386.c | 4 ++- gcc/config/i386/i386.md | 17 +++++++++++ gcc/configure | 62 +++++++++++++++++++++++++++++++++++++++++ gcc/configure.ac | 12 ++++++++ 6 files changed, 123 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ecfab778f62..7bd31937544 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2011-05-27 Rainer Orth + Uros Bizjak + + * configure.ac (gcc_cv_as_ix86_tlsgdplt): Check for @tlsgdplt + (HAVE_AS_IX86_TLSGDPTL): Define. + (gcc_cv_as_ix86_tlsldmplt): Check for @tlsldmplt. + (HAVE_AS_IX86_TLSLDMPLT): Define. + * configure: Regenerate. + * config.in: Regenerate. + * config/i386/i386.c (ix86_print_operand): Handle code 'p'. + * config/i386/i386.md (*tls_global_dynamic_32_gnu): If + TARGET_SUN_TLS, use @tlsgdplt or @plt. + (*tls_global_dynamic_64): Use @plt if TARGET_SUN_TLS. + (*tls_local_dynamic_base_32_gnu): If TARGET_SUN_TLS, use + @tlsldmplt or @plt. + (*tls_local_dynamic_base_64): Use @plt if TARGET_SUN_TLS. + 2011-05-27 Bernd Schmidt * sched-int.h (struct _haifa_deps_insn_data): New members cond diff --git a/gcc/config.in b/gcc/config.in index 43aa919e669..d202b038e6e 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -351,6 +351,18 @@ #endif +/* Define if your assembler supports @tlsgdplt. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_IX86_TLSGDPLT +#endif + + +/* Define if your assembler supports @tlsldmplt. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_IX86_TLSLDMPLT +#endif + + /* Define if your assembler supports the lituse_jsrdirect relocation. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_JSRDIRECT_RELOCS diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c7da6d3f26e..ae81d62caa9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13918,6 +13918,7 @@ get_some_local_dynamic_name (void) d -- print duplicated register operand for AVX instruction. D -- print condition for SSE cmp instruction. P -- if PIC, print an @PLT suffix. + p -- print raw symbol name. X -- don't print any sort of PIC '@' suffix for a symbol. & -- print some in-use local-dynamic symbol name. H -- print a memory address offset by 8; used for sse high-parts @@ -14123,6 +14124,7 @@ ix86_print_operand (FILE *file, rtx x, int code) case 'x': case 'X': case 'P': + case 'p': break; case 's': @@ -14522,7 +14524,7 @@ ix86_print_operand (FILE *file, rtx x, int code) x = const0_rtx; } - if (code != 'P') + if (code != 'P' && code != 'p') { if (CONST_INT_P (x) || GET_CODE (x) == CONST_DOUBLE) { diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 13a1cded196..2e7633dfc7d 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -53,6 +53,7 @@ ;; d -- print duplicated register operand for AVX instruction. ;; D -- print condition for SSE cmp instruction. ;; P -- if PIC, print an @PLT suffix. +;; p -- print raw symbol name. ;; X -- don't print any sort of PIC '@' suffix for a symbol. ;; & -- print some in-use local-dynamic symbol name. ;; H -- print a memory address offset by 8; used for sse high-parts @@ -12367,6 +12368,12 @@ { output_asm_insn ("lea{l}\t{%a2@tlsgd(,%1,1), %0|%0, %a2@tlsgd[%1*1]}", operands); + if (TARGET_SUN_TLS) +#ifdef HAVE_AS_IX86_TLSGDPLT + return "call\t%a2@tlsgdplt"; +#else + return "call\t%p3@plt"; +#endif return "call\t%P3"; } [(set_attr "type" "multi") @@ -12397,6 +12404,8 @@ ("lea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}", operands); fputs (ASM_SHORT "0x6666\n", asm_out_file); fputs ("\trex64\n", asm_out_file); + if (TARGET_SUN_TLS) + return "call\t%p2@plt"; return "call\t%P2"; } [(set_attr "type" "multi") @@ -12424,6 +12433,12 @@ { output_asm_insn ("lea{l}\t{%&@tlsldm(%1), %0|%0, %&@tlsldm[%1]}", operands); + if (TARGET_SUN_TLS) +#ifdef HAVE_AS_IX86_TLSLDMPLT + return "call\t%&@tlsldmplt"; +#else + return "call\t%p2@plt"; +#endif return "call\t%P2"; } [(set_attr "type" "multi") @@ -12450,6 +12465,8 @@ { output_asm_insn ("lea{q}\t{%&@tlsld(%%rip), %%rdi|rdi, %&@tlsld[rip]}", operands); + if (TARGET_SUN_TLS) + return "call\t%p1@plt"; return "call\t%P1"; } [(set_attr "type" "multi") diff --git a/gcc/configure b/gcc/configure index 274af3eccd7..0873e98212c 100755 --- a/gcc/configure +++ b/gcc/configure @@ -24084,6 +24084,68 @@ if test $gcc_cv_as_ix86_rep_lock_prefix = yes; then $as_echo "#define HAVE_AS_IX86_REP_LOCK_PREFIX 1" >>confdefs.h +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for R_386_TLS_GD_PLT reloc" >&5 +$as_echo_n "checking assembler for R_386_TLS_GD_PLT reloc... " >&6; } +if test "${gcc_cv_as_ix86_tlsgdplt+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_ix86_tlsgdplt=no + if test x$gcc_cv_as != x; then + echo 'call tls_gd@tlsgdplt' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_ix86_tlsgdplt=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_tlsgdplt" >&5 +$as_echo "$gcc_cv_as_ix86_tlsgdplt" >&6; } +if test $gcc_cv_as_ix86_tlsgdplt = yes; then + +$as_echo "#define HAVE_AS_IX86_TLSGDPLT 1" >>confdefs.h + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for R_386_TLS_LDM_PLT reloc" >&5 +$as_echo_n "checking assembler for R_386_TLS_LDM_PLT reloc... " >&6; } +if test "${gcc_cv_as_ix86_tlsldmplt+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_ix86_tlsldmplt=no + if test x$gcc_cv_as != x; then + echo 'call tls_ld@tlsldmplt' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_ix86_tlsldmplt=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_tlsldmplt" >&5 +$as_echo "$gcc_cv_as_ix86_tlsldmplt" >&6; } +if test $gcc_cv_as_ix86_tlsldmplt = yes; then + +$as_echo "#define HAVE_AS_IX86_TLSLDMPLT 1" >>confdefs.h + fi ;; diff --git a/gcc/configure.ac b/gcc/configure.ac index 9ace66db9cb..dbc825adfc6 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3550,6 +3550,18 @@ foo: nop [AC_DEFINE(HAVE_AS_IX86_REP_LOCK_PREFIX, 1, [Define if the assembler supports 'rep , lock '.])]) + gcc_GAS_CHECK_FEATURE([R_386_TLS_GD_PLT reloc], + gcc_cv_as_ix86_tlsgdplt,,, + [call tls_gd@tlsgdplt],, + [AC_DEFINE(HAVE_AS_IX86_TLSGDPLT, 1, + [Define if your assembler supports @tlsgdplt.])]) + + gcc_GAS_CHECK_FEATURE([R_386_TLS_LDM_PLT reloc], + gcc_cv_as_ix86_tlsldmplt,,, + [call tls_ld@tlsldmplt],, + [AC_DEFINE(HAVE_AS_IX86_TLSLDMPLT, 1, + [Define if your assembler supports @tlsldmplt.])]) + ;; ia64*-*-*) -- 2.30.2