• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck %s
2
3declare void @llvm.write_register.i32(metadata, i32) #0
4declare void @llvm.write_register.i64(metadata, i64) #0
5
6; CHECK-LABEL: {{^}}test_write_m0:
7define void @test_write_m0(i32 %val) #0 {
8  call void @llvm.write_register.i32(metadata !0, i32 0)
9  call void @llvm.write_register.i32(metadata !0, i32 -1)
10  call void @llvm.write_register.i32(metadata !0, i32 %val)
11  ret void
12}
13
14; CHECK-LABEL: {{^}}test_write_exec:
15; CHECK: s_mov_b64 exec, 0
16; CHECK: s_mov_b64 exec, -1
17; CHECK: s_mov_b64 exec, s{{\[[0-9]+:[0-9]+\]}}
18define void @test_write_exec(i64 %val) #0 {
19  call void @llvm.write_register.i64(metadata !1, i64 0)
20  call void @llvm.write_register.i64(metadata !1, i64 -1)
21  call void @llvm.write_register.i64(metadata !1, i64 %val)
22  ret void
23}
24
25; CHECK-LABEL: {{^}}test_write_flat_scratch:
26; CHECK: s_mov_b64 flat_scratch, 0
27; CHECK: s_mov_b64 flat_scratch, -1
28; CHECK: s_mov_b64 flat_scratch, s{{\[[0-9]+:[0-9]+\]}}
29define void @test_write_flat_scratch(i64 %val) #0 {
30  call void @llvm.write_register.i64(metadata !2, i64 0)
31  call void @llvm.write_register.i64(metadata !2, i64 -1)
32  call void @llvm.write_register.i64(metadata !2, i64 %val)
33  ret void
34}
35
36; CHECK-LABEL: {{^}}test_write_flat_scratch_lo:
37; CHECK: s_mov_b32 flat_scratch_lo, 0
38; CHECK: s_mov_b32 flat_scratch_lo, s{{[0-9]+}}
39define void @test_write_flat_scratch_lo(i32 %val) #0 {
40  call void @llvm.write_register.i32(metadata !3, i32 0)
41  call void @llvm.write_register.i32(metadata !3, i32 %val)
42  ret void
43}
44
45; CHECK-LABEL: {{^}}test_write_flat_scratch_hi:
46; CHECK: s_mov_b32 flat_scratch_hi, 0
47; CHECK: s_mov_b32 flat_scratch_hi, s{{[0-9]+}}
48define void @test_write_flat_scratch_hi(i32 %val) #0 {
49  call void @llvm.write_register.i32(metadata !4, i32 0)
50  call void @llvm.write_register.i32(metadata !4, i32 %val)
51  ret void
52}
53
54; CHECK-LABEL: {{^}}test_write_exec_lo:
55; CHECK: s_mov_b32 exec_lo, 0
56; CHECK: s_mov_b32 exec_lo, s{{[0-9]+}}
57define void @test_write_exec_lo(i32 %val) #0 {
58  call void @llvm.write_register.i32(metadata !5, i32 0)
59  call void @llvm.write_register.i32(metadata !5, i32 %val)
60  ret void
61}
62
63; CHECK-LABEL: {{^}}test_write_exec_hi:
64; CHECK: s_mov_b32 exec_hi, 0
65; CHECK: s_mov_b32 exec_hi, s{{[0-9]+}}
66define void @test_write_exec_hi(i32 %val) #0 {
67  call void @llvm.write_register.i32(metadata !6, i32 0)
68  call void @llvm.write_register.i32(metadata !6, i32 %val)
69  ret void
70}
71
72attributes #0 = { nounwind }
73
74!0 = !{!"m0"}
75!1 = !{!"exec"}
76!2 = !{!"flat_scratch"}
77!3 = !{!"flat_scratch_lo"}
78!4 = !{!"flat_scratch_hi"}
79!5 = !{!"exec_lo"}
80!6 = !{!"exec_hi"}
81