0

I am writing a program using AVX with G++ 5.4.0, Ubuntu 16.04.

Intel Intrinsics Guide( https://software.intel.com/sites/landingpage/IntrinsicsGuide/) said I can use

_mm256_irem_epi32 

in immintrin.h to compute element-wise remainder of two vectors. However, when I include the header and compile, the compiler complains

error: ‘_mm256_irem_epi32’ was not declared in this scope

I checked the header file avxintrin.h and avx2intrin.h, seems like that function is indeed not included. If that is not a configuration problem, is there any candidate I can use for element-wise remainder? Thanks.

Harper
  • 1,794
  • 14
  • 31
  • Seems like what you describe is a bug in the compiler/C runtime library... – Mats Petersson Dec 19 '16 at 18:33
  • 2
    This is not an intrinsic - you're looking at an SVML function, which is only available if you are using Intel's ICC compiler. – Paul R Dec 19 '16 at 18:38
  • Thanks @Paul R for pointing this out. If I don't want to use SVML, is there any other candidate for computing remainder? – Harper Dec 19 '16 at 18:42
  • There are various similar SIMD math libraries which typically cover a subset of SVML, but I don't know of a specific one which has a remainder function. You may just have to roll your own, I think. – Paul R Dec 19 '16 at 19:04
  • 1
    @PaulR: I haven't used http://libdivide.com/, but it's supposed to do SIMD integer division (using multiplicative inverses). That's the hard part of finding a remainder, so that's probably a good first step. I forget if [Agner Fog's VCL](http://www.agner.org/optimize/#vectorclass) has division. – Peter Cordes Dec 19 '16 at 20:59
  • @PeterCordes: thanks for the pointer to libdivide - I wasn't aware of its existence - looks like it might be useful, although some work may be needed to extend the SSE bits to AVX2. – Paul R Dec 19 '16 at 21:02

0 Answers0