Conversation
|
Looks like this'll need another rustc patch to skip the "scalable vectors aren't supported on this architecture" error for doc builds |
|
rust-lang/rust#154850 will fix this |
…, r=JonathanBrouwer ast_validation: scalable vectors okay for rustdoc Scalable vector types in `core_arch` are cfg'd for aarch64 and for rustdoc, which can successfully document these types given any `--target` (`core_arch` CI uses `i686-unknown-linux-gnu`) - this shouldn't trigger the "scalable vectors not supported on arch" error. This fixes the CI failure in rust-lang/stdarch#2071.
…, r=JonathanBrouwer ast_validation: scalable vectors okay for rustdoc Scalable vector types in `core_arch` are cfg'd for aarch64 and for rustdoc, which can successfully document these types given any `--target` (`core_arch` CI uses `i686-unknown-linux-gnu`) - this shouldn't trigger the "scalable vectors not supported on arch" error. This fixes the CI failure in rust-lang/stdarch#2071.
…, r=JonathanBrouwer ast_validation: scalable vectors okay for rustdoc Scalable vector types in `core_arch` are cfg'd for aarch64 and for rustdoc, which can successfully document these types given any `--target` (`core_arch` CI uses `i686-unknown-linux-gnu`) - this shouldn't trigger the "scalable vectors not supported on arch" error. This fixes the CI failure in rust-lang/stdarch#2071.
…, r=JonathanBrouwer ast_validation: scalable vectors okay for rustdoc Scalable vector types in `core_arch` are cfg'd for aarch64 and for rustdoc, which can successfully document these types given any `--target` (`core_arch` CI uses `i686-unknown-linux-gnu`) - this shouldn't trigger the "scalable vectors not supported on arch" error. This fixes the CI failure in rust-lang/stdarch#2071.
Rollup merge of #154850 - davidtwco:scalable-vectors-rustdoc, r=JonathanBrouwer ast_validation: scalable vectors okay for rustdoc Scalable vector types in `core_arch` are cfg'd for aarch64 and for rustdoc, which can successfully document these types given any `--target` (`core_arch` CI uses `i686-unknown-linux-gnu`) - this shouldn't trigger the "scalable vectors not supported on arch" error. This fixes the CI failure in rust-lang/stdarch#2071.
7203b17 to
d473c9a
Compare
|
rust-lang/rust#154950 will fix the current CI failure |
library: no `cfg(target_arch)` on scalable intrinsics These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway. Fixes CI failure in rust-lang/stdarch#2071
library: no `cfg(target_arch)` on scalable intrinsics These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway. Fixes CI failure in rust-lang/stdarch#2071
library: no `cfg(target_arch)` on scalable intrinsics These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway. Fixes CI failure in rust-lang/stdarch#2071
Rollup merge of #154950 - davidtwco:scalable-no-cfg, r=RalfJung library: no `cfg(target_arch)` on scalable intrinsics These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway. Fixes CI failure in rust-lang/stdarch#2071
library: no `cfg(target_arch)` on scalable intrinsics These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway. Fixes CI failure in rust-lang/stdarch#2071
| } | ||
| }) | ||
| }; | ||
| let return_type_conversion = self |
There was a problem hiding this comment.
It's probably the case that this signed/unsigned conversion isn't needed at all. Doesn't really cause any harm though
| ); | ||
| } | ||
|
|
||
| // Newer intrinsics don't have `rustc_legacy_const_generics` - assume they belong at |
There was a problem hiding this comment.
We could add this attribute for SVE intrinsics - see rust-lang/rust#149654. Some have pointed out that legacy generics is prone to bugs, but:
- It aids porting from C in a small way
- RfL really wants const args. I'm not sure if they necessarily want it for SIMD intrinsics though.
|
rust-lang/rust#154984 will fix this CI failure, eventually I'll just have issues on the stdarch side :) |
d473c9a to
6a6098b
Compare
6a6098b to
9401448
Compare
I've closed this and changed the patch to only add these intrinsics on |
library: no `cfg(target_arch)` on scalable intrinsics These intrinsics don't technically need to be limited to a specific architecture, they'll probably only make sense to use on AArch64, but this just makes it harder to use them in stdarch where it is appropriate (such as on `arm64ec`): requiring a rustc patch to land and be on nightly before stdarch work can proceed. So let's just not `cfg` them at all, they're perma-unstable anyway. Fixes CI failure in rust-lang/stdarch#2071
|
I've fixed the CI failures locally and I'm now hitting into some other issues that I'm working through, which require some rustc patches that I'll upstream as they're ready (rust-lang/rust#155106 to start off) |
This was accidentally removed in 713444d.
Instead of generating load/store tests based on the input filename - which no longer works given the expected input file structure of `stdarch-gen-arm` - add a simple global context option that SVE specs can set.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Pushed some more changes - nothing too significant:
This will fail CI until rust-lang/rust#155106 and rust-lang/rust#155243 are merged, both are approved. |
ce98d8a to
c21192c
Compare
Co-authored-by: Adam Gemmell <Adam.Gemmell@arm.com> Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com> Co-authored-by: Jacob Bramley <jacob.bramley@arm.com> Co-authored-by: Luca Vizzarro <Luca.Vizzarro@arm.com>
Co-authored-by: Adam Gemmell <Adam.Gemmell@arm.com> Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com> Co-authored-by: Jacob Bramley <jacob.bramley@arm.com> Co-authored-by: Luca Vizzarro <Luca.Vizzarro@arm.com>
arm64ec doesn't support SVE.
With SVE intrinsics in the `arm_intrinsics.json`, the parsing needs to be updated to know to expect any new fields.
SVE intrinsics have both type and const generics and so the `assert_instr` macro needs to be able to generate test cases with the type generics instantiated with the types provided in the attribute. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com> Co-authored-by: Luca Vizzarro <Luca.Vizzarro@arm.com> Co-authored-by: Adam Gemmell <adam.gemmell@arm.com> Co-authored-by: Jacob Bramley <jacob.bramley@arm.com>
The implementation for this has the same behaviour as a `pfalse` but doesn't currently emit one until an intrinsic is added to emit a `zeroinitializer` for this.
SVE's `[us]shll[tb]` intructions have no aliases unlike Neon's
`[us]hll{2}` so this logic needs adjusted to not accidentally rewrite
the instruction.
`dumpbin.exe` produces `44a1c000`/`44e1c000`/`44a1c400`/`44e1c400` for `[su]mull[tb]` instead of the instruction name - so skip `assert_instr` for these intrinsics on MSVC targets.
There seemed to be non-deterministic failures on MSVC that looked like corruption of the FFR in CI. Until this can be investigated, to avoid any spurious failures, these tests are disabled.
d124b9e to
b661e23
Compare
|
CI failure is rust-lang/rust#155277. It should all be passing otherwise, as far as I can tell. I've disabled load/store tests on MSVC because it looked like there was non-deterministic corruption of the FFR in CI, so turning these off out of caution to avoid spurious CI failures until we can investigate as a follow-up. |
|
CI is passing now so this should be ready for reviews |
This is a very large patch but the vast majority of it is generated code, the rest should be relatively straightforward to review.
This passes tests for me locally with the latest nightly after rust-lang/rust#153286 has landed.
I've bolded the commits that do the most interesting things - the rest are largely updating the support that has been partially upstreamed in the past to work with the current implementation in rustc.
stdarch-verifyfor Arm - it was accidentally removed in 713444d.sve.spec.ymlandsve2.spec.ymland instead adds a key that can be set in those files to achieve the same behaviour.SvUndefexpressions from the generator, these were used insvundefintrinsics and some others.svundefnow zeroes and so doesn't need a special generator expression, and the other uses callsvundef.simd_reinterpretin the generator totransmute_unchecked-simd_reinterpretwas expected to be added byrustc_scalable_vector(N)rust#143924 but was changed during reviews.auto-llvm-sign-conversionin the generator for return types to match what it does for arguments.auto-llvm-sign-conversionisn't used by any existing intrinsic specification files.static_assert_rangehelper that will be used in later commits.SveInto::sve_into(a trait introduced in the previous commit). This trait is necessary becausetarget_featureannotations are necessary on the trait method and that requires the method be unsafe, which is incompatible with the signature ofInto::into.stdarch-verify. Load/store tests will also be generated from these definitions.intrinsics_data/arm_intrinsics.jsonfile to add all the SVE intrinsics so thatstdarch-verifycan check all of the intrinsics are present.stdarch-verifywith the necessary support and special-cases for SVE intrinsics.aarch64-*, notarm64ec-*.intrinsic-testtool so that it can still parsearm_intrinsics.jsonand skips the SVE intrinsics.assert_instrmacro to support instantiating type generics as well as const generics.assert_instrfromsvpfalsebecause its current implementation, while producing the correct result, doesn't generate apfalse- this will require a rustc intrinsic.stdarch-test's logic for disassembling used byassert_instr. Previously[us]shll{2}would be rewritten to a normalised alias, but that was triggering for[us]shll[tb]added with SVE, which was incorrect.assert_instrfor a handful of intrinsics on MSVC that don't seem to be supported by the disassembler.The intrinsic test tool needs a lot of changes to work with SVE and this patch is getting big as it is, so we're going to do this as a follow-up (agreed in advance with @Amanieu).
This patch is based on #1509 and I've tried to preserve the co-authorship of everyone involved in that patch.
r? @Amanieu