Commit f996902d by Richard Henderson Committed by Richard Henderson

configure.in (HAVE_AS_TLS): New test.

	* configure.in (HAVE_AS_TLS): New test.
	* config.in, configure: Rebuild.
	* config/i386/i386.c (TARGET_HAVE_TLS): Set if HAVE_AS_TLS.
	(ix86_tls_dialect_string, ix86_tls_dialect): New.
	(override_options): Set it.
	(tls_model_chars, tls_symbolic_operand): New.
	(tls_symbolic_operand_1, global_dynamic_symbolic_operand): New.
	(local_dynamic_symbolic_operand, initial_exec_symbolic_operand): New.
	(local_exec_symbolic_operand): New.
	(get_pic_label_name): Merge into output_set_got.
	(ix86_asm_file_end): Emit pic_label_name if defined.
	(legitimate_constant_p, constant_address_p): New.
	(legitimate_pic_operand_p): New.
	(legitimate_pic_address_disp_p): Handle GOTTPOFF, NTPOFF, DTPOFF.
	(legitimate_address_p): Likewise.
	(ix86_encode_section_info): Rename from i386_; handle tls decls.
	(ix86_strip_name_encoding): New.
	(get_thread_pointer): New.
	(legitimize_address): Handle tls symbols.
	(output_pic_addr_const): Handle GOTTPOFF, TPOFF, NTPOFF, DTPOFF.
	Remove UNSPEC_PLT.
	(struct machine_function): Add some_ld_name.
	(get_some_local_dynamic_name, get_some_local_dynamic_name_1): Set it.
	(print_operand) [&]: Use it.  Handle UNSPEC_TP.
	(output_addr_const_extra): New.
	(maybe_get_pool_constant): New.
	(ix86_split_to_parts): Use it.
	(ix86_expand_move): Handle tls symbols.
	(ix86_tls_get_addr): New.
	* config/i386/i386.h (TARGET_GNU_TLS, TARGET_SUN_TLS): New.
	(TARGET_OPTIONS): Add tls-dialect.
	(CONSTANT_ADDRESS_P): Use new out-of-line function.
	(LEGITIMATE_CONSTANT_P): Likewise.
	(LEGITIMATE_PIC_OPERAND_P): Likewise.
	(TARGET_STRIP_NAME_ENCODING): New.
	(ASM_OUTPUT_LABELREF): New.
	(PRINT_OPERAND_PUNCT_VALID_P): Add '&'.
	(OUTPUT_ADDR_CONST_EXTRA): New.
	(PREDICATE_CODES): Update.
	(ix86_tls_dialect, ix86_tls_dialect_string): New.
	* config/i386/i386.md: Regroup and renumber unspec constants.
	(tls_global_dynamic_gnu, tls_global_dynamic_sun): New.
	(tls_local_dynamic_base_gnu, tls_local_dynamic_base_sun): New.
	(tls_global_dynamic, tls_local_dynamic_base): New.
	(tls_local_dynamic_once): New.
	* config/i386/i386-protos.h: Update.

