annotate llvm/test/CodeGen/AMDGPU/llvm.amdgcn.udot2.ll @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -march=amdgcn -mcpu=gfx906 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX906
anatofuz
parents:
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=gfx1011 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX10
anatofuz
parents:
diff changeset
3 ; RUN: llc -march=amdgcn -mcpu=gfx1012 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GFX10
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 declare i32 @llvm.amdgcn.udot2(<2 x i16> %a, <2 x i16> %b, i32 %c, i1 %clamp)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 declare i32 @llvm.amdgcn.workitem.id.x()
150
anatofuz
parents:
diff changeset
7
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
8 ; GCN-LABEL: {{^}}test_llvm_amdgcn_udot2_clamp:
150
anatofuz
parents:
diff changeset
9 ; GFX906: v_dot2_u32_u16 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}} clamp{{$}}
anatofuz
parents:
diff changeset
10 ; GFX10: v_dot2_u32_u16 v{{[0-9]+}}, s{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}} clamp{{$}}
anatofuz
parents:
diff changeset
11 define amdgpu_kernel void @test_llvm_amdgcn_udot2_clamp(
anatofuz
parents:
diff changeset
12 i32 addrspace(1)* %r,
anatofuz
parents:
diff changeset
13 <2 x i16> addrspace(1)* %a,
anatofuz
parents:
diff changeset
14 <2 x i16> addrspace(1)* %b,
anatofuz
parents:
diff changeset
15 i32 addrspace(1)* %c) {
anatofuz
parents:
diff changeset
16 entry:
anatofuz
parents:
diff changeset
17 %a.val = load <2 x i16>, <2 x i16> addrspace(1)* %a
anatofuz
parents:
diff changeset
18 %b.val = load <2 x i16>, <2 x i16> addrspace(1)* %b
anatofuz
parents:
diff changeset
19 %c.val = load i32, i32 addrspace(1)* %c
anatofuz
parents:
diff changeset
20 %r.val = call i32 @llvm.amdgcn.udot2(<2 x i16> %a.val, <2 x i16> %b.val, i32 %c.val, i1 1)
anatofuz
parents:
diff changeset
21 store i32 %r.val, i32 addrspace(1)* %r
anatofuz
parents:
diff changeset
22 ret void
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
25 ; GCN-LABEL: {{^}}test_llvm_amdgcn_udot2_no_clamp:
150
anatofuz
parents:
diff changeset
26 ; GFX906: v_dot2_u32_u16 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}{{$}}
anatofuz
parents:
diff changeset
27 ; GFX10: v_dot2_u32_u16 v{{[0-9]+}}, s{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}{{$}}
anatofuz
parents:
diff changeset
28 define amdgpu_kernel void @test_llvm_amdgcn_udot2_no_clamp(
anatofuz
parents:
diff changeset
29 i32 addrspace(1)* %r,
anatofuz
parents:
diff changeset
30 <2 x i16> addrspace(1)* %a,
anatofuz
parents:
diff changeset
31 <2 x i16> addrspace(1)* %b,
anatofuz
parents:
diff changeset
32 i32 addrspace(1)* %c) {
anatofuz
parents:
diff changeset
33 entry:
anatofuz
parents:
diff changeset
34 %a.val = load <2 x i16>, <2 x i16> addrspace(1)* %a
anatofuz
parents:
diff changeset
35 %b.val = load <2 x i16>, <2 x i16> addrspace(1)* %b
anatofuz
parents:
diff changeset
36 %c.val = load i32, i32 addrspace(1)* %c
anatofuz
parents:
diff changeset
37 %r.val = call i32 @llvm.amdgcn.udot2(<2 x i16> %a.val, <2 x i16> %b.val, i32 %c.val, i1 0)
anatofuz
parents:
diff changeset
38 store i32 %r.val, i32 addrspace(1)* %r
anatofuz
parents:
diff changeset
39 ret void
anatofuz
parents:
diff changeset
40 }
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
41
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
42 ; GCN-LABEL: {{^}}test_llvm_amdgcn_udot2_op_sel:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
43 ; GFX906: v_dot2_u32_u16 v{{[0-9]+}}, 1, v{{[0-9]+}}, s{{[0-9]+}} op_sel:[0,1,0] op_sel_hi:[0,0,1]{{$}}
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
44 ; GFX10: v_dot2_u32_u16 v{{[0-9]+}}, 1, v{{[0-9]+}}, s{{[0-9]+}} op_sel:[0,1,0] op_sel_hi:[0,0,1]{{$}}
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
45 define amdgpu_kernel void @test_llvm_amdgcn_udot2_op_sel(
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
46 i32 addrspace(1)* %r,
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
47 <2 x i16> addrspace(1)* %b,
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
48 i32 %c) {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
49 entry:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
50 %id = tail call i32 @llvm.amdgcn.workitem.id.x()
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
51 %b.gep = getelementptr inbounds <2 x i16>, <2 x i16> addrspace(1)* %b, i32 %id
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
52 %b.val = load <2 x i16>, <2 x i16> addrspace(1)* %b.gep
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
53 %b.elt0 = extractelement <2 x i16> %b.val, i32 0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
54 %b.elt1 = extractelement <2 x i16> %b.val, i32 1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
55 %b0 = insertelement <2 x i16> undef, i16 %b.elt1, i32 0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
56 %b1 = insertelement <2 x i16> %b0, i16 %b.elt0, i32 1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
57 %r.val = call i32 @llvm.amdgcn.udot2(<2 x i16> <i16 1, i16 1>, <2 x i16> %b1, i32 %c, i1 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
58 store i32 %r.val, i32 addrspace(1)* %r
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
59 ret void
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
60 }