This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH 0/2] Make sparcv8 work again on cas enabled hardware
- From: David Miller <davem at davemloft dot net>
- To: andreas at gaisler dot com
- Cc: triegel at redhat dot com, libc-alpha at sourceware dot org, adhemerval dot zanella at linaro dot org, carlos at redhat dot com, software at gaisler dot com
- Date: Fri, 04 Nov 2016 11:22:54 -0400 (EDT)
- Subject: Re: [RFC][PATCH 0/2] Make sparcv8 work again on cas enabled hardware
- Authentication-results: sourceware.org; auth=none
- References: <1478187561.7146.742.camel@localhost.localdomain> <20161103.132213.598669006383889263.davem@davemloft.net> <581C62A2.8050204@gaisler.com>
From: Andreas Larsson <andreas@gaisler.com>
Date: Fri, 04 Nov 2016 11:27:46 +0100
> On 2016-11-03 18:22, David Miller wrote:
>> From: Torvald Riegel <triegel@redhat.com>
>> Date: Thu, 03 Nov 2016 16:39:21 +0100
>>
>>> Is there any difference between the additional CAS on a v8 and the CAS
>>> on a v9? If there should be none (eg, same instruciton encoding
>>> etc.),
>>> we wouldn't need a runtime check for this, would we?
>>
>> A quick look at binutils shows that the encoding appears to be the
>> same.
>
> The general encoding of the CASA instruction is the same, but on
> sparcv9 the ASI to use is the primary address space ASI 0x80 and on
> LEON the ASI to use is the user data space ASI 0xa. So different
> instruction encodings needs to be used.
>
> Unfortunately there is no way general way short of trying to use the
> CASA instruction and taking a care of a possible illegal instruction
> to detect if a LEON3 system has CAS or not. But CAS support is implied
> by the the -mcpu=leon3 flag, and LEON3 systems without CAS can use
> -mcpu=v8.
This really should be advertised in the _dl_hwcaps. We should try as
hard as possible to allow dynamic discovery of this.