//FINL void __ext_v_negate_complex8(struct complex8* output, int lenout, complex8* input, int lenin) { const int wlen = sizeof(vcb) / sizeof(complex8); const static unsigned char __0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF[16] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; int i; vcb *pinput = (vcb *)input; vcb *poutput = (vcb *)output; for (i = 0; i < lenin / wlen; i++) { //*poutput = (vcb)xor(*pinput, *((vcb*) __0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); *poutput = (vcb)_mm_sign_epi8(*pinput, *((vcb*)__0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); poutput++; pinput ++; } for (int j = i * wlen; j < lenin; j++) { output[j].re = -input[j].re; output[j].im = -input[j].im; } }
//FINL void __ext_v_sign_int8(int8 *output, int outlen, int8 *input1, int inlen1, int8 *input2, int inlen2) { int cnt = 0; vcs *pi1 = (vcs *)input1; vcs *pi2 = (vcs *)input2; vcs *po = (vcs *)output; while (cnt + 16 <= inlen1) { *po = (vcs)_mm_sign_epi8(*pi1, *pi2); pi1++; pi2++; po++; cnt += 16; } while (cnt < inlen1) { output[cnt] = (input2[cnt] < 0) ? (-input1[cnt]) : input1[cnt]; cnt++; } outlen = inlen1; }
__m128i test_mm_sign_epi8(__m128i a, __m128i b) { // CHECK-LABEL: test_mm_sign_epi8 // CHECK: call <16 x i8> @llvm.x86.ssse3.psign.b.128(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}) return _mm_sign_epi8(a, b); }