Skip to content

fix(simd): support SSE2 on 32-bit x86 - #236

Open
felix-windsor wants to merge 1 commit into
cloudwego:mainfrom
felix-windsor:fix/i686-sse2-import
Open

fix(simd): support SSE2 on 32-bit x86#236
felix-windsor wants to merge 1 commit into
cloudwego:mainfrom
felix-windsor:fix/i686-sse2-import

Conversation

@felix-windsor

Copy link
Copy Markdown

Summary

  • import SSE2 intrinsics from core::arch::x86 on 32-bit x86 and retain core::arch::x86_64 on 64-bit x86
  • add an i686+SSE2 compile check so this target remains covered

Motivation

On an i386/i686 target with SSE2 enabled, sonic-simd selects sse2.rs, but that module unconditionally imports core::arch::x86_64. The resulting build fails because the x86_64 architecture module does not exist on 32-bit x86.

Validation

Before this change, the following command reproduced the error from #231:

RUSTFLAGS="-C target-feature=+sse2" cargo check -p sonic-simd --target i686-unknown-linux-gnu
error[E0432]: unresolved import `core::arch::x86_64`

After the change:

  • RUSTFLAGS="-C target-feature=+sse2" cargo check -p sonic-simd --target i686-unknown-linux-gnu
  • cargo test -p sonic-simd
  • cargo fmt -- --check

Fixes #231

@CLAassistant

CLAassistant commented Aug 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Build fails on i386: could not find x86_64 in arch

2 participants