https://bugs.llvm.org/show_bug.cgi?id=40053
Bug ID: 40053
Summary: _mm_adds_epu8 and _mm_subs_epu8 with constant operand
don't generate paddusb/psubusb
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: aman...@gmail.com
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com
It seems that instruction selection can't see through the transformations done
on the constants.
This is a regression from 7.0 where these intrinsics would compile to a single
instruction.
Source:
#include <emmintrin.h>
__m128i test_add(__m128i x) {
__m128i c = _mm_set1_epi8(1);
return _mm_adds_epu8(x, c);
}
__m128i test_sub(__m128i x) {
__m128i c = _mm_set1_epi8(1);
return _mm_subs_epu8(x, c);
}
Assembly (trunk):
test_add:
pcmpeqd xmm1, xmm1
movdqa xmm2, xmm0
psubb xmm2, xmm1
pcmpeqb xmm0, xmm1
por xmm0, xmm2
ret
.LCPI1_0:
.zero 16,1
test_sub:
pmaxub xmm0, xmmword ptr [rip + .LCPI1_0]
pcmpeqd xmm1, xmm1
paddb xmm0, xmm1
ret
Assembly (7.0):
.LCPI0_0:
.zero 16,1
test_add:
paddusb .LCPI0_0(%rip), %xmm0
retq
.LCPI1_0:
.zero 16,1
test_sub:
psubusb .LCPI1_0(%rip), %xmm0
retq
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs