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
4 ; SI-LABEL: {{^}}s_sext_i1_to_i32:
5 ; SI: v_cndmask_b32_e64
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
14 ; SI-LABEL: {{^}}test_s_sext_i32_to_i64:
17 define void @test_s_sext_i32_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) nounwind {
20 %add = add i32 %mul, %c
21 %sext = sext i32 %add to i64
22 store i64 %sext, i64 addrspace(1)* %out, align 8
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]]{{\]}}
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
38 ; SI-LABEL: {{^}}s_sext_i32_to_i64:
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
47 ; SI-LABEL: {{^}}v_sext_i32_to_i64:
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
57 ; SI-LABEL: {{^}}s_sext_i16_to_i64:
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