Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/AMDGPU/sign_extend.ll @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | |
children | 1172e4bd9c6f |
comparison
equal
deleted
inserted
replaced
84:f3e34b893a5f | 95:afa8332a0e37 |
---|---|
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 | |
7 define 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 | |
17 define void @test_s_sext_i32_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) nounwind { | |
18 entry: | |
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 v[[LOREG:[0-9]+]], 0, -1, vcc | |
28 ; SI: v_mov_b32_e32 v[[HIREG:[0-9]+]], v[[LOREG]] | |
29 ; SI: buffer_store_dwordx2 v{{\[}}[[LOREG]]:[[HIREG]]{{\]}} | |
30 ; SI: s_endpgm | |
31 define void @s_sext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) nounwind { | |
32 %cmp = icmp eq i32 %a, %b | |
33 %sext = sext i1 %cmp to i64 | |
34 store i64 %sext, i64 addrspace(1)* %out, align 8 | |
35 ret void | |
36 } | |
37 | |
38 ; SI-LABEL: {{^}}s_sext_i32_to_i64: | |
39 ; SI: s_ashr_i32 | |
40 ; SI: s_endpgm | |
41 define void @s_sext_i32_to_i64(i64 addrspace(1)* %out, i32 %a) nounwind { | |
42 %sext = sext i32 %a to i64 | |
43 store i64 %sext, i64 addrspace(1)* %out, align 8 | |
44 ret void | |
45 } | |
46 | |
47 ; SI-LABEL: {{^}}v_sext_i32_to_i64: | |
48 ; SI: v_ashr | |
49 ; SI: s_endpgm | |
50 define void @v_sext_i32_to_i64(i64 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind { | |
51 %val = load i32, i32 addrspace(1)* %in, align 4 | |
52 %sext = sext i32 %val to i64 | |
53 store i64 %sext, i64 addrspace(1)* %out, align 8 | |
54 ret void | |
55 } | |
56 | |
57 ; SI-LABEL: {{^}}s_sext_i16_to_i64: | |
58 ; SI: s_endpgm | |
59 define void @s_sext_i16_to_i64(i64 addrspace(1)* %out, i16 %a) nounwind { | |
60 %sext = sext i16 %a to i64 | |
61 store i64 %sext, i64 addrspace(1)* %out, align 8 | |
62 ret void | |
63 } |