> +  fmt = GET_RTX_FORMAT (GET_CODE (x));
> +  for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
> +    {
> +      if (fmt[i] == 'E')
> +     {
> +       int j;
> +
> +       for (j = XVECLEN (x, i) - 1; j >= 0; j--)
> +         if (! is_legitimate_tls_operand (XVECEXP (x, i, j)))
> +           return false;
> +     }
> +      else if (fmt[i] == 'e' && ! is_legitimate_tls_operand (XEXP (x, i)))
> +     return false;

Do you really want to find such an unspec buried in arbitrary rtl?
That seems in conflict with the term "legitimate".  But supposing
that you really do, this code should use for_each_rtx.

> @@ -1908,6 +2007,9 @@
>    const char *fmt;
>    int i;
>  
> +  if (is_legitimate_tls_operand (x))

Please remember to use -p in generating the diff, for function context.

> +(define_predicate "tls_symbolic_operand"
> +  (match_code "symbol_ref")
> +{
> +  return SYMBOL_REF_TLS_MODEL (op);
> +})

I'm pretty sure you also want to test for (const (plus (symbol) (int)).

> +(define_predicate "nontls_general_operand"
> +  (match_code 
> "const_int,const_double,const,symbol_ref,label_ref,subreg,reg,mem")
> +{
> +  if (tls_symbolic_operand (op, mode))
> +    return false;
> +  return general_operand (op, mode);
> +})

Simpler as

(define_predicate "nontls_general_operand"
  (and (match_operand "general_operand" 0)
       (not (match_operand "tls_symbolic_operand" 0)))

> +#define PRINT_OPERAND_PUNCT_VALID_P(CODE)  ((CODE) == '&')

This is now a target hook.

> +mn10300_tls_get_addr (void)
> +{
> +  return gen_rtx_REG (Pmode, TLS_REG);
> +}

Most seriously, I don't see TLS_REG become fixed.  And some note
that this is an ABI change.


r~

Reply via email to