brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · 7370a3b Raw
168 lines · plain
1;RUN: llc -mtriple=amdgcn -mcpu=verde < %s | FileCheck --check-prefixes=GCN,SIVI %s2;RUN: llc -mtriple=amdgcn -mcpu=tonga < %s | FileCheck --check-prefixes=GCN,VIPLUS,SIVI %s3;RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck --check-prefixes=GCN,VIPLUS,GFX9 %s4 5; GCN-LABEL: {{^}}test_interrupt:6; GCN: s_mov_b32 m0, 07; GCN-NOT: s_mov_b32 m08; GCN: s_sendmsg sendmsg(MSG_INTERRUPT)9define amdgpu_kernel void @test_interrupt() {10body:11  call void @llvm.amdgcn.s.sendmsg(i32 1, i32 0);12  ret void13}14 15; GCN-LABEL: {{^}}test_gs_emit:16; GCN: s_mov_b32 m0, 017; GCN-NOT: s_mov_b32 m018; GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 0)19define amdgpu_kernel void @test_gs_emit() {20body:21  call void @llvm.amdgcn.s.sendmsg(i32 34, i32 0);22  ret void23}24 25; GCN-LABEL: {{^}}test_gs_cut:26; GCN: s_mov_b32 m0, 027; GCN-NOT: s_mov_b32 m028; GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 1)29define amdgpu_kernel void @test_gs_cut() {30body:31  call void @llvm.amdgcn.s.sendmsg(i32 274, i32 0);32  ret void33}34 35; GCN-LABEL: {{^}}test_gs_emit_cut:36; GCN: s_mov_b32 m0, 037; GCN-NOT: s_mov_b32 m038; GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2)39define amdgpu_kernel void @test_gs_emit_cut() {40body:41  call void @llvm.amdgcn.s.sendmsg(i32 562, i32 0)42  ret void43}44 45; GCN-LABEL: {{^}}test_gs_done:46; GCN: s_mov_b32 m0, 047; GCN-NOT: s_mov_b32 m048; GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP)49define amdgpu_kernel void @test_gs_done() {50body:51  call void @llvm.amdgcn.s.sendmsg(i32 3, i32 0)52  ret void53}54 55; GCN-LABEL: {{^}}test_gs_alloc_req:56; GCN: s_mov_b32 m0, s057; GCN-NOT: s_mov_b32 m058; VIPLUS-NEXT: s_nop 059; SIVI: s_sendmsg sendmsg(9, 0, 0)60; GFX9: s_sendmsg sendmsg(MSG_GS_ALLOC_REQ)61define amdgpu_kernel void @test_gs_alloc_req(i32 inreg %a) {62body:63  call void @llvm.amdgcn.s.sendmsg(i32 9, i32 %a)64  ret void65}66 67; GCN-LABEL: {{^}}sendmsg:68; GCN: s_mov_b32 m0, s069; VIPLUS-NEXT: s_nop 070; GCN-NEXT: sendmsg(MSG_GS_DONE, GS_OP_NOP)71; GCN-NEXT: s_endpgm72define amdgpu_gs void @sendmsg(i32 inreg %a) #0 {73  call void @llvm.amdgcn.s.sendmsg(i32 3, i32 %a)74  ret void75}76 77; GCN-LABEL: {{^}}sendmsghalt:78; GCN: s_mov_b32 m0, s079; VIPLUS-NEXT: s_nop 080; GCN-NEXT: s_sendmsghalt sendmsg(MSG_INTERRUPT)81; GCN-NEXT: s_endpgm82define amdgpu_kernel void @sendmsghalt(i32 inreg %a) #0 {83  call void @llvm.amdgcn.s.sendmsghalt(i32 1, i32 %a)84  ret void85}86 87; GCN-LABEL: {{^}}test_interrupt_halt:88; GCN: s_mov_b32 m0, 089; GCN-NOT: s_mov_b32 m090; GCN: s_sendmsghalt sendmsg(MSG_INTERRUPT)91define amdgpu_kernel void @test_interrupt_halt() {92body:93  call void @llvm.amdgcn.s.sendmsghalt(i32 1, i32 0)94  ret void95}96 97; GCN-LABEL: {{^}}test_gs_emit_halt:98; GCN: s_mov_b32 m0, 099; GCN-NOT: s_mov_b32 m0100; GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 0)101define amdgpu_kernel void @test_gs_emit_halt() {102body:103  call void @llvm.amdgcn.s.sendmsghalt(i32 34, i32 0)104  ret void105}106 107; GCN-LABEL: {{^}}test_gs_cut_halt:108; GCN: s_mov_b32 m0, 0109; GCN-NOT: s_mov_b32 m0110; GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_CUT, 1)111define amdgpu_kernel void @test_gs_cut_halt() {112body:113  call void @llvm.amdgcn.s.sendmsghalt(i32 274, i32 0)114  ret void115}116 117; GCN-LABEL: {{^}}test_gs_emit_cut_halt:118; GCN: s_mov_b32 m0, 0119; GCN-NOT: s_mov_b32 m0120; GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2)121define amdgpu_kernel void @test_gs_emit_cut_halt() {122body:123  call void @llvm.amdgcn.s.sendmsghalt(i32 562, i32 0)124  ret void125}126 127; GCN-LABEL: {{^}}test_gs_done_halt:128; GCN: s_mov_b32 m0, 0129; GCN-NOT: s_mov_b32 m0130; GCN: s_sendmsghalt sendmsg(MSG_GS_DONE, GS_OP_NOP)131define amdgpu_kernel void @test_gs_done_halt() {132body:133  call void @llvm.amdgcn.s.sendmsghalt(i32 3, i32 0)134  ret void135}136 137; GCN-LABEL: {{^}}test_mul24:138; GCN: s_and_b32 s0, s0, 0x1ff139; GCN: s_mul_i32 m0, s0, 0x3000140; GCN: s_sendmsg sendmsg(MSG_INTERRUPT)141define amdgpu_gs void @test_mul24(i32 inreg %arg) {142body:143  %tmp1 = and i32 %arg, 511144  %tmp2 = mul nuw nsw i32 %tmp1, 12288145  call void @llvm.amdgcn.s.sendmsg(i32 1, i32 %tmp2)146  ret void147}148 149; GCN-LABEL: {{^}}if_sendmsg:150; GCN: s_cbranch_execz151; GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP)152define amdgpu_gs void @if_sendmsg(i32 %flag) #0 {153  %cc = icmp eq i32 %flag, 0154  br i1 %cc, label %sendmsg, label %end155 156sendmsg:157  call void @llvm.amdgcn.s.sendmsg(i32 3, i32 0)158  br label %end159 160end:161  ret void162}163 164declare void @llvm.amdgcn.s.sendmsg(i32, i32) #0165declare void @llvm.amdgcn.s.sendmsghalt(i32, i32) #0166 167attributes #0 = { nounwind }168