rtx ix86_compare_op0 = NULL_RTX;
rtx ix86_compare_op1 = NULL_RTX;
-/* The encoding characters for the four TLS models present in ELF. */
-
-static char const tls_model_chars[] = " GLil";
-
#define MAX_386_STACK_LOCALS 3
/* Size of the register save area. */
#define X86_64_VARARGS_SIZE (REGPARM_MAX * UNITS_PER_WORD + SSE_REGPARM_MAX * 16)
static bool ix86_cannot_force_const_mem PARAMS ((rtx));
static rtx ix86_delegitimize_address PARAMS ((rtx));
-static void ix86_encode_section_info PARAMS ((tree, int)) ATTRIBUTE_UNUSED;
-static const char *ix86_strip_name_encoding PARAMS ((const char *))
- ATTRIBUTE_UNUSED;
-
struct builtin_description;
static rtx ix86_expand_sse_comi PARAMS ((const struct builtin_description *,
tree, rtx));
if (GET_CODE (op) != SYMBOL_REF)
return 0;
- /* These we've been told are local by varasm and encode_section_info
- respectively. */
- if (CONSTANT_POOL_ADDRESS_P (op) || SYMBOL_REF_FLAG (op))
+ if (SYMBOL_REF_LOCAL_P (op))
return 1;
/* There is, however, a not insubstantial body of code in the rest of
return 0;
}
-/* Test for various thread-local symbols. See ix86_encode_section_info. */
+/* Test for various thread-local symbols. */
int
tls_symbolic_operand (op, mode)
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
- const char *symbol_str;
-
if (GET_CODE (op) != SYMBOL_REF)
return 0;
- symbol_str = XSTR (op, 0);
-
- if (symbol_str[0] != '%')
- return 0;
- return strchr (tls_model_chars, symbol_str[1]) - tls_model_chars;
+ return SYMBOL_REF_TLS_MODEL (op);
}
-static int
+static inline int
tls_symbolic_operand_1 (op, kind)
rtx op;
enum tls_model kind;
{
- const char *symbol_str;
-
if (GET_CODE (op) != SYMBOL_REF)
return 0;
- symbol_str = XSTR (op, 0);
-
- return symbol_str[0] == '%' && symbol_str[1] == tls_model_chars[kind];
+ return SYMBOL_REF_TLS_MODEL (op) == kind;
}
int
return 0;
if (GET_CODE (disp) == SYMBOL_REF
&& ix86_cmodel == CM_SMALL_PIC
- && (CONSTANT_POOL_ADDRESS_P (disp)
- || SYMBOL_REF_FLAG (disp)))
+ && SYMBOL_REF_LOCAL_P (disp))
return 1;
if (GET_CODE (disp) == LABEL_REF)
return 1;
&& GET_CODE (XEXP (disp, 0)) == PLUS
&& ((GET_CODE (XEXP (XEXP (disp, 0), 0)) == SYMBOL_REF
&& ix86_cmodel == CM_SMALL_PIC
- && (CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (disp, 0), 0))
- || SYMBOL_REF_FLAG (XEXP (XEXP (disp, 0), 0))))
+ && SYMBOL_REF_LOCAL_P (XEXP (XEXP (disp, 0), 0)))
|| GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF)
&& GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT
&& INTVAL (XEXP (XEXP (disp, 0), 1)) < 16*1024*1024
2. Static data references, constant pool addresses, and code labels
compute the address as an offset from the GOT, whose base is in
- the PIC reg. Static data objects have SYMBOL_REF_FLAG set to
+ the PIC reg. Static data objects have SYMBOL_FLAG_LOCAL set to
differentiate them from global data objects. The returned
address is the PIC reg + an unspec constant.
}
return new;
}
-
-static void
-ix86_encode_section_info (decl, first)
- tree decl;
- int first ATTRIBUTE_UNUSED;
-{
- bool local_p = (*targetm.binds_local_p) (decl);
- rtx rtl, symbol;
-
- rtl = DECL_P (decl) ? DECL_RTL (decl) : TREE_CST_RTL (decl);
- if (GET_CODE (rtl) != MEM)
- return;
- symbol = XEXP (rtl, 0);
- if (GET_CODE (symbol) != SYMBOL_REF)
- return;
-
- /* For basic x86, if using PIC, mark a SYMBOL_REF for a non-global
- symbol so that we may access it directly in the GOT. */
-
- if (flag_pic)
- SYMBOL_REF_FLAG (symbol) = local_p;
-
- /* For ELF, encode thread-local data with %[GLil] for "global dynamic",
- "local dynamic", "initial exec" or "local exec" TLS models
- respectively. */
-
- if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
- {
- const char *symbol_str;
- char *newstr;
- size_t len;
- enum tls_model kind = decl_tls_model (decl);
-
- if (TARGET_64BIT && ! flag_pic)
- {
- /* x86-64 doesn't allow non-pic code for shared libraries,
- so don't generate GD/LD TLS models for non-pic code. */
- switch (kind)
- {
- case TLS_MODEL_GLOBAL_DYNAMIC:
- kind = TLS_MODEL_INITIAL_EXEC; break;
- case TLS_MODEL_LOCAL_DYNAMIC:
- kind = TLS_MODEL_LOCAL_EXEC; break;
- default:
- break;
- }
- }
-
- symbol_str = XSTR (symbol, 0);
-
- if (symbol_str[0] == '%')
- {
- if (symbol_str[1] == tls_model_chars[kind])
- return;
- symbol_str += 2;
- }
- len = strlen (symbol_str) + 1;
- newstr = alloca (len + 2);
-
- newstr[0] = '%';
- newstr[1] = tls_model_chars[kind];
- memcpy (newstr + 2, symbol_str, len);
-
- XSTR (symbol, 0) = ggc_alloc_string (newstr, len + 2 - 1);
- }
-}
-
-/* Undo the above when printing symbol names. */
-
-static const char *
-ix86_strip_name_encoding (str)
- const char *str;
-{
- if (str[0] == '%')
- str += 2;
- if (str [0] == '*')
- str += 1;
- return str;
-}
\f
/* Load the thread pointer into a register. */