forked from open-power-sdk/pveclib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix vec_copysign implementations per issue open-power-sdk#158, Part 1B.
Rebased after the add/subqpo merge. Seems the GCC (and Clang followed) initially reversed the operands for vec_cpsgn() (so the sign is copied from operand b into a). This differs from the Intrinsic reference and ISA that say the sign is copied from operand a into b. Unfortunately PVECLIB implementations of vec_copysignf32(), vec_copysignf64(), and vec_copysignf128() duplicated the results of original GCC vec_cpsgn() for the implementation, This has been reported as a bug and now GCC and Clang are in the process of "fixing" this bug to match the Intrinsic reference guide. The fix will be applied to currently supported versions but older compiler version will remain unchanged. This change set will correct the PVECLIB copysign implementation to match the intrinsic reference manual. We will the macro PVECLIB_CPSGN_FIXED to isolate the PVECLIB implementations from the compiler changes. * src/pveclib/vec_f128_ppc.h (vec_copysignf128): Change to match operand order from Vector Intrinsic Reference. (vec_xscvsqqp [_ARCH_PWR9]): Use correct vec_copysignf128 operand order. * src/pveclib/vec_f32_ppc.h (vec_copysignf32): Change to match operand order from Vector Intrinsic Reference. * src/pveclib/vec_f64_ppc.h (vec_copysignf64): Change to match operand order from Vector Intrinsic Reference. * src/testsuite/arith128_test_f128.c (test_copysignf128): Define new __float128 const f128_nsnan. Reverse test operands and results to match corrected vec_copysignf128() implementation. Remove duplicated tests. * src/testsuite/arith128_test_f32.c (test_float_cpsgn): Reverse test operands and results to match corrected vec_copysignf32() implementation. * src/testsuite/arith128_test_f64.c (test_double_cpsgn): Reverse test operands and results to match corrected vec_copysignf64() implementation. * src/testsuite/vec_f32_dummy.c (test_vec_copysignf32): new compile test. * src/testsuite/vec_f64_dummy.c (test_vec_copysignf64): new compile test. Signed-off-by: Steven Munroe <[email protected]>
- Loading branch information
1 parent
ef3aff3
commit 8f14ea4
Showing
8 changed files
with
154 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.