llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang palignr codegen bug

Open echristo opened this issue 16 years ago • 3 comments

Bugzilla Link 5743
Resolution FIXED
Resolved on Dec 09, 2009 19:38
Version trunk
OS All
CC @echristo

Extended Description

Looks like clang has incorrect codegen for the following test:

#include <tmmintrin.h>

int main(int argc, char **argv) { __m128i x = _mm_setzero_si128(), y = _mm_alignr_epi8(x, x, 1);

return 0; }

Where it's generating:

    palignr $0, %xmm1, %xmm1

The constant should be $1. I'm guessing somewhere we've got an extra divide by 8.

echristo avatar Dec 10 '09 01:12 echristo

I checked in a minimal fix here: r91032

lattner avatar Dec 10 '09 03:12 lattner

Yup. I'll take this :)

echristo avatar Dec 10 '09 02:12 echristo

clang is generating this: call <2 x i64> @​llvm.x86.ssse3.palign.r.128(<2 x i64> %tmp2, <2 x i64> %tmp3, i8 1)

instead of ... 8)

Are you still planning to delete these terrible intrinsics?

lattner avatar Dec 10 '09 02:12 lattner