Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-21 Thread Uros Bizjak
On Tue, Jan 21, 2020 at 8:16 PM H.J. Lu wrote: > > On Tue, Jan 21, 2020 at 2:29 AM Uros Bizjak wrote: > > > > On Tue, Jan 21, 2020 at 9:47 AM Uros Bizjak wrote: > > > > > > On Mon, Jan 20, 2020 at 10:46 PM H.J. Lu wrote: > > > > > > > > > OK. Let's go with this version, but please investigate i

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-21 Thread H.J. Lu
On Tue, Jan 21, 2020 at 2:29 AM Uros Bizjak wrote: > > On Tue, Jan 21, 2020 at 9:47 AM Uros Bizjak wrote: > > > > On Mon, Jan 20, 2020 at 10:46 PM H.J. Lu wrote: > > > > > > > OK. Let's go with this version, but please investigate if we need to > > > > > calculate TLS address in ptr_mode instead

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-21 Thread Uros Bizjak
On Tue, Jan 21, 2020 at 9:47 AM Uros Bizjak wrote: > > On Mon, Jan 20, 2020 at 10:46 PM H.J. Lu wrote: > > > > > OK. Let's go with this version, but please investigate if we need to > > > > calculate TLS address in ptr_mode instead of Pmode. Due to quite some > > > > zero-extension from ptr_mode

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-21 Thread Uros Bizjak
On Mon, Jan 20, 2020 at 10:46 PM H.J. Lu wrote: > > > OK. Let's go with this version, but please investigate if we need to > > > calculate TLS address in ptr_mode instead of Pmode. Due to quite some > > > zero-extension from ptr_mode to Pmode hacks in this area, it looks to > > > me that the whol

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-20 Thread H.J. Lu
On Mon, Jan 20, 2020 at 5:24 AM H.J. Lu wrote: > > On Sun, Jan 19, 2020 at 11:53 PM Uros Bizjak wrote: > > > > On Sun, Jan 19, 2020 at 10:00 PM H.J. Lu wrote: > > > > > > On Sun, Jan 19, 2020 at 12:16 PM Uros Bizjak wrote: > > > > > > > > On Sun, Jan 19, 2020 at 9:07 PM H.J. Lu wrote: > > > >

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-20 Thread H.J. Lu
On Sun, Jan 19, 2020 at 11:53 PM Uros Bizjak wrote: > > On Sun, Jan 19, 2020 at 10:00 PM H.J. Lu wrote: > > > > On Sun, Jan 19, 2020 at 12:16 PM Uros Bizjak wrote: > > > > > > On Sun, Jan 19, 2020 at 9:07 PM H.J. Lu wrote: > > > > > > > > On Sun, Jan 19, 2020 at 12:01 PM Uros Bizjak wrote: > >

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread Uros Bizjak
On Sun, Jan 19, 2020 at 10:00 PM H.J. Lu wrote: > > On Sun, Jan 19, 2020 at 12:16 PM Uros Bizjak wrote: > > > > On Sun, Jan 19, 2020 at 9:07 PM H.J. Lu wrote: > > > > > > On Sun, Jan 19, 2020 at 12:01 PM Uros Bizjak wrote: > > > > > > > > On Sun, Jan 19, 2020 at 7:07 PM H.J. Lu wrote: > > > >

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread H.J. Lu
On Sun, Jan 19, 2020 at 12:16 PM Uros Bizjak wrote: > > On Sun, Jan 19, 2020 at 9:07 PM H.J. Lu wrote: > > > > On Sun, Jan 19, 2020 at 12:01 PM Uros Bizjak wrote: > > > > > > On Sun, Jan 19, 2020 at 7:07 PM H.J. Lu wrote: > > > > > > > > On Sun, Jan 19, 2020 at 9:48 AM Uros Bizjak wrote: > > >

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread Uros Bizjak
On Sun, Jan 19, 2020 at 9:07 PM H.J. Lu wrote: > > On Sun, Jan 19, 2020 at 12:01 PM Uros Bizjak wrote: > > > > On Sun, Jan 19, 2020 at 7:07 PM H.J. Lu wrote: > > > > > > On Sun, Jan 19, 2020 at 9:48 AM Uros Bizjak wrote: > > > > > > > > On Sun, Jan 19, 2020 at 6:43 PM Uros Bizjak wrote: > > >

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread H.J. Lu
On Sun, Jan 19, 2020 at 12:01 PM Uros Bizjak wrote: > > On Sun, Jan 19, 2020 at 7:07 PM H.J. Lu wrote: > > > > On Sun, Jan 19, 2020 at 9:48 AM Uros Bizjak wrote: > > > > > > On Sun, Jan 19, 2020 at 6:43 PM Uros Bizjak wrote: > > > > > > > > On Sun, Jan 19, 2020 at 2:58 PM H.J. Lu wrote: > > >

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread Uros Bizjak
On Sun, Jan 19, 2020 at 7:07 PM H.J. Lu wrote: > > On Sun, Jan 19, 2020 at 9:48 AM Uros Bizjak wrote: > > > > On Sun, Jan 19, 2020 at 6:43 PM Uros Bizjak wrote: > > > > > > On Sun, Jan 19, 2020 at 2:58 PM H.J. Lu wrote: > > > > > > > > To add x32 support to -mtls-dialect=gnu2, we need to replac

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread H.J. Lu
On Sun, Jan 19, 2020 at 9:48 AM Uros Bizjak wrote: > > On Sun, Jan 19, 2020 at 6:43 PM Uros Bizjak wrote: > > > > On Sun, Jan 19, 2020 at 2:58 PM H.J. Lu wrote: > > > > > > To add x32 support to -mtls-dialect=gnu2, we need to replace DI with > > > P in GNU2 TLS patterns. Since thread pointer is

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread Uros Bizjak
On Sun, Jan 19, 2020 at 6:43 PM Uros Bizjak wrote: > > On Sun, Jan 19, 2020 at 2:58 PM H.J. Lu wrote: > > > > To add x32 support to -mtls-dialect=gnu2, we need to replace DI with > > P in GNU2 TLS patterns. Since thread pointer is in ptr_mode, PLUS in > > GNU2 TLS address computation must be don

Re: [PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread Uros Bizjak
On Sun, Jan 19, 2020 at 2:58 PM H.J. Lu wrote: > > To add x32 support to -mtls-dialect=gnu2, we need to replace DI with > P in GNU2 TLS patterns. Since thread pointer is in ptr_mode, PLUS in > GNU2 TLS address computation must be done in ptr_mode to support > -maddress-mode=long. Also drop the "

[PATCH] PR target/93319: x32: Add x32 support to -mtls-dialect=gnu2

2020-01-19 Thread H.J. Lu
To add x32 support to -mtls-dialect=gnu2, we need to replace DI with P in GNU2 TLS patterns. Since thread pointer is in ptr_mode, PLUS in GNU2 TLS address computation must be done in ptr_mode to support -maddress-mode=long. Also drop the "q" suffix from lea to support both "lea foo@TLSDESC(%rip),