mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
use update_llc_test_checks.py to tighten checking; remove darwin and sandybridge overspecification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234017 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
af519fbf42
commit
8fea4abae0
@ -1,147 +1,224 @@
|
||||
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s
|
||||
|
||||
;;; Shift left
|
||||
; CHECK: vpslld
|
||||
; CHECK: vpslld
|
||||
define <8 x i32> @vshift00(<8 x i32> %a) nounwind readnone {
|
||||
define <8 x i32> @vshift00(<8 x i32> %a) {
|
||||
; CHECK-LABEL: vshift00:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpslld $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpslld $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = shl <8 x i32> %a, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32
|
||||
2>
|
||||
ret <8 x i32> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsllw
|
||||
; CHECK: vpsllw
|
||||
define <16 x i16> @vshift01(<16 x i16> %a) nounwind readnone {
|
||||
define <16 x i16> @vshift01(<16 x i16> %a) {
|
||||
; CHECK-LABEL: vshift01:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsllw $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsllw $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = shl <16 x i16> %a, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
|
||||
ret <16 x i16> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsllq
|
||||
; CHECK: vpsllq
|
||||
define <4 x i64> @vshift02(<4 x i64> %a) nounwind readnone {
|
||||
define <4 x i64> @vshift02(<4 x i64> %a) {
|
||||
; CHECK-LABEL: vshift02:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsllq $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsllq $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = shl <4 x i64> %a, <i64 2, i64 2, i64 2, i64 2>
|
||||
ret <4 x i64> %s
|
||||
}
|
||||
|
||||
;;; Logical Shift right
|
||||
; CHECK: vpsrld
|
||||
; CHECK: vpsrld
|
||||
define <8 x i32> @vshift03(<8 x i32> %a) nounwind readnone {
|
||||
define <8 x i32> @vshift03(<8 x i32> %a) {
|
||||
; CHECK-LABEL: vshift03:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsrld $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsrld $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = lshr <8 x i32> %a, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32
|
||||
2>
|
||||
ret <8 x i32> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsrlw
|
||||
; CHECK: vpsrlw
|
||||
define <16 x i16> @vshift04(<16 x i16> %a) nounwind readnone {
|
||||
define <16 x i16> @vshift04(<16 x i16> %a) {
|
||||
; CHECK-LABEL: vshift04:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsrlw $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsrlw $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = lshr <16 x i16> %a, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
|
||||
ret <16 x i16> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsrlq
|
||||
; CHECK: vpsrlq
|
||||
define <4 x i64> @vshift05(<4 x i64> %a) nounwind readnone {
|
||||
define <4 x i64> @vshift05(<4 x i64> %a) {
|
||||
; CHECK-LABEL: vshift05:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsrlq $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsrlq $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = lshr <4 x i64> %a, <i64 2, i64 2, i64 2, i64 2>
|
||||
ret <4 x i64> %s
|
||||
}
|
||||
|
||||
;;; Arithmetic Shift right
|
||||
; CHECK: vpsrad
|
||||
; CHECK: vpsrad
|
||||
define <8 x i32> @vshift06(<8 x i32> %a) nounwind readnone {
|
||||
define <8 x i32> @vshift06(<8 x i32> %a) {
|
||||
; CHECK-LABEL: vshift06:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsrad $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsrad $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = ashr <8 x i32> %a, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32
|
||||
2>
|
||||
ret <8 x i32> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsraw
|
||||
; CHECK: vpsraw
|
||||
define <16 x i16> @vshift07(<16 x i16> %a) nounwind readnone {
|
||||
define <16 x i16> @vshift07(<16 x i16> %a) {
|
||||
; CHECK-LABEL: vshift07:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsraw $2, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsraw $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = ashr <16 x i16> %a, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
|
||||
ret <16 x i16> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsrlw
|
||||
; CHECK: pand
|
||||
; CHECK: pxor
|
||||
; CHECK: psubb
|
||||
; CHECK: vpsrlw
|
||||
; CHECK: pand
|
||||
; CHECK: pxor
|
||||
; CHECK: psubb
|
||||
define <32 x i8> @vshift09(<32 x i8> %a) nounwind readnone {
|
||||
define <32 x i8> @vshift09(<32 x i8> %a) {
|
||||
; CHECK-LABEL: vshift09:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; CHECK-NEXT: vpsrlw $2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = [63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63]
|
||||
; CHECK-NEXT: vpand %xmm2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vmovdqa {{.*#+}} xmm3 = [32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]
|
||||
; CHECK-NEXT: vpxor %xmm3, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vpsubb %xmm3, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vpsrlw $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpand %xmm2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpxor %xmm3, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpsubb %xmm3, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = ashr <32 x i8> %a, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
|
||||
ret <32 x i8> %s
|
||||
}
|
||||
|
||||
; CHECK: pxor
|
||||
; CHECK: pcmpgtb
|
||||
; CHECK: pcmpgtb
|
||||
define <32 x i8> @vshift10(<32 x i8> %a) nounwind readnone {
|
||||
define <32 x i8> @vshift10(<32 x i8> %a) {
|
||||
; CHECK-LABEL: vshift10:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; CHECK-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
||||
; CHECK-NEXT: vpcmpgtb %xmm1, %xmm2, %xmm1
|
||||
; CHECK-NEXT: vpcmpgtb %xmm0, %xmm2, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = ashr <32 x i8> %a, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
|
||||
ret <32 x i8> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsrlw
|
||||
; CHECK: pand
|
||||
; CHECK: vpsrlw
|
||||
; CHECK: pand
|
||||
define <32 x i8> @vshift11(<32 x i8> %a) nounwind readnone {
|
||||
define <32 x i8> @vshift11(<32 x i8> %a) {
|
||||
; CHECK-LABEL: vshift11:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; CHECK-NEXT: vpsrlw $2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = [63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63]
|
||||
; CHECK-NEXT: vpand %xmm2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vpsrlw $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpand %xmm2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = lshr <32 x i8> %a, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
|
||||
ret <32 x i8> %s
|
||||
}
|
||||
|
||||
; CHECK: vpsllw
|
||||
; CHECK: pand
|
||||
; CHECK: vpsllw
|
||||
; CHECK: pand
|
||||
define <32 x i8> @vshift12(<32 x i8> %a) nounwind readnone {
|
||||
define <32 x i8> @vshift12(<32 x i8> %a) {
|
||||
; CHECK-LABEL: vshift12:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; CHECK-NEXT: vpsllw $2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = [252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252]
|
||||
; CHECK-NEXT: vpand %xmm2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vpsllw $2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpand %xmm2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%s = shl <32 x i8> %a, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
|
||||
ret <32 x i8> %s
|
||||
}
|
||||
|
||||
;;; Support variable shifts
|
||||
; CHECK: _vshift08
|
||||
; CHECK: vpslld $23
|
||||
; CHECK: vextractf128 $1
|
||||
; CHECK: vpslld $23
|
||||
; CHECK: ret
|
||||
define <8 x i32> @vshift08(<8 x i32> %a) nounwind {
|
||||
define <8 x i32> @vshift08(<8 x i32> %a) {
|
||||
; CHECK-LABEL: vshift08:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpslld $23, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vmovdqa {{.*#+}} xmm2 = [1065353216,1065353216,1065353216,1065353216]
|
||||
; CHECK-NEXT: vpaddd %xmm2, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vcvttps2dq %xmm1, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpslld $23, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpaddd %xmm2, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%bitop = shl <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>, %a
|
||||
ret <8 x i32> %bitop
|
||||
}
|
||||
|
||||
; PR15141
|
||||
; CHECK: _vshift13:
|
||||
; CHECK-NOT: vpsll
|
||||
; CHECK-NOT: vcvttps2dq
|
||||
; CHECK: vpmulld
|
||||
define <4 x i32> @vshift13(<4 x i32> %in) {
|
||||
; CHECK-LABEL: vshift13:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpmulld {{.*}}(%rip), %xmm0, %xmm0
|
||||
; CHECK-NEXT: retq
|
||||
%T = shl <4 x i32> %in, <i32 0, i32 1, i32 2, i32 4>
|
||||
ret <4 x i32> %T
|
||||
}
|
||||
|
||||
;;; Uses shifts for sign extension
|
||||
; CHECK: _sext_v16i16
|
||||
; CHECK: vpsllw
|
||||
; CHECK: vpsraw
|
||||
; CHECK: vpsllw
|
||||
; CHECK: vpsraw
|
||||
; CHECK: vinsertf128
|
||||
define <16 x i16> @sext_v16i16(<16 x i16> %a) nounwind {
|
||||
define <16 x i16> @sext_v16i16(<16 x i16> %a) {
|
||||
; CHECK-LABEL: sext_v16i16:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpsllw $8, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vpsraw $8, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpsllw $8, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpsraw $8, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%b = trunc <16 x i16> %a to <16 x i8>
|
||||
%c = sext <16 x i8> %b to <16 x i16>
|
||||
ret <16 x i16> %c
|
||||
}
|
||||
|
||||
; CHECK: _sext_v8i32
|
||||
; CHECK: vpslld
|
||||
; CHECK: vpsrad
|
||||
; CHECK: vpslld
|
||||
; CHECK: vpsrad
|
||||
; CHECK: vinsertf128
|
||||
define <8 x i32> @sext_v8i32(<8 x i32> %a) nounwind {
|
||||
define <8 x i32> @sext_v8i32(<8 x i32> %a) {
|
||||
; CHECK-LABEL: sext_v8i32:
|
||||
; CHECK: # BB#0:
|
||||
; CHECK-NEXT: vpslld $16, %xmm0, %xmm1
|
||||
; CHECK-NEXT: vpsrad $16, %xmm1, %xmm1
|
||||
; CHECK-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; CHECK-NEXT: vpslld $16, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vpsrad $16, %xmm0, %xmm0
|
||||
; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
|
||||
; CHECK-NEXT: retq
|
||||
%b = trunc <8 x i32> %a to <8 x i16>
|
||||
%c = sext <8 x i16> %b to <8 x i32>
|
||||
ret <8 x i32> %c
|
||||
|
Loading…
Reference in New Issue
Block a user