mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
7c9c6ed761
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.5 KiB
LLVM
44 lines
1.5 KiB
LLVM
; RUN: llc < %s -mtriple=x86_64-linux-pc -mcpu=corei7 | FileCheck %s
|
|
|
|
declare <4 x i32> @llvm.x86.sse41.pminud(<4 x i32>, <4 x i32>)
|
|
|
|
define <2 x i16> @good(<4 x i32>*, <4 x i8>*) {
|
|
; CHECK-LABEL: good:
|
|
; CHECK: # BB#0: # %entry
|
|
; CHECK-NEXT: movdqa (%rdi), %xmm0
|
|
; CHECK-NEXT: pminud {{.*}}(%rip), %xmm0
|
|
; CHECK-NEXT: pmovzxwq %xmm0, %xmm0
|
|
; CHECK-NEXT: retq
|
|
entry:
|
|
%2 = load <4 x i32>, <4 x i32>* %0, align 16
|
|
%3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
|
|
%4 = extractelement <4 x i32> %3, i32 0
|
|
%5 = extractelement <4 x i32> %3, i32 1
|
|
%6 = extractelement <4 x i32> %3, i32 2
|
|
%7 = extractelement <4 x i32> %3, i32 3
|
|
%8 = bitcast i32 %4 to <2 x i16>
|
|
%9 = bitcast i32 %5 to <2 x i16>
|
|
ret <2 x i16> %8
|
|
}
|
|
|
|
define <2 x i16> @bad(<4 x i32>*, <4 x i8>*) {
|
|
; CHECK-LABEL: bad:
|
|
; CHECK: # BB#0: # %entry
|
|
; CHECK-NEXT: movdqa (%rdi), %xmm0
|
|
; CHECK-NEXT: pminud {{.*}}(%rip), %xmm0
|
|
; CHECK-NEXT: pextrd $1, %xmm0, %eax
|
|
; CHECK-NEXT: movd %eax, %xmm0
|
|
; CHECK-NEXT: pmovzxwq %xmm0, %xmm0
|
|
; CHECK-NEXT: retq
|
|
entry:
|
|
%2 = load <4 x i32>, <4 x i32>* %0, align 16
|
|
%3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
|
|
%4 = extractelement <4 x i32> %3, i32 0
|
|
%5 = extractelement <4 x i32> %3, i32 1
|
|
%6 = extractelement <4 x i32> %3, i32 2
|
|
%7 = extractelement <4 x i32> %3, i32 3
|
|
%8 = bitcast i32 %4 to <2 x i16>
|
|
%9 = bitcast i32 %5 to <2 x i16>
|
|
ret <2 x i16> %9
|
|
}
|