public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Arm assembler crc issue
@ 2023-10-19 16:41 Iain Sandoe
  2023-10-19 17:06 ` Iain Sandoe
  2023-10-19 21:49 ` Richard Sandiford
  0 siblings, 2 replies; 4+ messages in thread
From: Iain Sandoe @ 2023-10-19 16:41 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: GCC Development

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

no longer recognises fp16 insns. (and appending +fp16 does not fix this).

====

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-19 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 16:41 Arm assembler crc issue Iain Sandoe
2023-10-19 17:06 ` Iain Sandoe
2023-10-19 21:49 ` Richard Sandiford
2023-10-19 21:58   ` Iain Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).