Skip to content

Commit ad24102

Browse files
committed
Merging r243731:
------------------------------------------------------------------------ r243731 | Matthew.Arsenault | 2015-07-31 00:12:04 -0400 (Fri, 31 Jul 2015) | 2 lines AMDGPU: Fix v16i32 to v16i8 truncstore ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_37@253231 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 594e6ef commit ad24102

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ SITargetLowering::SITargetLowering(TargetMachine &TM,
157157

158158
setTruncStoreAction(MVT::i64, MVT::i32, Expand);
159159
setTruncStoreAction(MVT::v8i32, MVT::v8i16, Expand);
160+
setTruncStoreAction(MVT::v16i32, MVT::v16i8, Expand);
160161
setTruncStoreAction(MVT::v16i32, MVT::v16i16, Expand);
161162

162163
setOperationAction(ISD::LOAD, MVT::i1, Custom);

test/CodeGen/AMDGPU/trunc-store.ll

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2+
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3+
4+
; FUNC-LABEL: {{^}}truncstore_arg_v16i32_to_v16i8:
5+
; SI: buffer_store_byte
6+
; SI: buffer_store_byte
7+
; SI: buffer_store_byte
8+
; SI: buffer_store_byte
9+
; SI: buffer_store_byte
10+
; SI: buffer_store_byte
11+
; SI: buffer_store_byte
12+
; SI: buffer_store_byte
13+
; SI: buffer_store_byte
14+
; SI: buffer_store_byte
15+
; SI: buffer_store_byte
16+
; SI: buffer_store_byte
17+
; SI: buffer_store_byte
18+
; SI: buffer_store_byte
19+
; SI: buffer_store_byte
20+
; SI: buffer_store_byte
21+
define void @truncstore_arg_v16i32_to_v16i8(<16 x i8> addrspace(1)* %out, <16 x i32> %in) {
22+
%trunc = trunc <16 x i32> %in to <16 x i8>
23+
store <16 x i8> %trunc, <16 x i8> addrspace(1)* %out
24+
ret void
25+
}
26+
27+
; FUNC-LABEL: {{^}}truncstore_arg_v16i64_to_v16i8:
28+
; SI: buffer_store_byte
29+
; SI: buffer_store_byte
30+
; SI: buffer_store_byte
31+
; SI: buffer_store_byte
32+
; SI: buffer_store_byte
33+
; SI: buffer_store_byte
34+
; SI: buffer_store_byte
35+
; SI: buffer_store_byte
36+
; SI: buffer_store_byte
37+
; SI: buffer_store_byte
38+
; SI: buffer_store_byte
39+
; SI: buffer_store_byte
40+
; SI: buffer_store_byte
41+
; SI: buffer_store_byte
42+
; SI: buffer_store_byte
43+
; SI: buffer_store_byte
44+
define void @truncstore_arg_v16i64_to_v16i8(<16 x i8> addrspace(1)* %out, <16 x i64> %in) {
45+
%trunc = trunc <16 x i64> %in to <16 x i8>
46+
store <16 x i8> %trunc, <16 x i8> addrspace(1)* %out
47+
ret void
48+
}

0 commit comments

Comments
 (0)