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

Fails compile on POWER8: SSE2 intrinsics -> VSX/AltiVec #77

Closed
jlost opened this issue Jul 1, 2016 · 3 comments · May be fixed by #283
Closed

Fails compile on POWER8: SSE2 intrinsics -> VSX/AltiVec #77

jlost opened this issue Jul 1, 2016 · 3 comments · May be fixed by #283

Comments

@jlost
Copy link

jlost commented Jul 1, 2016

bwa fails to compile on IBM POWER8 platforms due to dependency on SSE2 intrinsics.

Make output:

[u0017592@sys-81783 bwa]$ make
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  ksw.c -o ksw.o
ksw.c:29:23: fatal error: emmintrin.h: No such file or directory
 #include <emmintrin.h>
                       ^
compilation terminated.
make: *** [ksw.o] Error 1

Make after removing ##include <emmintrin.h>:

[u0017592@sys-81783 bwa]$ make
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  ksw.c -o ksw.o
ksw.c:48:2: error: unknown type name ‘__m128i’
  __m128i *qp, *H0, *H1, *E, *Hmax;
  ^
ksw.c: In function ‘ksw_qinit’:
ksw.c:71:11: error: ‘__m128i’ undeclared (first use in this function)
  q->qp = (__m128i*)(((size_t)q + sizeof(kswq_t) + 15) >> 4 << 4); // align memory
           ^
ksw.c:71:11: note: each undeclared identifier is reported only once for each function it appears in
ksw.c:71:19: error: expected expression before ‘)’ token
  q->qp = (__m128i*)(((size_t)q + sizeof(kswq_t) + 15) >> 4 << 4); // align memory
                   ^
ksw.c: In function ‘ksw_u8’:
ksw.c:114:2: error: unknown type name ‘__m128i’
  __m128i zero, oe_del, e_del, oe_ins, e_ins, shift, *H0, *H1, *E, *Hmax;
  ^
ksw.c:130:2: warning: implicit declaration of function ‘_mm_set1_epi32’ [-Wimplicit-function-declaration]
  zero = _mm_set1_epi32(0);
  ^
ksw.c:131:2: warning: implicit declaration of function ‘_mm_set1_epi8’ [-Wimplicit-function-declaration]
  oe_del = _mm_set1_epi8(_o_del + _e_del);
  ^
ksw.c:139:3: warning: implicit declaration of function ‘_mm_store_si128’ [-Wimplicit-function-declaration]
   _mm_store_si128(E + i, zero);
   ^
ksw.c:146:3: error: unknown type name ‘__m128i’
   __m128i e, h, t, f = zero, max = zero, *S = q->qp + target[i] * slen; // s is the 1st score vector
   ^
ksw.c:147:3: warning: implicit declaration of function ‘_mm_load_si128’ [-Wimplicit-function-declaration]
   h = _mm_load_si128(H0 + slen - 1); // h={2,5,8,11,14,17,-1,-1} in the above example
   ^
ksw.c:148:3: warning: implicit declaration of function ‘_mm_slli_si128’ [-Wimplicit-function-declaration]
   h = _mm_slli_si128(h, 1); // h=H(i-1,-1); << instead of >> because x64 is little-endian
   ^
ksw.c:156:4: warning: implicit declaration of function ‘_mm_adds_epu8’ [-Wimplicit-function-declaration]
    h = _mm_adds_epu8(h, _mm_load_si128(S + j));
    ^
ksw.c:157:4: warning: implicit declaration of function ‘_mm_subs_epu8’ [-Wimplicit-function-declaration]
    h = _mm_subs_epu8(h, shift); // h=H'(i-1,j-1)+S(i,j)
    ^
ksw.c:159:4: warning: implicit declaration of function ‘_mm_max_epu8’ [-Wimplicit-function-declaration]
    h = _mm_max_epu8(h, e);
    ^
ksw.c:184:5: warning: implicit declaration of function ‘_mm_movemask_epi8’ [-Wimplicit-function-declaration]
     cmp = _mm_movemask_epi8(_mm_cmpeq_epi8(_mm_subs_epu8(f, h), zero));
     ^
ksw.c:184:5: warning: implicit declaration of function ‘_mm_cmpeq_epi8’ [-Wimplicit-function-declaration]
ksw.c:190:3: warning: implicit declaration of function ‘_mm_srli_si128’ [-Wimplicit-function-declaration]
   __max_16(imax, max); // imax is the maximum number in max
   ^
ksw.c:190:3: warning: implicit declaration of function ‘_mm_extract_epi16’ [-Wimplicit-function-declaration]
ksw.c: In function ‘ksw_i16’:
ksw.c:235:2: error: unknown type name ‘__m128i’
  __m128i zero, oe_del, e_del, oe_ins, e_ins, *H0, *H1, *E, *Hmax;
  ^
ksw.c:251:2: warning: implicit declaration of function ‘_mm_set1_epi16’ [-Wimplicit-function-declaration]
  oe_del = _mm_set1_epi16(_o_del + _e_del);
  ^
ksw.c:265:3: error: unknown type name ‘__m128i’
   __m128i e, t, h, f = zero, max = zero, *S = q->qp + target[i] * slen; // s is the 1st score vector
   ^
ksw.c:269:4: warning: implicit declaration of function ‘_mm_adds_epi16’ [-Wimplicit-function-declaration]
    h = _mm_adds_epi16(h, *S++);
    ^
ksw.c:271:4: warning: implicit declaration of function ‘_mm_max_epi16’ [-Wimplicit-function-declaration]
    h = _mm_max_epi16(h, e);
    ^
ksw.c:275:4: warning: implicit declaration of function ‘_mm_subs_epu16’ [-Wimplicit-function-declaration]
    e = _mm_subs_epu16(e, e_del);
    ^
ksw.c:292:5: warning: implicit declaration of function ‘_mm_cmpgt_epi16’ [-Wimplicit-function-declaration]
     if(UNLIKELY(!_mm_movemask_epi8(_mm_cmpgt_epi16(f, h)))) goto end_loop8;
     ^
make: *** [ksw.o] Error 1

To support the POWER8 platform, this code will have to be changed to optionally use VSX/AltiVec.

More information: https://bitbucket.org/umarcts/ppc64le-wiki/wiki/vsx.md

@IvantheDugtrio
Copy link

See #71

@junaruga
Copy link

Here is a PR to build bwa on ppc64le with simde. #283

@jlost
Copy link
Author

jlost commented Nov 19, 2023

It looks like #359 fixed this. Closing.

@jlost jlost closed this as completed Nov 19, 2023
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

Successfully merging a pull request may close this issue.

3 participants