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

Add infinity test in test_mm_{max,min}_{pd,sd} #594

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ class SSE2NEONTestImpl : public SSE2NEONTest
}
}

if (test == it_mm_max_pd || test == it_mm_max_sd ||
test == it_mm_min_pd || test == it_mm_min_sd) {
// Make sure the positive/negative inifinity values are included
// in the testing one out of four times.
if ((rand() & 3) == 0) {
uint32_t r1 = ((rand() & 1) << 1) + 1;
uint32_t r2 = ((rand() & 1) << 1) + 1;
uint32_t r3 = ((rand() & 1) << 1) + 1;
uint32_t r4 = ((rand() & 1) << 1) + 1;
mTestFloatPointer1[r1] = INFINITY;
mTestFloatPointer2[r2] = INFINITY;
mTestFloatPointer1[r3] = -INFINITY;
mTestFloatPointer1[r4] = -INFINITY;
}
}

#if SSE2NEON_PRECISE_MINMAX
if (test == it_mm_max_ps || test == it_mm_max_ss ||
test == it_mm_min_ps || test == it_mm_min_ss) {
Expand Down