Skip to content

Commit

Permalink
X86 Tests: Add a case for combining sdiv by a splatted pow2 negative.…
Browse files Browse the repository at this point in the history
… NFC.

Noticed test was missing while working on D42479.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329356 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Zvi Rackover committed Apr 5, 2018
1 parent 396d590 commit 32d2ff0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/CodeGen/X86/combine-sdiv.ll
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,31 @@ define <4 x i32> @combine_vec_sdiv_by_pow2a(<4 x i32> %x) {
ret <4 x i32> %1
}

define <4 x i32> @combine_vec_sdiv_by_pow2a_neg(<4 x i32> %x) {
; SSE-LABEL: combine_vec_sdiv_by_pow2a_neg:
; SSE: # %bb.0:
; SSE-NEXT: movdqa %xmm0, %xmm1
; SSE-NEXT: psrad $31, %xmm1
; SSE-NEXT: psrld $30, %xmm1
; SSE-NEXT: paddd %xmm0, %xmm1
; SSE-NEXT: psrad $2, %xmm1
; SSE-NEXT: pxor %xmm0, %xmm0
; SSE-NEXT: psubd %xmm1, %xmm0
; SSE-NEXT: retq
;
; AVX-LABEL: combine_vec_sdiv_by_pow2a_neg:
; AVX: # %bb.0:
; AVX-NEXT: vpsrad $31, %xmm0, %xmm1
; AVX-NEXT: vpsrld $30, %xmm1, %xmm1
; AVX-NEXT: vpaddd %xmm1, %xmm0, %xmm0
; AVX-NEXT: vpsrad $2, %xmm0, %xmm0
; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
; AVX-NEXT: vpsubd %xmm0, %xmm1, %xmm0
; AVX-NEXT: retq
%1 = sdiv <4 x i32> %x, <i32 -4, i32 -4, i32 -4, i32 -4>
ret <4 x i32> %1
}

define <16 x i8> @combine_vec_sdiv_by_pow2b_v16i8(<16 x i8> %x) {
; SSE-LABEL: combine_vec_sdiv_by_pow2b_v16i8:
; SSE: # %bb.0:
Expand Down

0 comments on commit 32d2ff0

Please sign in to comment.