correction ...

> On 19 Oct 2023, at 17:41, Iain Sandoe <i...@sandoe.co.uk> wrote:
> 
> Hi Richard,
> 
> 
> I am being bitten by a problem that falls out from the code that emits
> 
>       .arch Armv8.n-a+crc
> 
> when the arch is less than Armv8-r.
> The code that does this,  in gcc/common/config/aarch64 is quite recent 
> (2022-09).
> 
> ------
> 
> (I admit the permutations are complex and I might have miss-analyzed) - but 
> it appears that llvm assembler (for mach-o, at least) sees an explict mention 
> of an attribute for a feature which is mandatory at a specified arch level as 
> demoting that arch to the minimum that made the explicit feature mandatory.  
> Of course, it could just be a bug in the handling of transitive feature 
> enables...
> 
> the problem is that, for example:
> 
>       .arch Armv8.4-a+crc

We are trying to set suitable arch values for apple-a12, apple-m1 and apple-m2;

apple-m1 (as far as i can determine) is   armv8.4-a+fp16+sb+ssbs.

However, the code mentioned emits this as:
        armv8.4-a+crc+fp16+sb+ssbs.

and the LLVM assembler no longer recognises fp16 insns. (the appended +fp16 
does not work).

> ====
> 
> Even if upstream LLVM is deemed to be buggy (it does not do what I would 
> expect, at least), and fixed - I will still have a bunch of assembler 
> versions that are broken (before the fix percolates through to downstream 
> xcode) - and the LLVM assembler is the only current option for Darwin.
> 
> So, it seems that this ought to be a reasonable configure test:
> 
>       .arch armv8.2-a
>       .text
> m:
>       crc32b w0, w1, w2 
> 
> and then emit HAS_GAS_AARCH64_CRC_BUG (for example) if that fails to assemble 
> which can be used to make the +crc emit conditional on a broken assembler.
> 
> - I am asking here before constructing the patch, in case there’s some reason 
> that doing this at configure time is not acceptable.
> 
> thanks
> Iain
> 

Reply via email to