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

Argument must be an 8-bit immediate #349

Open
tdegeus opened this issue Jan 15, 2020 · 4 comments
Open

Argument must be an 8-bit immediate #349

tdegeus opened this issue Jan 15, 2020 · 4 comments

Comments

@tdegeus
Copy link
Member

tdegeus commented Jan 15, 2020

I'm getting the following build error on my CI:

In file included from /usr/lib/gcc/x86_64-linux-gnu/6/include/immintrin.h:45:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include/x86intrin.h:48,
                 from /home/travis/miniconda/include/xsimd/config/xsimd_include.hpp:19,
                 from /home/travis/miniconda/include/xsimd/types/xsimd_types_include.hpp:14,
                 from /home/travis/miniconda/include/xsimd/types/xsimd_traits.hpp:17,
                 from /home/travis/miniconda/include/xsimd/xsimd.hpp:16,
                 from /home/travis/miniconda/include/xtensor/xtensor_config.hpp:84,
                 from /home/travis/miniconda/include/xtensor/xbuffer_adaptor.hpp:21,
                 from /home/travis/miniconda/include/xtensor/xtensor.hpp:19,
                 from /home/travis/build/tdegeus/GooseEYE/include/GooseEYE/config.h:26,
                 from /home/travis/build/tdegeus/GooseEYE/include/GooseEYE/GooseEYE.h:10,
                 from /home/travis/build/tdegeus/GooseEYE/test/main.cpp:2:
/home/travis/miniconda/include/xsimd/types/xsimd_avx512_int64.hpp: In function ‘xsimd::batch<long int, 8ul> xsimd::operator<<(const xsimd::batch<long int, 8ul>&, int32_t)’:
/home/travis/miniconda/include/xsimd/types/xsimd_avx512_int64.hpp:412:16: error: the last argument must be an 8-bit immediate
         return _mm512_slli_epi64(lhs, rhs);
                ^
/home/travis/miniconda/include/xsimd/types/xsimd_avx512_int64.hpp: In function ‘xsimd::batch<long int, 8ul> xsimd::operator>>(const xsimd::batch<long int, 8ul>&, int32_t)’:
/home/travis/miniconda/include/xsimd/types/xsimd_avx512_int64.hpp:417:16: error: the last argument must be an 8-bit immediate
         return _mm512_srli_epi64(lhs, rhs);
                ^
@JohanMabille
Copy link
Member

JohanMabille commented Jan 15, 2020

I ran into this issue at some point. The last argument of _mm512_slli_epi64 and _mm512_srli_epi64 must be known at compile time. However, when this code is called, the compiler can figure out by itself the value of the constant (if called with a constant).

Do you call (indirectly) this code (it is the vectorization of shift operators)? Or do you have this error as soon as you include xismd?

@tdegeus
Copy link
Member Author

tdegeus commented Jan 15, 2020

Alright. As far as your question is concerned, I'm not entirely sure. It is a bit cumbersome to debug on travis as many of these errors are hardware dependent. Will let you know!

@JohanMabille
Copy link
Member

Given that the error message does not print something like "required from here", I think checking GooseEYE/config.h:26and GooseEYE.h:10 should be enough. If they are include statements, then you do not call directly these methods and the compiler complains before knowing if he can determine the second argument (which is super weird).

Out of curiosity, which compiler do you use? And which distribution of Ubuntu?

@serge-sans-paille
Copy link
Contributor

@JohanMabille we could provide a new type named xsimd::imm8<N> to provide an explicit immediate, do you think it's worth the effort?

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

No branches or pull requests

3 participants