Skip to content

x86 avx: adjust rounding modes & other fixes#1379

Merged
mr-c merged 3 commits intosimd-everywhere:masterfrom
TheNumbat:master
Jan 31, 2026
Merged

x86 avx: adjust rounding modes & other fixes#1379
mr-c merged 3 commits intosimd-everywhere:masterfrom
TheNumbat:master

Conversation

@TheNumbat
Copy link
Copy Markdown
Contributor

  • _mm256_cvtpd_epi32/_mm256_cvtps_epi32 didn't respect out-of-range inputs, and used a different rounding mode than their 128-bit counterparts. They now call the 128-bit versions when available, and otherwise use a C implementation copied from the 128-bit version.

  • _mm256_testnzc_si256 used rc & rz, meaning it returns 0 if they have non-overlapping set bits. vptest examines all bits, so this should be using a logical and. I've also slightly refactored the other test_si256 implementations to call their 128-bit versions when available.

Adds tests that fail without the fixes.

@mr-c mr-c changed the title Fix some AVX bugs x86 avx: adjust rounding modes & other fixes Jan 31, 2026
@mr-c mr-c merged commit 51d5f4c into simd-everywhere:master Jan 31, 2026
142 checks passed
@mr-c
Copy link
Copy Markdown
Collaborator

mr-c commented Jan 31, 2026

Thank you @TheNumbat !

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