1; RUN: llc -march=amdgcn -mcpu=gfx906 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX9 2; RUN: llc -march=amdgcn -mcpu=gfx940 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX9 3; RUN: llc -march=amdgcn -mcpu=gfx1011 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX10 4; RUN: llc -march=amdgcn -mcpu=gfx1012 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX10 5 6declare i32 @llvm.amdgcn.udot4(i32 %a, i32 %b, i32 %c, i1 %clamp) 7 8; GCN-LABEL: {{^}}test_llvm_amdgcn_udot4_clamp 9; GFX9: v_dot4_u32_u8 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}} clamp{{$}} 10; GFX10: v_dot4_u32_u8 v{{[0-9]+}}, s{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}} clamp{{$}} 11define amdgpu_kernel void @test_llvm_amdgcn_udot4_clamp( 12 i32 addrspace(1)* %r, 13 <4 x i8> addrspace(1)* %a, 14 <4 x i8> addrspace(1)* %b, 15 i32 addrspace(1)* %c) { 16entry: 17 %a.val = load <4 x i8>, <4 x i8> addrspace(1)* %a 18 %b.val = load <4 x i8>, <4 x i8> addrspace(1)* %b 19 %a.val.cast = bitcast <4 x i8> %a.val to i32 20 %b.val.cast = bitcast <4 x i8> %b.val to i32 21 %c.val = load i32, i32 addrspace(1)* %c 22 %r.val = call i32 @llvm.amdgcn.udot4(i32 %a.val.cast, i32 %b.val.cast, i32 %c.val, i1 1) 23 store i32 %r.val, i32 addrspace(1)* %r 24 ret void 25} 26 27; GCN-LABEL: {{^}}test_llvm_amdgcn_udot4_no_clamp 28; GFX9: v_dot4_u32_u8 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}{{$}} 29; GFX10: v_dot4_u32_u8 v{{[0-9]+}}, s{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}{{$}} 30define amdgpu_kernel void @test_llvm_amdgcn_udot4_no_clamp( 31 i32 addrspace(1)* %r, 32 <4 x i8> addrspace(1)* %a, 33 <4 x i8> addrspace(1)* %b, 34 i32 addrspace(1)* %c) { 35entry: 36 %a.val = load <4 x i8>, <4 x i8> addrspace(1)* %a 37 %b.val = load <4 x i8>, <4 x i8> addrspace(1)* %b 38 %a.val.cast = bitcast <4 x i8> %a.val to i32 39 %b.val.cast = bitcast <4 x i8> %b.val to i32 40 %c.val = load i32, i32 addrspace(1)* %c 41 %r.val = call i32 @llvm.amdgcn.udot4(i32 %a.val.cast, i32 %b.val.cast, i32 %c.val, i1 0) 42 store i32 %r.val, i32 addrspace(1)* %r 43 ret void 44} 45