|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2024 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; REQUIRES: llvm-spirv, regkeys, pvc-supported |
| 10 | + |
| 11 | +; RUN: llvm-as %s -o %t.bc |
| 12 | +; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_cache_controls -o %t.spv |
| 13 | +; RUN: ocloc compile -spirv_input -file %t.spv -device pvc -options " -igc_opts 'PrintToConsole=1 PrintAfter=Layout'" 2>&1 | FileCheck %s |
| 14 | + |
| 15 | +target triple = "spir64-unknown-unknown" |
| 16 | + |
| 17 | +declare spir_func float @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8fDv8_ff(float, <8 x float>, float) |
| 18 | +declare spir_func <2 x float> @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8fDv8_fDv2_f(float, <8 x float>, <2 x float>) |
| 19 | +declare spir_func <4 x float> @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8Dv2_fDv8_fDv4_f(<2 x float>, <8 x float>, <4 x float>) |
| 20 | +declare spir_func <8 x float> @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8Dv4_fDv8_fS0_(<4 x float>, <8 x float>, <8 x float>) |
| 21 | + |
| 22 | +define spir_kernel void @test_v1(float %a, <8 x float> %b, float %acc, float addrspace(1)* %c) !intel_reqd_sub_group_size !100 { |
| 23 | +entry: |
| 24 | +; CHECK-LABEL: @test_v1( |
| 25 | +; CHECK: call float @llvm.genx.GenISA.sub.group.dpas.f32.f32.f32.v8i32(float %acc, float %a, <8 x i32> %{{.+}}, i32 10, i32 10, i32 8, i32 1, i1 false) |
| 26 | + %call = call spir_func float @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8fDv8_ff(float %a, <8 x float> %b, float %acc) |
| 27 | + %arrayidx = getelementptr inbounds float, float addrspace(1)* %c, i64 0 |
| 28 | + store float %call, float addrspace(1)* %arrayidx, align 4 |
| 29 | + ret void |
| 30 | +} |
| 31 | + |
| 32 | +define spir_kernel void @test_v2(float %a, <8 x float> %b, <2 x float> %acc, <2 x float> addrspace(1)* %c) !intel_reqd_sub_group_size !100 { |
| 33 | +entry: |
| 34 | +; CHECK-LABEL: @test_v2( |
| 35 | +; CHECK: call <2 x float> @llvm.genx.GenISA.sub.group.dpas.v2f32.v2f32.f32.v8i32(<2 x float> %acc, float %a, <8 x i32> %{{.+}}, i32 10, i32 10, i32 8, i32 2, i1 false) |
| 36 | + %call = call spir_func <2 x float> @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8fDv8_fDv2_f(float %a, <8 x float> %b, <2 x float> %acc) |
| 37 | + %arrayidx = getelementptr inbounds <2 x float>, <2 x float> addrspace(1)* %c, i64 0 |
| 38 | + store <2 x float> %call, <2 x float> addrspace(1)* %arrayidx, align 4 |
| 39 | + ret void |
| 40 | +} |
| 41 | + |
| 42 | +define spir_kernel void @test_v4(<2 x float> %a, <8 x float> %b, <4 x float> %acc, <4 x float> addrspace(1)* %c) !intel_reqd_sub_group_size !100 { |
| 43 | +entry: |
| 44 | +; CHECK-LABEL: @test_v4( |
| 45 | +; CHECK: call <4 x float> @llvm.genx.GenISA.sub.group.dpas.v4f32.v4f32.v2f32.v8i32(<4 x float> %acc, <2 x float> %a, <8 x i32> %{{.+}}, i32 10, i32 10, i32 8, i32 4, i1 false) |
| 46 | + %call = call spir_func <4 x float> @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8Dv2_fDv8_fDv4_f(<2 x float> %a, <8 x float> %b, <4 x float> %acc) |
| 47 | + %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %c, i64 0 |
| 48 | + store <4 x float> %call, <4 x float> addrspace(1)* %arrayidx, align 4 |
| 49 | + ret void |
| 50 | +} |
| 51 | + |
| 52 | +define spir_kernel void @test_v8(<4 x float> %a, <8 x float> %b, <8 x float> %acc, <8 x float> addrspace(1)* %c) !intel_reqd_sub_group_size !100 { |
| 53 | +entry: |
| 54 | +; CHECK-LABEL: @test_v8( |
| 55 | +; CHECK: call <8 x float> @llvm.genx.GenISA.sub.group.dpas.v8f32.v8f32.v4f32.v8i32(<8 x float> %acc, <4 x float> %a, <8 x i32> %{{.+}}, i32 10, i32 10, i32 8, i32 8, i1 false) |
| 56 | + %call = call spir_func <8 x float> @_Z39intel_sub_group_tf32_tf32_matrix_mad_k8Dv4_fDv8_fS0_(<4 x float> %a, <8 x float> %b, <8 x float> %acc) |
| 57 | + %arrayidx = getelementptr inbounds <8 x float>, <8 x float> addrspace(1)* %c, i64 0 |
| 58 | + store <8 x float> %call, <8 x float> addrspace(1)* %arrayidx, align 4 |
| 59 | + ret void |
| 60 | +} |
| 61 | + |
| 62 | +!100 = !{i32 16} |
0 commit comments