Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(simd.h): use default for ctrs and assignment where applicable (
#4187) simd.h improvements and refactorization for consistency: * Use `= default` for all the uninitialized constructors, copy constructors, and assignment from the same type. * Fix the `operator=` to be more standard by returning a `vec&` instead of `const vec&`, which apparently is unusual. * Test that these all result in C++ understanding that these classes are trivially copyable. There is a bit of awkwardness where for the vint types, we have to define the copy constructors for the Intel icc compiler. It just seems to do the wrong thing for `=default` and fails lots of our tests. I don't understand why, and I'm not inclined to investigate too deeply, since it's a discontinued compiler we support only for legacy reasons, so it doesn't bother me too much that we special-case it. One reason I think it's a compiler bug is that it has no problem with the floating point vector types. It's confused about something with the simd ints. Disable SIMD acceleration of fast_exp2 when using MSVS prior to 2022. It seems to sporadically generate bad code in this function and I can't seem to restructure the function in a way that consistently is correct. Doesn't seem to happen with newer MSVS, nor on any other platform or compiler. I'm assuming this is a compiler bug and it's not worth pursuing for an old version of one compiler, for this one function that isn't really used all that often or in performance-critical paths. Some extra slosh in the simd fast_exp test. Rewrite OIIO_CHECK_SIMD_EQUAL_THRESH to print the differences and use more digits of precision when it fails. --------- Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information