fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

Alex Bradbury

@conor I'm concerned that some ISA naming string changes (in the form consumed by -march at least) might cause issues for downstream build systems. I'm suggesting more lax parsing to try to prevent this reviews.llvm.org/D149246 - I'd be interested on your thoughts on e.g. If the kernel build system could be impacted: as it stands, released GCC wants z* extensions before s* (though this was fixed recently) while clang wants the opposite. Hoping to avoid a similar mess to build attributes here...

reviews.llvm.org⚙ D149246 [RISCV] Relax rules for ordering s/z/x prefixed extensions in ISA naming strings

@asb I've been occasionally bitten by GCC's handling of -march strings, and yes please, when I pass a list of extensions I really want the tools to just take the union of those instructions as long as it's unambiguous and there is no opcode overlap.

The rules aren't well-specified and even people on the RISC-V tech lists don't seem to agree on all cases, such as compatibility of C with Zcmp when F/D are not implemented.

@asb How to I reply to that thing by email?
@asb Assuming that I cannot reply by email, I would very much be in favour of keeping the things aligned.

From a kernel PoV, we don't yet have any X stuff to worry about w/ march at the moment as the only vendor specific stuff is handballed asm (see arch/riscv/include/asm/errata_list.h).
There's no S stuff that we pass to the compiler yet either as far as a quick check reports.

Alignment with gcc is helpful, permissiveness is better?
Given "canonical order" can, and has, change(d) in the past I think it's good to insulate against it happening again.
Conjuring up march is bad enough as things stand w/ availability with given toolchain versions (I kinda hit a brick wall with rust + gcc as I don't know how to test what version of libclang bindgen is backed by).
Having to do special handing of different versions of gcc/clang whenever we do actually need to add Sfoo or Xfoo sounds like another layer of misery I would love to avoid.

Ideally one order would work for all versions of gcc and clang, but it doesn't sound like it is?
- So gcc wanted Z before X, but it now does what? Allows any order? (The
comment about "this was fixed recently" confuses me a bit, sorry)

- clang used to want Z/X/S & now wants Z/S/X? Is it too late to avoid a released clang
that uses Z/S/X rather than your suggested permissive behaviour?

Also CC @palmer :)
@conor @asb I just replied on the Phabricator (there's a box down at the bottom), I don't do LLVM stuff so I don't have an email setup.

Also: I think we should just give up on ISA strings, they're a mess.

@conor @palmer the gcc change is github.com/gcc-mirror/gcc/comm - it moved to z/s/x like clang HEAD (and the spec), but as this has changed multiple times now I think moving to something more permissive is the only sensible path - glad to get some external validation of that opinion. The next Clang/LLVM release won't branch until middle of the year, so there's time to sort things out before then.

GitHubRISC-V: Adjust the parsing order of extensions to be consistent with … · gcc-mirror/gcc@4204ed2…riscv-spec and binutils. The current order of gcc and binutils parsing extensions is inconsistent. According to latest risc-v spec, the canonical order in which extension names must appear in th...
@asb @conor IMO we've made a mess of the ISA string parsing in GCC by trying to pass through all these unknown extensions. It's kind of a grey area as to whether or not they're an interface break (because upstream binutils doesn't support them), but it's certainly made for some very complicated code.
@asb @palmer I'll make an account for this llvm thing later & copy-pasta into that if that helps.

Permissive would be great, as hopefully we can stick to one order in the future.
Looks like we'll probably have to do some Makefile dance around older gcc/clang versions but at least going forward it should be not too bad.
@asb @palmer Actually, what worries me is sorting out AFLAGS etc in mixed configurations. Deal with that iff it comes up though I guess! I don't blame the TC folks though for any of this :)
@conor @asb There's nothing we can do to fix the ISA string problems, but we should at least document what we accept in GCC...

@conor I don't think you can as an unregistered user unfortunately