On Thu, Jul 28, 2011 at 8:52 AM, Uros Bizjak <ubiz...@gmail.com> wrote:

>> TLS on X32 is almost identical to TLS on x86-64.  The only difference is
>> x32 address space is 32bit.  That means TLS symbols can be in either
>> SImode or DImode with upper 32bit zero.  This patch updates
>> tls_global_dynamic_64 to support x32.  OK for trunk?

Please also change 64bit GNU2_TLS patterns, so -mtls-dialect=gnu2 will
also work.  Please see attached patch.

Uros.
Index: i386.md
===================================================================
--- i386.md     (revision 176860)
+++ i386.md     (working copy)
@@ -12327,7 +12327,7 @@
        (call:DI
         (mem:QI (match_operand:DI 2 "constant_call_address_operand" "z"))
         (match_operand:DI 3 "" "")))
-   (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+   (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
              UNSPEC_TLS_GD)]
   "TARGET_64BIT"
 {
@@ -12349,7 +12349,7 @@
          (call:DI
           (mem:QI (match_operand:DI 2 "constant_call_address_operand" ""))
           (const_int 0)))
-     (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+     (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
                UNSPEC_TLS_GD)])])
 
 (define_insn "*tls_local_dynamic_base_32_gnu"
@@ -12553,7 +12553,7 @@
 
 (define_expand "tls_dynamic_gnu2_64"
   [(set (match_dup 2)
-       (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+       (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
                   UNSPEC_TLSDESC))
    (parallel
     [(set (match_operand:DI 0 "register_operand" "")
@@ -12568,7 +12568,7 @@
 
 (define_insn "*tls_dynamic_lea_64"
   [(set (match_operand:DI 0 "register_operand" "=r")
-       (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+       (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
                   UNSPEC_TLSDESC))]
   "TARGET_64BIT && TARGET_GNU2_TLS"
   "lea{q}\t{%a1@TLSDESC(%%rip), %0|%0, %a1@TLSDESC[rip]}"
@@ -12579,7 +12579,7 @@
 
 (define_insn "*tls_dynamic_call_64"
   [(set (match_operand:DI 0 "register_operand" "=a")
-       (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")
+       (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")
                    (match_operand:DI 2 "register_operand" "0")
                    (reg:DI SP_REG)]
                   UNSPEC_TLSDESC))
@@ -12598,7 +12598,7 @@
                     (reg:DI SP_REG)]
                    UNSPEC_TLSDESC)
         (const:DI (unspec:DI
-                   [(match_operand:DI 1 "tls_symbolic_operand" "")]
+                   [(match_operand 1 "tls_symbolic_operand" "")]
                    UNSPEC_DTPOFF))))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && TARGET_GNU2_TLS"

Reply via email to