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

simd.h: add abs,sign,ceil,floor,round for float3 #2612

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Jun 25, 2020

They already existed for float{4,8,16}, but were never implemented for
float3.

Add to simd_test.cpp both unit sanity checks and benchmarks for these
functions (including for the other classes where it already existed,
they were nonetheless not unit tested).

Also beef up simd_test by testing and benchmarking load/construcution
from scalar. Rename some test functions for clarity.

Along the way I realized a difference between scalar std::round and
our vector simd::round() in how they handle exact middle values
i+0.5. Because our round is more efficient (one instruction, whereas
std::round cannot be done in one op on x64, because "round midpoint
away from zero" is not a native hw rounding mode), put a big fat
comment warning about the difference.

Signed-off-by: Larry Gritz lg@larrygritz.com

They already existed for float{4,8,16}, but were never implemented for
float3.

Add to simd_test.cpp both unit sanity checks and benchmarks for these
functions (including for the other classes where it already existed,
they were nonetheless not unit tested).

Also beef up simd_test by testing and benchmarking load/construcution
from scalar. Rename some test functions for clarity.

Along the way I realized a difference between scalar std::round and
our vector simd::round() in how they handle exact middle values
i+0.5. Because our round is more efficient (one instruction, whereas
std::round cannot be done in one op on x64, because "round midpoint
away from zero" is not a native hw rounding mode), put a big fat
comment warning about the difference.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz lgritz merged commit 4fc8ce3 into AcademySoftwareFoundation:master Jun 26, 2020
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.

None yet

2 participants