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

swizzles_avx fails with GCC 5.1 #9

Closed
mattkretz opened this issue Jul 14, 2015 · 5 comments
Closed

swizzles_avx fails with GCC 5.1 #9

mattkretz opened this issue Jul 14, 2015 · 5 comments

Comments

@mattkretz
Copy link
Member

https://cdash.gsi.de/testDetails.php?test=272280&build=51127

 FAIL: ┍ at /home/mkretz/.Vc-Test/Vc-0.7/tests/swizzles.cpp:115 (0x40da5b):
 FAIL: │ test.badc() ([23591, -7970, 18436, -13100, 29690, 24409, 12135, 29166]) == scalarSwizzle(test, BADC) ([23591, -7970, 18436, -13100, 29690, -7970, 12135, 29166]) -> m[1111 1011] 
 FAIL: ┕ testSwizzle<short_v>
 FAIL: ┍ at /home/mkretz/.Vc-Test/Vc-0.7/tests/swizzles.cpp:115 (0x40f367):
 FAIL: │ test.badc() ([57770, 9820, 42369, 36174, 26448, 46473, 35535, 47990]) == scalarSwizzle(test, BADC) ([57770, 9820, 42369, 36174, 26448, 9820, 35535, 47990]) -> m[1111 1011] 
 FAIL: ┕ testSwizzle<ushort_v>
@mattkretz mattkretz self-assigned this Jul 14, 2015
@mattkretz mattkretz added this to the Vc 0.7.5 milestone Jul 14, 2015
@mattkretz
Copy link
Member Author

The following indicates that the Vc function works correctly, but the reference value is wrong.

Vc:  [23591, -7970, 18436, -13100, 29690, 24409, 12135, 29166]
Ref: [23591, -7970, 18436, -13100, 29690, -7970, 12135, 29166]
Orig:[-7970, 23591, -13100, 18436, 24409, 29690, 29166, 12135]

@mattkretz
Copy link
Member Author

GCC 5.1.0 miscompiles the reference function, which seems to indicate that AVX::Vector<short>::operator[] is broken.

@mattkretz
Copy link
Member Author

This is the relevant bug in GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66866

@mattkretz
Copy link
Member Author

A possible workaround for Vc is a store to (u)short[8] and subsequent array dereference in Vector<T>::operator[](size_t) const. I'll wait for the feedback on the GCC issue first, though.

mattkretz added a commit that referenced this issue Jul 17, 2015
This works around pr66866 in GCC, where GCC messes up the member
extraction.

Fixes gh-9.

Signed-off-by: Matthias Kretz <kretz@kde.org>
@mattkretz
Copy link
Member Author

This bug is fixed in GCC on all branches starting from 4.9. I implemented a workaround for the compilers that fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant