source: icGREP/icgrep-devel/llvm-3.6.1.src/test/CodeGen/R600/sign_extend.ll @ 4664

Last change on this file since 4664 was 4664, checked in by cameron, 4 years ago

Upgrade LLVM to 3.6.1

File size: 1.8 KB
Line 
1; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
2; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
3
4; SI-LABEL: {{^}}s_sext_i1_to_i32:
5; SI: v_cndmask_b32_e64
6; SI: s_endpgm
7define void @s_sext_i1_to_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) nounwind {
8  %cmp = icmp eq i32 %a, %b
9  %sext = sext i1 %cmp to i32
10  store i32 %sext, i32 addrspace(1)* %out, align 4
11  ret void
12}
13
14; SI-LABEL: {{^}}test_s_sext_i32_to_i64:
15; SI: s_ashr_i32
16; SI: s_endpg
17define void @test_s_sext_i32_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) nounwind {
18entry:
19  %mul = mul i32 %a, %b
20  %add = add i32 %mul, %c
21  %sext = sext i32 %add to i64
22  store i64 %sext, i64 addrspace(1)* %out, align 8
23  ret void
24}
25
26; SI-LABEL: {{^}}s_sext_i1_to_i64:
27; SI: v_cndmask_b32_e64
28; SI: v_cndmask_b32_e64
29; SI: s_endpgm
30define void @s_sext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) nounwind {
31  %cmp = icmp eq i32 %a, %b
32  %sext = sext i1 %cmp to i64
33  store i64 %sext, i64 addrspace(1)* %out, align 8
34  ret void
35}
36
37; SI-LABEL: {{^}}s_sext_i32_to_i64:
38; SI: s_ashr_i32
39; SI: s_endpgm
40define void @s_sext_i32_to_i64(i64 addrspace(1)* %out, i32 %a) nounwind {
41  %sext = sext i32 %a to i64
42  store i64 %sext, i64 addrspace(1)* %out, align 8
43  ret void
44}
45
46; SI-LABEL: {{^}}v_sext_i32_to_i64:
47; SI: v_ashr
48; SI: s_endpgm
49define void @v_sext_i32_to_i64(i64 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
50  %val = load i32 addrspace(1)* %in, align 4
51  %sext = sext i32 %val to i64
52  store i64 %sext, i64 addrspace(1)* %out, align 8
53  ret void
54}
55
56; SI-LABEL: {{^}}s_sext_i16_to_i64:
57; SI: s_endpgm
58define void @s_sext_i16_to_i64(i64 addrspace(1)* %out, i16 %a) nounwind {
59  %sext = sext i16 %a to i64
60  store i64 %sext, i64 addrspace(1)* %out, align 8
61  ret void
62}
Note: See TracBrowser for help on using the repository browser.