s390x: Refactor hardware facility detection (#11220)This patch implements a number of changes relating to s390x HWfacilities and facility detection:- Fix a mis-named facility: the z15 (arch13) C
s390x: Refactor hardware facility detection (#11220)This patch implements a number of changes relating to s390x HWfacilities and facility detection:- Fix a mis-named facility: the z15 (arch13) CPU introduced the Miscellaneous-Instruction-Extensions Facility *3* (not 2). Rename "mie2" to "mie3" throughout the code base.- Now that we can use inline asm, use the STORE FACILITY LIST EXTENDED instruction rather than HWCAP to detect facilities at run time. This eliminates the libc crate dependency, and allows for more fine-grained feature detection.- Add support for the z16 (arch14) CPU names (these do not provide any facilities that would be relevant to cranelift, but it should be possible to use these names as synonyms to z15 at least).- Add support for the z17 (arch15) CPU names, and two new facilities provided at this level: the Miscellaneous-Instruction-Extensions Facility 4 and the Vector-Enhancements Facility 3. (Note that no code to exploit these facilities is present in this patch; that will be provided later.)
show more ...
Add I128 atomic support to the `x64` backend (#9459)* Add I128 atomic support to the `x64` backend* fix typo in cranelift/codegen/src/isa/x64/inst/emit.rs---------Co-authored-by: Nick Fitzger
Add I128 atomic support to the `x64` backend (#9459)* Add I128 atomic support to the `x64` backend* fix typo in cranelift/codegen/src/isa/x64/inst/emit.rs---------Co-authored-by: Nick Fitzgerald <[email protected]>
Add initial f16 and f128 support to the aarch64 backend (#9076)
Enforce `uninlined_format_args` for the workspace (#9065)* Enforce `uninlined_format_args` for the workspace* fix: failing `Monolith Checks` job* fix: formatting
Update MSRV to 1.77.0 (#8796)This accompanies today's release of Rust 1.79.0. This means that CI willnow use the latest stable of 1.79.0 for testing primarily. Additionallythis updates the pinned
Update MSRV to 1.77.0 (#8796)This accompanies today's release of Rust 1.79.0. This means that CI willnow use the latest stable of 1.79.0 for testing primarily. Additionallythis updates the pinned nightly commit used for testing to today'snightly and fixes a few warnings that uncovered. I plan on having afollow-up that leverages some new APIs and features in 1.77.0.
Fix some typos (#8641)* occurred* winch typos* tests typos* cli typos* fuzz typos* examples typos* docs typos* crates/wasmtime typos* crates/environ typos* crates/cranelift typos
Fix some typos (#8641)* occurred* winch typos* tests typos* cli typos* fuzz typos* examples typos* docs typos* crates/wasmtime typos* crates/environ typos* crates/cranelift typos* crates/test-programs typos* crates/c-api typos* crates/cache typos* crates other typos* cranelift/codegen/src/isa typos* cranelift/codegen/src other typos* cranelift/codegen other typos* cranelift other typos* ci js typo* .github workflows typo* RELEASES typo* Fix clang-format documentation line---------Co-authored-by: Andrew Brown <[email protected]>
Support compilation-only build by adding a `runtime` feature (#7766)* Add `runtime` feature to `wasmtime` crateThis feature can be disabled to build `wasmtime` only for compilation.This can be u
Support compilation-only build by adding a `runtime` feature (#7766)* Add `runtime` feature to `wasmtime` crateThis feature can be disabled to build `wasmtime` only for compilation.This can be useful when cross-compiling, especially on a target thatcan't run wasmtime itself (e.g. `wasm32`).* prtest:full* don't round pages without runtime feature* fix async assertions* move profiling into runtime* enable runtime for wasmtime-wasi* enable runtime for c-api* fix build_artifacts in non-cache case* fix miri extensions* enable runtime for wast* enable runtime for explorer* support cranelift all-arch on wasm32* add doc links for `WeakEngine`* simplify lib runtime cfgs* move limits and resources to runtime* move stack to runtime* move coredump and debug to runtime* add runtime to coredump and async features* add wasm32 build job* combine engine modules* single compile mod* remove allow for macro paths* add comments
Configure workspace lints, enable running some Clippy lints on CI (#7561)* Configure Rust lints at the workspace levelThis commit adds necessary configuration knobs to have lints configuredat th
Configure workspace lints, enable running some Clippy lints on CI (#7561)* Configure Rust lints at the workspace levelThis commit adds necessary configuration knobs to have lints configuredat the workspace level in Wasmtime rather than the crate level. Thisuses a feature of Cargo first released with 1.74.0 (last week) of the`[workspace.lints]` table. This should help create a more consistent setof lints applied across all crates in our workspace in addition topossibly running select clippy lints on CI as well.* Move `unused_extern_crates` to the workspace levelThis commit configures a `deny` lint level for the`unused_extern_crates` lint to the workspace level rather than theprevious configuration at the individual crate level.* Move `trivial_numeric_casts` to workspace level* Change workspace lint levels to `warn`CI will ensure that these don't get checked into the codebase andotherwise provide fewer speed bumps for in-process development.* Move `unstable_features` lint to workspace level* Move `unused_import_braces` lint to workspace level* Start running Clippy on CIThis commit configures our CI to run `cargo clippy --workspace` for allmerged PRs. Historically this hasn't been all the feasible due to theamount of configuration required to control the number of warnings onCI, but with Cargo's new `[lint]` table it's possible to have aone-liner to silence all lints from Clippy by default. This commit bydefault sets the `all` lint in Clippy to `allow` to by-default disablewarnings from Clippy. The goal of this PR is to enable selective accessto Clippy lints for Wasmtime on CI.* Selectively enable `clippy::cast_sign_loss`This would have fixed #7558 so try to head off future issues with thatby warning against this situation in a few crates. This lint is stillquite noisy though for Cranelift for example so it's not worthwhile atthis time to enable it for the whole workspace.* Fix CI errorprtest:full
Remove clippy configuration from repo and crates (#6927)Wasmtime's CI does not run clippy so there's no enforcement of thisconfiguration. Additionally the configuration per-crate is not uniformly
Remove clippy configuration from repo and crates (#6927)Wasmtime's CI does not run clippy so there's no enforcement of thisconfiguration. Additionally the configuration per-crate is not uniformlyapplied across all of the Wasmtime workspace and is only on somehistorical crates. Because we don't run clippy in CI this commit removesall of the clippy annotations for allow/warn/deny from the source.
x64: Lower SIMD requirement to SSE2 (#6625)All instructions in Cranelift now have lowerings for SSE2 as a baseline,even if they're not exactly the speediest things in the world. Thisenables lower
x64: Lower SIMD requirement to SSE2 (#6625)All instructions in Cranelift now have lowerings for SSE2 as a baseline,even if they're not exactly the speediest things in the world. Thisenables lowering the baseline required for the SIMD proposal forWebAssembly to SSE2, the base features set of x86_64. Lots of tests wereupdated here to remove explicit `has_foo=false` annotations as they nolonger have any effect.Additionally fuzzing has been updated to enable disabling `sse3` and`ssse3` which will help stress-test all previously-added lowerings.
x64: Don't require SSE4.1 for `enable_simd` (#6489)This commit removes the SSE4.1 requirement for the `enable_simd` CLIFfeature. This means that the new baseline required is SSSE3 for theWebAssem
x64: Don't require SSE4.1 for `enable_simd` (#6489)This commit removes the SSE4.1 requirement for the `enable_simd` CLIFfeature. This means that the new baseline required is SSSE3 for theWebAssembly SIMD proposal. Many existing tests for codegen were allupdated to explicitly enable `has_sse41` and runtests were updated totest with and without SSE 4.1.Wasmtime's fuzzing is additionally updated to flip the SSE4.1 feature toenable fuzz-testing this.
x64: Lower SIMD requirement to SSE4.1 from SSE4.2 (#6206)Cranelift only has one instruction SIMD which depends on SSE4.2 so thiscommit adds a lowering rule for `pcmpgtq` which doesn't use SSE4.2 a
x64: Lower SIMD requirement to SSE4.1 from SSE4.2 (#6206)Cranelift only has one instruction SIMD which depends on SSE4.2 so thiscommit adds a lowering rule for `pcmpgtq` which doesn't use SSE4.2 andenables lowering the baseline requirement for SIMD support from SSE4.2to SSE4.1.The `has_sse42` setting is no longer enabled by default for Cranelift.Additionally `enable_simd` no longer requires `has_sse42` on x64.Finally the fuzz-generator for Wasmtime codegen settings now enablesflipping the `has_sse42` setting instead of unconditionally setting itto `true`.The specific lowering for `pcmpgtq` is copied from LLVM's lowering ofthis instruction.
cranelift-native: Detect RISC-V extensions using `/proc/cpuinfo` (#6192)* cranelift-native: Move riscv to separate module* cranelift-native: Read /proc/cpuinfo to parse RISC-V extensions* ci: A
cranelift-native: Detect RISC-V extensions using `/proc/cpuinfo` (#6192)* cranelift-native: Move riscv to separate module* cranelift-native: Read /proc/cpuinfo to parse RISC-V extensions* ci: Add QEMU cpuinfo emulation patchThis patch emulates the /proc/cpuinfo interface for RISC-V. Thisallows us to do feature detection for the RISC-V backend.It has been queued for QEMU 8.1 so we should remove it as soon asthat is available.* ci: Enable QEMU RISC-V extensions* cranelift-native: Cleanup ISA string parsingCo-Authored-By: Jamey Sharp <[email protected]>* cranelift-native: Rework `/proc/cpuinfo` parsingCo-Authored-By: Jamey Sharp <[email protected]>---------Co-authored-by: Jamey Sharp <[email protected]>
winch: Refactoring wasmtime compiler integration pieces to share more between Cranelift and Winch (#5944)* Enable the native target by default in winchMatch cranelift-codegen's build script where
winch: Refactoring wasmtime compiler integration pieces to share more between Cranelift and Winch (#5944)* Enable the native target by default in winchMatch cranelift-codegen's build script where if no architecture isexplicitly enabled then the host architecture is implicitly enabled.* Refactor Cranelift's ISA builder to share more with WinchThis commit refactors the `Builder` type to have a type parameterrepresenting the finished ISA with Cranelift and Winch having their owntypedefs for `Builder` to represent their own builders. The intention isto use this shared functionality to produce more shared code between thetwo codegen backends.* Moving compiler shared components to a separate crate* Restore native flag inference in compiler buildingThis fixes an oversight from the previous commits to use`cranelift-native` to infer flags for the native host when using defaultsettings with Wasmtime.* Move `Compiler::page_size_align` into wasmtime-environThe `cranelift-codegen` crate doesn't need this and winch wants the sameimplementation, so shuffle it around so everyone has access to it.* Fill out `Compiler::{flags, isa_flags}` for WinchThese are easy enough to plumb through with some shared code forWasmtime.* Plumb the `is_branch_protection_enabled` flag for WinchJust forwarding an isa-specific setting accessor.* Moving executable creation to shared compiler crate* Adding builder back in and removing from shared crate* Refactoring the shared pieces for the `CompilerBuilder`I decided to move a couple things around from Alex's initial changes.Instead of having the shared builder do everything, I went back tohaving each compiler have a distinct builder implementation. Irefactored most of the flag setting logic into a single shared location,so we can still reduce the amount of code duplication.With them being separate, we don't need to maintain things like`LinkOpts` which Winch doesn't currently use. We also have an avenue toerror when certain flags are sent to Winch if we don't support them. I'mhoping this will make things more maintainable as we build out Winch.I'm still unsure about keeping everything shared in a single crate(`cranelift_shared`). It's starting to feel like this crate is doing toomuch, which makes it difficult to name. There does seem to be a need fortwo distinct abstraction: creating the final executable and the handlingof shared/ISA flags when building the compiler. I could make them intotwo separate crates, but there doesn't seem to be enough there yet tojustify it.* Documentation updates, and renaming the finish method* Adding back in a default temporarily to pass tests, and removing some unused imports* Fixing winch tests with wrong method name* Removing unused imports from codegen shared crate* Apply documentation formatting updatesCo-authored-by: Saúl Cabrera <[email protected]>* Adding back in cranelift_native flag inferring* Adding new shared crate to publish list* Adding write feature to pass cargo check---------Co-authored-by: Alex Crichton <[email protected]>Co-authored-by: Saúl Cabrera <[email protected]>
riscv64: Add bitmanip extension flags (#5847)
Produce an error at runtime rather than at compile time for unsupported architectures in cranelift-native (#5627)
Wasmtime+Cranelift: strip out some dead x86-32 code. (#5226)* Wasmtime+Cranelift: strip out some dead x86-32 code. I was recently pointed to fastly/Viceroy#200 where it seems some folks are try
Wasmtime+Cranelift: strip out some dead x86-32 code. (#5226)* Wasmtime+Cranelift: strip out some dead x86-32 code. I was recently pointed to fastly/Viceroy#200 where it seems some folks are trying to compile Wasmtime (via Viceroy) for Windows x86-32 and the failures may not be loud enough. I've tried to reproduce this cross-compiling to i686-pc-windows-gnu from Linux and hit build failures (as expected) in several places. Nevertheless, while trying to discern what others may be attempting, I noticed some dead x86-32-specific code in our repo, and figured it would be a good idea to clean this up. Otherwise, it (i) sends some mixed messages -- "hey look, this codebase does support x86-32" -- and (ii) keeps untested code around, which is generally not great. This PR removes x86-32-specific cases in traphandlers and unwind code, and Cranelift's native feature detection. It adds helpful compile-error messages in a few cases. If we ever support x86-32 (contributors welcome! The big missing piece is Cranelift support; see #1980), these compile errors and git history should be enough to recover any knowledge we are now encoding in the source. I left the x86-32 support in `wasmtime-fiber` alone because that seems like a bit of a special case -- foundation library, separate from the rest of Wasmtime, with specific care to provide a (presumably working) full 32-bit version. * Remove some extraneous compile_error!s, already covered by others.
cranelift: Native feature detection for RISC-V (#5044)* cranelift: Native feature detection for RISC-V * cranelift: Typo fix Thanks @cfallin
Enable back-edge CFI by default on macOS (#4720)Also, adjust the tests that are executed on that platform. Finally, fix a bug with obtaining backtraces when back-edge CFI is enabled. Copyright
Enable back-edge CFI by default on macOS (#4720)Also, adjust the tests that are executed on that platform. Finally, fix a bug with obtaining backtraces when back-edge CFI is enabled. Copyright (c) 2022, Arm Limited.
Initial back-edge CFI implementation (#3606)Give the user the option to sign and to authenticate function return addresses with the operations introduced by the Pointer Authentication extension t
Initial back-edge CFI implementation (#3606)Give the user the option to sign and to authenticate function return addresses with the operations introduced by the Pointer Authentication extension to the Arm instruction set architecture. Copyright (c) 2021, Arm Limited.
x64: Implement SIMD `fma` (#4474)* x64: Add VEX Instruction Encoder This uses a similar builder pattern to the EVEX Encoder. Does not yet support memory accesses. * x64: Add FMA Flag * x6
x64: Implement SIMD `fma` (#4474)* x64: Add VEX Instruction Encoder This uses a similar builder pattern to the EVEX Encoder. Does not yet support memory accesses. * x64: Add FMA Flag * x64: Implement SIMD `fma` * x64: Use 4 register Vex Inst * x64: Reorder VEX pretty print args
cranelift-native flags detection: fix flags on SSE2-only systems. (#4231)In #4224 we saw that an SSE2-only x86-64 system somehow was still detecting SSE3/SSSE3/SSE4.1/SSE4.2. It turns out that we
cranelift-native flags detection: fix flags on SSE2-only systems. (#4231)In #4224 we saw that an SSE2-only x86-64 system somehow was still detecting SSE3/SSSE3/SSE4.1/SSE4.2. It turns out that we enabled these in the baseline `Flags` in #3816, because without that, a ton of other things break: default flags no longer produce a compiler backend that works with default Wasmtime settings. However the logic to set them when detected (via `CPUID`-using feature-test macros) only does an "if detected then set bit" step per feature; the bits are never *cleared*. This PR fixes that.
Enable AArch64 processor feature detection unconditionally (#4034)std::arch::is_aarch64_feature_detected!() is now part of stable Rust, so we can always use it. Copyright (c) 2022, Arm Limited.
Cranelift: ensure ISA level needed for SIMD is present when SIMD is enabled. (#3816)Addresses #3809: when we are asked to create a Cranelift backend with shared flags that indicate support for SIM
Cranelift: ensure ISA level needed for SIMD is present when SIMD is enabled. (#3816)Addresses #3809: when we are asked to create a Cranelift backend with shared flags that indicate support for SIMD, we should check that the ISA level needed for our SIMD lowerings is present.
Remove the rsix dependency in cranelift-native. (#3395)Revert the part of 47490b4383bf48cbde8b1c33301a7f7d326ee7cc which changed cranelift-native to use rsix. It's just one call, and this lets Cr
Remove the rsix dependency in cranelift-native. (#3395)Revert the part of 47490b4383bf48cbde8b1c33301a7f7d326ee7cc which changed cranelift-native to use rsix. It's just one call, and this lets Cranelift users that don't otherwise depend on rsix to avoid it.
12