Patchwork [cxx-mem-model] Handle x86-64 with -m32

login
register
mail settings
Submitter Aldy Hernandez
Date Oct. 20, 2011, 9:02 p.m.
Message ID <4EA08C57.7030204@redhat.com>
Download mbox | patch
Permalink /patch/120878/
State New
Headers show

Comments

Aldy Hernandez - Oct. 20, 2011, 9:02 p.m.
These operations don't exist on x86-32 bits, and when running multilibed 
tests, the target is still x86_64-unknown-linux-gnu but the target is 
32-bits when using -m32.

The following change checks that we are actually running in 64-bits 
before assuming sync_int_128 or sync_long_long exist on the target.

OK for branch?
* lib/target-supports.exp (check_effective_target_sync_int_128):
	Only set when running in 64-bit mode.
	(check_effective_target_sync_long_long): Same.
Joseph S. Myers - Oct. 20, 2011, 10:38 p.m.
On Thu, 20 Oct 2011, Aldy Hernandez wrote:

> These operations don't exist on x86-32 bits, and when running multilibed
> tests, the target is still x86_64-unknown-linux-gnu but the target is 32-bits
> when using -m32.

Any test that only handles one of x86_64-* and i?86-* is automatically 
wrong; you can use -m64 with i?86-* targets.  You always need to handle 
both together.

Do these operations exist for x32 as well as for -m64?  If they do, then 
lp64 isn't the right test either; if not, then it is.
H.J. Lu - Oct. 20, 2011, 10:50 p.m.
On Thu, Oct 20, 2011 at 3:38 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Thu, 20 Oct 2011, Aldy Hernandez wrote:
>
>> These operations don't exist on x86-32 bits, and when running multilibed
>> tests, the target is still x86_64-unknown-linux-gnu but the target is 32-bits
>> when using -m32.
>
> Any test that only handles one of x86_64-* and i?86-* is automatically
> wrong; you can use -m64 with i?86-* targets.  You always need to handle
> both together.
>
> Do these operations exist for x32 as well as for -m64?  If they do, then
> lp64 isn't the right test either; if not, then it is.
>

X32 has native int64 and int128.
Andrew MacLeod - Oct. 21, 2011, 12:11 p.m.
On 10/20/2011 06:50 PM, H.J. Lu wrote:
> On Thu, Oct 20, 2011 at 3:38 PM, Joseph S. Myers
> <joseph@codesourcery.com>  wrote:
>>
>> Do these operations exist for x32 as well as for -m64?  If they do, then
>> lp64 isn't the right test either; if not, then it is.
>>
> X32 has native int64 and int128.
>
I presume there is no atomic support for int128 though, and thats what 
'condition check_effective_target_sync_int_128' is testing for.

Andrew
H.J. Lu - Oct. 21, 2011, 3:28 p.m.
On Fri, Oct 21, 2011 at 5:11 AM, Andrew MacLeod <amacleod@redhat.com> wrote:
> On 10/20/2011 06:50 PM, H.J. Lu wrote:
>>
>> On Thu, Oct 20, 2011 at 3:38 PM, Joseph S. Myers
>> <joseph@codesourcery.com>  wrote:
>>>
>>> Do these operations exist for x32 as well as for -m64?  If they do, then
>>> lp64 isn't the right test either; if not, then it is.
>>>
>> X32 has native int64 and int128.
>>
> I presume there is no atomic support for int128 though, and thats what
> 'condition check_effective_target_sync_int_128' is testing for.
>

X32 uses x86-64 instruction set with 32bit pointers.   It has the same
atomic support as x86-64 and has atomic support for int128.
Andrew MacLeod - Oct. 21, 2011, 4:08 p.m.
On 10/21/2011 11:28 AM, H.J. Lu wrote:
> On Fri, Oct 21, 2011 at 5:11 AM, Andrew MacLeod<amacleod@redhat.com>  wrote:
>>>
>>> X32 has native int64 and int128.
>>>
>> I presume there is no atomic support for int128 though, and thats what
>> 'condition check_effective_target_sync_int_128' is testing for.
>>
> X32 uses x86-64 instruction set with 32bit pointers.   It has the same
> atomic support as x86-64 and has atomic support for int128.

Oh, you aren't talking about 32 bit, but a 32 bit abi on a 64 bit machine.
H.J. Lu - Oct. 21, 2011, 4:15 p.m.
On Fri, Oct 21, 2011 at 9:08 AM, Andrew MacLeod <amacleod@redhat.com> wrote:
> On 10/21/2011 11:28 AM, H.J. Lu wrote:
>>
>> On Fri, Oct 21, 2011 at 5:11 AM, Andrew MacLeod<amacleod@redhat.com>
>>  wrote:
>>>>
>>>> X32 has native int64 and int128.
>>>>
>>> I presume there is no atomic support for int128 though, and thats what
>>> 'condition check_effective_target_sync_int_128' is testing for.
>>>
>> X32 uses x86-64 instruction set with 32bit pointers.   It has the same
>> atomic support as x86-64 and has atomic support for int128.
>
> Oh, you aren't talking about 32 bit, but a 32 bit abi on a 64 bit machine.
>

Yes.

Patch

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 180156)
+++ lib/target-supports.exp	(working copy)
@@ -3456,7 +3456,7 @@  proc check_effective_target_sync_int_128
         verbose "check_effective_target_sync_int_128: using cached result" 2
     } else {
         set et_sync_int_128_saved 0
-        if { [istarget x86_64-*-*] } {
+        if { [istarget x86_64-*-*] && [is-effective-target lp64] } {
            set et_sync_int_128_saved 1
         }
     }
@@ -3474,7 +3474,7 @@  proc check_effective_target_sync_long_lo
         verbose "check_effective_target_sync_long_long: using cached result" 2
     } else {
         set et_sync_long_long_saved 0
-        if { [istarget x86_64-*-*] } {
+        if { [istarget x86_64-*-*] && [is-effective-target lp64] } {
            set et_sync_long_long_saved 1
         }
     }