Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lto2.test_avx_nontrapping #22911

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Fix lto2.test_avx_nontrapping #22911

merged 1 commit into from
Nov 12, 2024

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 12, 2024

This updates _mm_cvtps_epi32, _mm_cvtsd_si32, _mm_cvtpd_epi32 to perform
explict bounds checks, avoiding machine-specific behaviour.

Unlike the previous change (#22893) we cannot used __builtin_wasm_trunc_xx
operations here since these functions are not defined a truncating (unlike
_mm_cvttpd_epi32, _mm_cvttsd_si32 and _mm_cvttsd_si64 which were
modified in that PR.

See https://web.mit.edu/rust-lang_v1.26.0/arch/amd64_ubuntu1404/share/doc/rust/html/core/arch/x86_64/fn._mm_cvtpd_epi32.html
And https://web.mit.edu/rust-lang_v1.26.0/arch/amd64_ubuntu1404/share/doc/rust/html/core/arch/x86_64/fn._mm_cvttpd_epi32.html

It seems the extra t in the function names means "with truncation".

@sbc100 sbc100 requested a review from dschuff November 12, 2024 01:42
@sbc100 sbc100 force-pushed the fix_avx branch 2 times, most recently from bb889e7 to 50a07aa Compare November 12, 2024 04:07
@dschuff dschuff merged commit 5c81135 into emscripten-core:main Nov 12, 2024
28 checks passed
@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 12, 2024

I update the PR description explaining why we cannot use __builtin_wasm_trunc_xx intrinsics here.

uysalibov pushed a commit to uysalibov/emscripten that referenced this pull request Nov 15, 2024
dschuff added a commit that referenced this pull request Nov 15, 2024
Fixes lto2.test_sse1 and test_sse2 with checks similar to #22911 and
#22893
@sbc100 sbc100 deleted the fix_avx branch January 3, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants