]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/R600/trunc.ll
Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / CodeGen / R600 / trunc.ll
1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
2 ; RUN: llc -march=r600 -mcpu=cypress < %s | FileCheck -check-prefix=EG %s
3
4 define void @trunc_i64_to_i32_store(i32 addrspace(1)* %out, i64 %in) {
5 ; SI-LABEL: @trunc_i64_to_i32_store
6 ; SI: S_LOAD_DWORD s0, s[0:1], 11
7 ; SI: V_MOV_B32_e32 v0, s0
8 ; SI: BUFFER_STORE_DWORD v0
9
10 ; EG-LABEL: @trunc_i64_to_i32_store
11 ; EG: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
12 ; EG: LSHR
13 ; EG-NEXT: 2(
14
15   %result = trunc i64 %in to i32 store i32 %result, i32 addrspace(1)* %out, align 4
16   ret void
17 }
18
19 ; SI-LABEL: @trunc_shl_i64:
20 ; SI: S_LOAD_DWORDX2
21 ; SI: S_LOAD_DWORDX2 [[SREG:s\[[0-9]+:[0-9]+\]]]
22 ; SI: S_LSHL_B64 s{{\[}}[[LO_SREG:[0-9]+]]:{{[0-9]+\]}}, [[SREG]], 2
23 ; SI: MOV_B32_e32 v[[LO_VREG:[0-9]+]], s[[LO_SREG]]
24 ; SI: BUFFER_STORE_DWORD v[[LO_VREG]],
25 define void @trunc_shl_i64(i32 addrspace(1)* %out, i64 %a) {
26   %b = shl i64 %a, 2
27   %result = trunc i64 %b to i32
28   store i32 %result, i32 addrspace(1)* %out, align 4
29   ret void
30 }