Open
Description
The compiler lowers the following code to a 200+ instruction long scalar sequence on WASM+simd128:
#![feature(portable_simd)]
use core::simd::prelude::*;
fn f(a: u16x32, b: u16) -> bool {
a.simd_eq(Simd::splat(b)).any()
}
The 256-bit wide version could also arguably use some work (for example could be compiled like this), but it's not catastrophically heavy and I don't really have any benchmarks to claim that it's slow.
Meta
rustc --version --verbose
:
rustc 1.78.0-nightly (c67326b06 2024-03-15)
binary: rustc
commit-hash: c67326b063bd27ed04f306ba2e372cd92e0a8751
commit-date: 2024-03-15
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0
Compiler returned: 0
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: SIMD (Single Instruction Multiple Data)Area: Code generationCategory: An issue highlighting optimization opportunities or PRs implementing suchIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to performance of generated code.Target: WASM (WebAssembly), http://webassembly.org/Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Status: A Minimal Complete and Verifiable Example has been found for this issueThis issue requires a nightly compiler in some way.