[X86] Updated shift-mask test targets for D61830

llvm-svn: 360533
This commit is contained in:
Simon Pilgrim 2019-05-11 20:28:20 +00:00
parent 0303e8a3fd
commit 3fa632a112
1 changed files with 66 additions and 13 deletions

View File

@ -1,6 +1,15 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-pc-linux | FileCheck %s --check-prefixes=CHECK,X86
; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s --check-prefixes=CHECK,X64
; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s --check-prefixes=CHECK,X64,X64-MASK
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=bdver1 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-SHIFT2
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=bdver2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-TBM
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=bdver3 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-TBM
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=bdver4 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-TBM
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=btver1 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-SHIFT2
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=btver2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-BMI,X64-BMI1
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=znver1 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-BMI,X64-BMI2
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=znver2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-BMI,X64-BMI2
; RUN: llc < %s -mtriple=x86_64-pc-linux -mattr=+fast-scalar-shift-masks | FileCheck %s --check-prefixes=CHECK,X64,X64-SHIFT,X64-SHIFT2
;
; fold (shl (lshr x, c1), c2) -> (0) (and x, MASK) or
@ -333,13 +342,34 @@ define i16 @test_i16_lshr_lshr_1(i16 %a0) {
; X86-NEXT: # kill: def $ax killed $ax killed $eax
; X86-NEXT: retl
;
; X64-LABEL: test_i16_lshr_lshr_1:
; X64: # %bb.0:
; X64-NEXT: movl %edi, %eax
; X64-NEXT: shrl $2, %eax
; X64-NEXT: andl $2047, %eax # imm = 0x7FF
; X64-NEXT: # kill: def $ax killed $ax killed $eax
; X64-NEXT: retq
; X64-MASK-LABEL: test_i16_lshr_lshr_1:
; X64-MASK: # %bb.0:
; X64-MASK-NEXT: movl %edi, %eax
; X64-MASK-NEXT: shrl $2, %eax
; X64-MASK-NEXT: andl $2047, %eax # imm = 0x7FF
; X64-MASK-NEXT: # kill: def $ax killed $ax killed $eax
; X64-MASK-NEXT: retq
;
; X64-SHIFT2-LABEL: test_i16_lshr_lshr_1:
; X64-SHIFT2: # %bb.0:
; X64-SHIFT2-NEXT: movl %edi, %eax
; X64-SHIFT2-NEXT: shrl $2, %eax
; X64-SHIFT2-NEXT: andl $2047, %eax # imm = 0x7FF
; X64-SHIFT2-NEXT: # kill: def $ax killed $ax killed $eax
; X64-SHIFT2-NEXT: retq
;
; X64-TBM-LABEL: test_i16_lshr_lshr_1:
; X64-TBM: # %bb.0:
; X64-TBM-NEXT: bextrl $2818, %edi, %eax # imm = 0xB02
; X64-TBM-NEXT: # kill: def $ax killed $ax killed $eax
; X64-TBM-NEXT: retq
;
; X64-BMI-LABEL: test_i16_lshr_lshr_1:
; X64-BMI: # %bb.0:
; X64-BMI-NEXT: movl $2818, %eax # imm = 0xB02
; X64-BMI-NEXT: bextrl %eax, %edi, %eax
; X64-BMI-NEXT: # kill: def $ax killed $ax killed $eax
; X64-BMI-NEXT: retq
%1 = shl i16 %a0, 3
%2 = lshr i16 %1, 5
ret i16 %2
@ -429,11 +459,34 @@ define i64 @test_i64_lshr_lshr_0(i64 %a0) {
; X86-NEXT: andl {{[0-9]+}}(%esp), %edx
; X86-NEXT: retl
;
; X64-LABEL: test_i64_lshr_lshr_0:
; X64: # %bb.0:
; X64-NEXT: movabsq $2305843009213693951, %rax # imm = 0x1FFFFFFFFFFFFFFF
; X64-NEXT: andq %rdi, %rax
; X64-NEXT: retq
; X64-MASK-LABEL: test_i64_lshr_lshr_0:
; X64-MASK: # %bb.0:
; X64-MASK-NEXT: movabsq $2305843009213693951, %rax # imm = 0x1FFFFFFFFFFFFFFF
; X64-MASK-NEXT: andq %rdi, %rax
; X64-MASK-NEXT: retq
;
; X64-SHIFT2-LABEL: test_i64_lshr_lshr_0:
; X64-SHIFT2: # %bb.0:
; X64-SHIFT2-NEXT: movabsq $2305843009213693951, %rax # imm = 0x1FFFFFFFFFFFFFFF
; X64-SHIFT2-NEXT: andq %rdi, %rax
; X64-SHIFT2-NEXT: retq
;
; X64-TBM-LABEL: test_i64_lshr_lshr_0:
; X64-TBM: # %bb.0:
; X64-TBM-NEXT: bextrq $15616, %rdi, %rax # imm = 0x3D00
; X64-TBM-NEXT: retq
;
; X64-BMI1-LABEL: test_i64_lshr_lshr_0:
; X64-BMI1: # %bb.0:
; X64-BMI1-NEXT: movl $15616, %eax # imm = 0x3D00
; X64-BMI1-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1-NEXT: retq
;
; X64-BMI2-LABEL: test_i64_lshr_lshr_0:
; X64-BMI2: # %bb.0:
; X64-BMI2-NEXT: movb $61, %al
; X64-BMI2-NEXT: bzhiq %rax, %rdi, %rax
; X64-BMI2-NEXT: retq
%1 = shl i64 %a0, 3
%2 = lshr i64 %1, 3
ret i64 %2