[RFC][PATCH 0/2] Make sparcv8 work again on cas enabled hardware

Andreas Larsson andreas@gaisler.com
Fri Nov 4 10:28:00 GMT 2016


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.

-- 
Best regards,
Andreas Larson



More information about the Libc-alpha mailing list