From-SVN: r53812
parent 821e35ba
2002-05-23 Richard Henderson <rth@redhat.com>
* configure.in (HAVE_AS_TLS): New test.
* config.in, configure: Rebuild.
* config/i386/i386.c (TARGET_HAVE_TLS): Set if HAVE_AS_TLS.
(ix86_tls_dialect_string, ix86_tls_dialect): New.
(override_options): Set it.
(tls_model_chars, tls_symbolic_operand): New.
(tls_symbolic_operand_1, global_dynamic_symbolic_operand): New.
(local_dynamic_symbolic_operand, initial_exec_symbolic_operand): New.
(local_exec_symbolic_operand): New.
(get_pic_label_name): Merge into output_set_got.
(ix86_asm_file_end): Emit pic_label_name if defined.
(legitimate_constant_p, constant_address_p): New.
(legitimate_pic_operand_p): New.
(legitimate_pic_address_disp_p): Handle GOTTPOFF, NTPOFF, DTPOFF.
(legitimate_address_p): Likewise.
(ix86_encode_section_info): Rename from i386_; handle tls decls.
(ix86_strip_name_encoding): New.
(get_thread_pointer): New.
(legitimize_address): Handle tls symbols.
(output_pic_addr_const): Handle GOTTPOFF, TPOFF, NTPOFF, DTPOFF.
Remove UNSPEC_PLT.
(struct machine_function): Add some_ld_name.
(get_some_local_dynamic_name, get_some_local_dynamic_name_1): Set it.
(print_operand) [&]: Use it. Handle UNSPEC_TP.
(output_addr_const_extra): New.
(maybe_get_pool_constant): New.
(ix86_split_to_parts): Use it.
(ix86_expand_move): Handle tls symbols.
(ix86_tls_get_addr): New.
* config/i386/i386.h (TARGET_GNU_TLS, TARGET_SUN_TLS): New.
(TARGET_OPTIONS): Add tls-dialect.
(CONSTANT_ADDRESS_P): Use new out-of-line function.
(LEGITIMATE_CONSTANT_P): Likewise.
(LEGITIMATE_PIC_OPERAND_P): Likewise.
(TARGET_STRIP_NAME_ENCODING): New.
(ASM_OUTPUT_LABELREF): New.
(PRINT_OPERAND_PUNCT_VALID_P): Add '&'.
(OUTPUT_ADDR_CONST_EXTRA): New.
(PREDICATE_CODES): Update.
(ix86_tls_dialect, ix86_tls_dialect_string): New.
* config/i386/i386.md: Regroup and renumber unspec constants.
(tls_global_dynamic_gnu, tls_global_dynamic_sun): New.
(tls_local_dynamic_base_gnu, tls_local_dynamic_base_sun): New.
(tls_global_dynamic, tls_local_dynamic_base): New.
(tls_local_dynamic_once): New.
* config/i386/i386-protos.h: Update.
2002-05-23 Richard Henderson <rth@redhat.com>
* genemit.c (gen_insn): Print file:lineno comment before function.
(main): likewise.
* gensupport.c (struct queue_elem): Add filename member.
......
......@@ -528,6 +528,9 @@
/* Define if your assembler supports marking sections with SHF_MERGE flag. */
#undef HAVE_GAS_SHF_MERGE
/* Define if your assembler supports thread-local storage. */
#undef HAVE_AS_TLS
/* Define if your assembler supports explicit relocations. */
#undef HAVE_AS_EXPLICIT_RELOCS
......
......@@ -50,6 +50,11 @@ extern int x86_64_immediate_operand PARAMS ((rtx, enum machine_mode));
extern int x86_64_zext_immediate_operand PARAMS ((rtx, enum machine_mode));
extern int const_int_1_operand PARAMS ((rtx, enum machine_mode));
extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int tls_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int global_dynamic_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int local_dynamic_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int initial_exec_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int local_exec_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int pic_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int call_insn_operand PARAMS ((rtx, enum machine_mode));
extern int constant_call_address_operand PARAMS ((rtx, enum machine_mode));
......@@ -83,6 +88,9 @@ extern int ix86_expand_movstr PARAMS ((rtx, rtx, rtx, rtx));
extern int ix86_expand_clrstr PARAMS ((rtx, rtx, rtx));
extern int ix86_expand_strlen PARAMS ((rtx, rtx, rtx, rtx));
extern bool legitimate_constant_p PARAMS ((rtx));
extern bool constant_address_p PARAMS ((rtx));
extern bool legitimate_pic_operand_p PARAMS ((rtx));
extern int legitimate_pic_address_disp_p PARAMS ((rtx));
extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
extern rtx legitimize_pic_address PARAMS ((rtx, rtx));
......@@ -91,6 +99,7 @@ extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
extern void print_reg PARAMS ((rtx, int, FILE*));
extern void print_operand PARAMS ((FILE*, rtx, int));
extern void print_operand_address PARAMS ((FILE*, rtx));
extern bool output_addr_const_extra PARAMS ((FILE*, rtx));
extern void split_di PARAMS ((rtx[], int, rtx[], rtx[]));
extern void split_ti PARAMS ((rtx[], int, rtx[], rtx[]));
......@@ -198,6 +207,8 @@ extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
extern void x86_output_mi_thunk PARAMS ((FILE *, int, tree));
#endif
extern rtx ix86_tls_get_addr PARAMS ((void));
/* In winnt.c */
extern void i386_pe_encode_section_info PARAMS ((tree, int));
extern const char *i386_pe_strip_name_encoding PARAMS ((const char *));
......
......@@ -282,6 +282,9 @@ extern int x86_prefetch_sse;
#define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE))
#define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU)
#define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN)
/* WARNING: Do not mark empty strings for translation, as calling
gettext on an empty string does NOT return an empty
string. */
......@@ -426,6 +429,8 @@ extern int x86_prefetch_sse;
"" /* Undocumented. */ }, \
{ "asm=", &ix86_asm_string, \
N_("Use given assembler dialect") }, \
{ "tls-dialect=", &ix86_tls_dialect_string, \
N_("Use given thread-local storage dialect") }, \
SUBTARGET_OPTIONS \
}
......@@ -1876,15 +1881,12 @@ do { \
#define MAX_REGS_PER_ADDRESS 2
#define CONSTANT_ADDRESS_P(X) \
(GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
|| GET_CODE (X) == CONST_DOUBLE)
#define CONSTANT_ADDRESS_P(X) constant_address_p (X)
/* Nonzero if the constant value X is a legitimate general operand.
It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
#define LEGITIMATE_CONSTANT_P(X) 1
#define LEGITIMATE_CONSTANT_P(X) legitimate_constant_p (X)
#ifdef REG_OK_STRICT
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
......@@ -1947,9 +1949,7 @@ do { \
when generating PIC code. It is given that flag_pic is on and
that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
(! SYMBOLIC_CONST (X) \
|| legitimate_pic_address_disp_p (X))
#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
#define SYMBOLIC_CONST(X) \
(GET_CODE (X) == SYMBOL_REF \
......@@ -2392,7 +2392,20 @@ enum ix86_builtins
IX86_BUILTIN_MAX
};
#define TARGET_ENCODE_SECTION_INFO i386_encode_section_info
#define TARGET_ENCODE_SECTION_INFO ix86_encode_section_info
#define TARGET_STRIP_NAME_ENCODING ix86_strip_name_encoding
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
do { \
const char *xname = (NAME); \
if (xname[0] == '%') \
xname += 2; \
if (xname[0] == '*') \
xname += 1; \
else \
fputs (user_label_prefix, FILE); \
fputs (xname, FILE); \
} while (0)
/* The `FINALIZE_PIC' macro serves as a hook to emit these special
codes once the function is being compiled into assembly code, but
......@@ -3047,7 +3060,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
print_operand function. */
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '*' || (CODE) == '+')
((CODE) == '*' || (CODE) == '+' || (CODE) == '&')
/* Print the name of a register based on its machine mode and number.
If CODE is 'w', pretend the mode is HImode.
......@@ -3066,6 +3079,12 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
print_operand_address ((FILE), (ADDR))
#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \
do { \
if (! output_addr_const_extra (FILE, (X))) \
goto FAIL; \
} while (0);
/* Print the name of a register for based on its machine mode and number.
This macro is used to print debugging output.
This macro is different from PRINT_REG in that it may be used in
......@@ -3195,7 +3214,12 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
{"memory_displacement_operand", {MEM}}, \
{"cmpsi_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \
LABEL_REF, SUBREG, REG, MEM, AND}}, \
{"long_memory_operand", {MEM}},
{"long_memory_operand", {MEM}}, \
{"tls_symbolic_operand", {SYMBOL_REF}}, \
{"global_dynamic_symbolic_operand", {SYMBOL_REF}}, \
{"local_dynamic_symbolic_operand", {SYMBOL_REF}}, \
{"initial_exec_symbolic_operand", {SYMBOL_REF}}, \
{"local_exec_symbolic_operand", {SYMBOL_REF}},
/* A list of predicates that do special things with modes, and so
should not elicit warnings for VOIDmode match_operand. */
......@@ -3233,6 +3257,15 @@ enum fpmath_unit
extern enum fpmath_unit ix86_fpmath;
extern const char *ix86_fpmath_string;
enum tls_dialect
{
TLS_DIALECT_GNU,
TLS_DIALECT_SUN
};
extern enum tls_dialect ix86_tls_dialect;
extern const char *ix86_tls_dialect_string;
enum cmodel {
CM_32, /* The traditional 32-bit ABI. */
CM_SMALL, /* Assumes all code and data fits in the low 31 bits. */
......
......@@ -53,23 +53,36 @@
;; UNSPEC usage:
(define_constants
[(UNSPEC_SCAS 0)
(UNSPEC_SIN 1)
(UNSPEC_COS 2)
(UNSPEC_STACK_PROBE 3)
(UNSPEC_STACK_ALLOC 4)
(UNSPEC_BSF 5)
(UNSPEC_GOT 6)
(UNSPEC_GOTOFF 7)
(UNSPEC_PLT 8)
(UNSPEC_FNSTSW 9)
(UNSPEC_SAHF 10)
(UNSPEC_FSTCW 11)
(UNSPEC_ADD_CARRY 12)
[; Relocation specifiers
(UNSPEC_GOT 0)
(UNSPEC_GOTOFF 1)
(UNSPEC_GOTPCREL 2)
(UNSPEC_GOTTPOFF 3)
(UNSPEC_TPOFF 4)
(UNSPEC_NTPOFF 5)
(UNSPEC_DTPOFF 6)
; Prologue support
(UNSPEC_STACK_PROBE 10)
(UNSPEC_STACK_ALLOC 11)
(UNSPEC_SET_GOT 12)
(UNSPEC_SSE_PROLOGUE_SAVE 13)
(UNSPEC_FLDCW 14)
(UNSPEC_GOTPCREL 15)
(UNSPEC_SET_GOT 16)
; TLS support
(UNSPEC_TP 15)
(UNSPEC_TLS_GD 16)
(UNSPEC_TLS_LD_BASE 17)
; Other random patterns
(UNSPEC_SCAS 20)
(UNSPEC_SIN 21)
(UNSPEC_COS 22)
(UNSPEC_BSF 23)
(UNSPEC_FNSTSW 24)
(UNSPEC_SAHF 25)
(UNSPEC_FSTCW 26)
(UNSPEC_ADD_CARRY 27)
(UNSPEC_FLDCW 28)
; For SSE/MMX support:
(UNSPEC_FIX 30)
......@@ -13330,6 +13343,127 @@
;; ffshi2 is not useful -- 4 word prefix ops are needed, which is larger
;; and slower than the two-byte movzx insn needed to do the work in SImode.
;; Thread-local storage patterns for ELF.
;;
;; Note that these code sequences must appear exactly as shown
;; in order to allow linker relaxation.
(define_insn "*tls_global_dynamic_gnu"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(match_operand:SI 1 "register_operand" "b")
(match_operand:SI 2 "tls_symbolic_operand" "")
(match_operand:SI 3 "call_insn_operand" "")]
UNSPEC_TLS_GD))
(clobber (match_scratch:SI 4 "=d"))
(clobber (match_scratch:SI 5 "=c"))
(clobber (reg:CC 17))]
"TARGET_GNU_TLS"
"lea{l}\t{%a2@TLSGD(,%1,1), %0|%0, %a2@TLSGD[%1*1]}\;call\t%P3"
[(set_attr "type" "multi")
(set_attr "length" "12")])
(define_insn "*tls_global_dynamic_sun"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(match_operand:SI 1 "register_operand" "b")
(match_operand:SI 2 "tls_symbolic_operand" "")
(match_operand:SI 3 "call_insn_operand" "")]
UNSPEC_TLS_GD))
(clobber (match_scratch:SI 4 "=d"))
(clobber (match_scratch:SI 5 "=c"))
(clobber (reg:CC 17))]
"TARGET_SUN_TLS"
"lea{l}\t{%a2@DTLNDX(%1), %4|%4, %a2@DTLNDX[%1]}
push{l}\t%4\;call\t%a2@TLSPLT\;pop{l}\t%4\;nop"
[(set_attr "type" "multi")
(set_attr "length" "14")])
(define_expand "tls_global_dynamic"
[(parallel [(set (match_operand:SI 0 "register_operand" "")
(unspec:SI
[(match_dup 2)
(match_operand:SI 1 "tls_symbolic_operand" "")
(match_dup 3)]
UNSPEC_TLS_GD))
(clobber (match_scratch:SI 4 ""))
(clobber (match_scratch:SI 5 ""))
(clobber (reg:CC 17))])]
""
{
if (!flag_pic)
abort ();
current_function_uses_pic_offset_table = 1;
operands[2] = pic_offset_table_rtx;
operands[3] = ix86_tls_get_addr ();
})
(define_insn "*tls_local_dynamic_base_gnu"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(match_operand:SI 1 "register_operand" "b")
(match_operand:SI 2 "call_insn_operand" "")]
UNSPEC_TLS_LD_BASE))
(clobber (match_scratch:SI 3 "=d"))
(clobber (match_scratch:SI 4 "=c"))
(clobber (reg:CC 17))]
"TARGET_GNU_TLS"
"lea{l}\t{%&@TLSLDM(%1), %0|%0, %&@TLSLDM[%1]}\;call\t%P2"
[(set_attr "type" "multi")
(set_attr "length" "11")])
(define_insn "*tls_local_dynamic_base_sun"
[(set (match_operand:SI 0 "register_operand" "=a")
(unspec:SI [(match_operand:SI 1 "register_operand" "b")
(match_operand:SI 2 "call_insn_operand" "")]
UNSPEC_TLS_LD_BASE))
(clobber (match_scratch:SI 3 "=d"))
(clobber (match_scratch:SI 4 "=c"))
(clobber (reg:CC 17))]
"TARGET_SUN_TLS"
"lea{l}\t{%&@TMDNX(%1), %3|%3, %&@TMDNX[%1]}
push{l}\t%3\;call\t%&@TLSPLT\;pop{l}\t%3"
[(set_attr "type" "multi")
(set_attr "length" "13")])
(define_expand "tls_local_dynamic_base"
[(parallel [(set (match_operand:SI 0 "register_operand" "")
(unspec:SI [(match_dup 1) (match_dup 2)]
UNSPEC_TLS_LD_BASE))
(clobber (match_scratch:SI 3 ""))
(clobber (match_scratch:SI 4 ""))
(clobber (reg:CC 17))])]
""
{
if (!flag_pic)
abort ();
current_function_uses_pic_offset_table = 1;
operands[1] = pic_offset_table_rtx;
operands[2] = ix86_tls_get_addr ();
})
;; Local dynamic of a single variable is a lose. Show combine how
;; to convert that back to global dynamic.
(define_insn_and_split "*tls_local_dynamic_once"
[(set (match_operand:SI 0 "register_operand" "=a")
(plus:SI (unspec:SI [(match_operand:SI 1 "register_operand" "b")
(match_operand:SI 2 "call_insn_operand" "")]
UNSPEC_TLS_LD_BASE)
(const:SI (unspec:SI
[(match_operand:SI 3 "tls_symbolic_operand" "")]
UNSPEC_DTPOFF))))
(clobber (match_scratch:SI 4 "=d"))
(clobber (match_scratch:SI 5 "=c"))
(clobber (reg:CC 17))]
""
"#"
""
[(parallel [(set (match_dup 0)
(unspec:SI [(match_dup 1) (match_dup 3) (match_dup 2)]
UNSPEC_TLS_GD))
(clobber (match_dup 4))
(clobber (match_dup 5))
(clobber (reg:CC 17))])]
"")
;; These patterns match the binary 387 instructions for addM3, subM3,
;; mulM3 and divM3. There are three patterns for each of DFmode and
;; SFmode. The first is the normal insn, the second the same insn but
......
......@@ -7244,7 +7244,7 @@ libgcc_visibility=$gcc_cv_as_hidden
echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
echo "configure:7228: checking assembler leb128 support" >&5
echo "configure:7248: checking assembler leb128 support" >&5
gcc_cv_as_leb128=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
......@@ -7289,7 +7289,7 @@ fi
echo "$ac_t""$gcc_cv_as_leb128" 1>&6
echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
echo "configure:7273: checking assembler eh_frame optimization" >&5
echo "configure:7293: checking assembler eh_frame optimization" >&5
gcc_cv_as_eh_frame=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
......@@ -7370,7 +7370,7 @@ fi
echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
echo "configure:7354: checking assembler section merging support" >&5
echo "configure:7374: checking assembler section merging support" >&5
gcc_cv_as_shf_merge=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
......@@ -7392,11 +7392,61 @@ EOF
fi
echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6
echo "configure:7397: checking assembler thread-local storage support" >&5
gcc_cv_as_tls=no
conftest_s=
tls_first_major=
tls_first_minor=
case "$target" in
i[34567]86-*-*)
conftest_s='
.section ".tdata","awT",@progbits
foo: .long 25
.text
movl %gs:0, %eax
leal foo@TLSGD(,%ebx,1), %eax
leal foo@TLSLDM(%ebx), %eax
leal foo@DTPOFF(%eax), %edx
movl foo@GOTTPOFF(%ebx), %eax
subl foo@GOTTPOFF(%ebx), %eax
movl $foo@TPOFF, %eax
subl $foo@TPOFF, %eax
leal foo@NTPOFF(%ecx), %eax'
tls_first_major=2
tls_first_minor=13
;;
esac
if test -z "$tls_first_major"; then
:
elif test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then
if test "$gcc_cv_gas_major_version" -eq "$tls_first_major" \
-a "$gcc_cv_gas_minor_version" -ge "$tls_first_minor" \
-o "$gcc_cv_gas_major_version" -gt "$tls_first_major"; then
gcc_cv_as_tls=yes
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
then
gcc_cv_as_tls=yes
fi
rm -f conftest.s conftest.o
fi
if test "$gcc_cv_as_tls" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_AS_TLS 1
EOF
fi
echo "$ac_t""$gcc_cv_as_tls" 1>&6
case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
echo "configure:7380: checking assembler supports explicit relocations" >&5
echo "configure:7450: checking assembler supports explicit relocations" >&5
if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7446,7 +7496,7 @@ EOF
;;
sparc*-*-*)
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
echo "configure:7430: checking assembler .register pseudo-op support" >&5
echo "configure:7500: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7474,7 +7524,7 @@ EOF
fi
echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
echo "configure:7458: checking assembler supports -relax" >&5
echo "configure:7528: checking assembler supports -relax" >&5
if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7502,7 +7552,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
echo "configure:7486: checking assembler and linker support unaligned pc related relocs" >&5
echo "configure:7556: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7529,7 +7579,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
echo "configure:7513: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
echo "configure:7583: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7570,7 +7620,7 @@ EOF
if test "x$gcc_cv_as_flags64" != xno; then
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
echo "configure:7554: checking for assembler offsetable %lo() support" >&5
echo "configure:7624: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7610,7 +7660,7 @@ EOF
i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
echo "configure:7594: checking assembler instructions" >&5
echo "configure:7664: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
......@@ -7637,7 +7687,7 @@ EOF
echo "$ac_t""$gcc_cv_as_instructions" 1>&6
echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
echo "configure:7621: checking assembler GOTOFF in data directives" >&5
echo "configure:7691: checking assembler GOTOFF in data directives" >&5
gcc_cv_as_gotoff_in_data=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then
......@@ -7667,7 +7717,7 @@ EOF
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
echo "configure:7651: checking assembler dwarf2 debug_line support" >&5
echo "configure:7721: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
......@@ -7723,7 +7773,7 @@ fi
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
echo "configure:7707: checking assembler --gdwarf2 support" >&5
echo "configure:7777: checking assembler --gdwarf2 support" >&5
gcc_cv_as_gdwarf2_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
......@@ -7752,7 +7802,7 @@ fi
echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
echo "configure:7736: checking assembler --gstabs support" >&5
echo "configure:7806: checking assembler --gstabs support" >&5
gcc_cv_as_gstabs_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
......@@ -7780,7 +7830,7 @@ fi
echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
echo "configure:7764: checking linker PT_GNU_EH_FRAME support" >&5
echo "configure:7834: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
......@@ -7943,7 +7993,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
echo "configure:7927: checking whether to enable maintainer-specific portions of Makefiles" >&5
echo "configure:7997: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
......
......@@ -1718,6 +1718,55 @@ if test x"$gcc_cv_as_shf_merge" = xyes; then
fi
AC_MSG_RESULT($gcc_cv_as_shf_merge)
AC_MSG_CHECKING(assembler thread-local storage support)
gcc_cv_as_tls=no
conftest_s=
tls_first_major=
tls_first_minor=
case "$target" in
changequote(,)dnl
i[34567]86-*-*)
changequote([,])dnl
conftest_s='
.section ".tdata","awT",@progbits
foo: .long 25
.text
movl %gs:0, %eax
leal foo@TLSGD(,%ebx,1), %eax
leal foo@TLSLDM(%ebx), %eax
leal foo@DTPOFF(%eax), %edx
movl foo@GOTTPOFF(%ebx), %eax
subl foo@GOTTPOFF(%ebx), %eax
movl $foo@TPOFF, %eax
subl $foo@TPOFF, %eax
leal foo@NTPOFF(%ecx), %eax'
tls_first_major=2
tls_first_minor=13
;;
esac
if test -z "$tls_first_major"; then
:
elif test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then
if test "$gcc_cv_gas_major_version" -eq "$tls_first_major" \
-a "$gcc_cv_gas_minor_version" -ge "$tls_first_minor" \
-o "$gcc_cv_gas_major_version" -gt "$tls_first_major"; then
gcc_cv_as_tls=yes
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
then
gcc_cv_as_tls=yes
fi
rm -f conftest.s conftest.o
fi
if test "$gcc_cv_as_tls" = yes; then
AC_DEFINE(HAVE_AS_TLS, 1,
[Define if your assembler supports thread-local storage.])
fi
AC_MSG_RESULT($gcc_cv_as_tls)
case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment