Alex Crichton 4e4a60b9d9
wasm: Lower alignment of all loads/stores (#1175)
This changes wasm simd intrisnics which deal with memory to match clang
where they all are emitted with an alignment of 1. This is expected to
not impact performance since wasm engines generally ignore alignment as
it's just a hint. Otherwise this can increase safety slightly when used
from Rust since if an unaligned pointer was previously passed in that
could result in UB on the LLVM side. This means that the intrinsics are
slighly more usable in more situations than before.

It's expected that if higher alignment is desired then programs will not
use these intrinsics but rather the component parts. For example instead
of `v128_load` you'd just load the pointer itself (and loading from a
pointer in Rust automatically assumes correct alignment). For
`v128_load64_splat` you'd do a load followed by a splat operation, which
LLVM should optimized into a `v128.load64_splat` instruction with the
desired alignment. LLVM doesn't fully support some optimizations (such
as optimizing `v128.load16_lane` from component parts) but that's
expected to be a temporary issue. Additionally we don't have a way of
configuring the alignment on operations that otherwise can't be
decomposed into their portions (such as with `i64x2_load_extend_u32x2`),
but we can ideally cross such a bridge when we get there if anyone ever
needs the alignment configured there.
2021-05-28 00:02:56 +01:00
..
2021-04-07 17:05:34 +01:00
2020-04-24 00:36:01 +01:00
2019-10-11 09:16:33 +02:00
2019-07-09 01:37:07 +02:00

stdarch - Rust's standard library SIMD components

Actions Status

Crates

This repository contains two main crates:

  • core_arch_crate_badge core_arch_docs_badge core_arch implements core::arch - Rust's core library architecture-specific intrinsics, and

  • std_detect_crate_badge std_detect_docs_badge std_detect implements std::detect - Rust's standard library run-time CPU feature detection.

The std::simd component now lives in the packed_simd crate.

How to do a release

To do a release of the core_arch and std_detect crates,