|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2024 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; RUN: %opt %use_old_pass_manager% -GenXModule -GenXCategoryWrapper -GenXCisaBuilderPass -GenXFinalizer \ |
| 10 | +; RUN: -march=genx64 -mtriple=spir64-unknown-unknown -finalizer-opts="-dumpcommonisa -isaasmToConsole" \ |
| 11 | +; RUN: -mcpu=Xe2 -o /dev/null < %s | FileCheck %s |
| 12 | + |
| 13 | +declare <16 x i32> @llvm.vc.internal.lsc.load.block.2d.ugm.v16i32.v2i8(i1, i8, <2 x i8>, i8, i16, i16, i64, i32, i32, i32, i32, i32, i32, i32, <16 x i32>) |
| 14 | +declare <32 x i16> @llvm.vc.internal.lsc.load.block.2d.ugm.v32i16.v2i8(i1, i8, <2 x i8>, i8, i16, i16, i64, i32, i32, i32, i32, i32, i32, i32, <32 x i16>) |
| 15 | +declare <16 x i32> @llvm.vc.internal.lsc.load.block.2d.ugm.transposed.v16i32.v2i8(i1, i8, <2 x i8>, i8, i16, i16, i64, i32, i32, i32, i32, i32, i32, i32, <16 x i32>) |
| 16 | +declare <64 x i8> @llvm.vc.internal.lsc.load.block.2d.ugm.vnni.v64i8.v2i8(i1, i8, <2 x i8>, i8, i16, i16, i64, i32, i32, i32, i32, i32, i32, i32, <64 x i8>) |
| 17 | + |
| 18 | +declare void @llvm.vc.internal.lsc.prefetch.block.2d.ugm.v2i8(i1, i8, <2 x i8>, i8, i16, i16, i64, i32, i32, i32, i32, i32, i32, i32) |
| 19 | + |
| 20 | +declare void @llvm.vc.internal.lsc.store.block.2d.ugm.v2i8.v16i32(i1, i8, <2 x i8>, i8, i16, i16, i64, i32, i32, i32, i32, i32, i32, i32, <16 x i32>) |
| 21 | + |
| 22 | +; CHECK-LABEL: .kernel "test" |
| 23 | + |
| 24 | +; CHECK: .decl [[BASE:V[0-9]+]] v_type=G type=uq num_elts=1 alias=<[[IBASE:V[0-9]+]], 0> |
| 25 | +; CHECK: .decl [[WIDTH:V[0-9]+]] v_type=G type=ud num_elts=1 alias=<[[IWIDTH:V[0-9]+]], 0> |
| 26 | +; CHECK: .decl [[HEIGHT:V[0-9]+]] v_type=G type=ud num_elts=1 alias=<[[IHEIGHT:V[0-9]+]], 0> |
| 27 | +; CHECK: .decl [[PITCH:V[0-9]+]] v_type=G type=ud num_elts=1 alias=<[[IPITCH:V[0-9]+]], 0> |
| 28 | +; CHECK: .decl [[X:V[0-9]+]] v_type=G type=d num_elts=1 alias=<[[IX:V[0-9]+]], 0> |
| 29 | +; CHECK: .decl [[Y:V[0-9]+]] v_type=G type=d num_elts=1 alias=<[[IY:V[0-9]+]], 0> |
| 30 | +; CHECK: .input [[IBASE]] offset=64 size=8 |
| 31 | +; CHECK: .input [[IWIDTH]] offset=72 size=4 |
| 32 | +; CHECK: .input [[IHEIGHT]] offset=76 size=4 |
| 33 | +; CHECK: .input [[IPITCH]] offset=80 size=4 |
| 34 | +; CHECK: .input [[IX]] offset=84 size=4 |
| 35 | +; CHECK: .input [[IY]] offset=88 size=4 |
| 36 | + |
| 37 | +define dllexport spir_kernel void @test(i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y) { |
| 38 | + ; CHECK: lsc_load_block2d.ugm.uc.ca (M1, 1) [[LOAD:V[0-9]+]]:d32.8x2nn flat[[[BASE]],[[WIDTH]],[[HEIGHT]],[[PITCH]],[[X]]+16,[[Y]]+32] |
| 39 | + %load = call <16 x i32> @llvm.vc.internal.lsc.load.block.2d.ugm.v16i32.v2i8(i1 true, i8 3, <2 x i8> <i8 1, i8 2>, i8 1, i16 8, i16 2, i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y, i32 16, i32 32, <16 x i32> undef) |
| 40 | + ; CHECK: lsc_load_block2d.ugm.ca.uc (M1, 1) [[LOAD2:V[0-9]+]]:d16.2x8x2nn flat[[[BASE]],[[WIDTH]],[[HEIGHT]],[[PITCH]],[[X]]+128,[[Y]]-32] |
| 41 | + %load.a2 = call <32 x i16> @llvm.vc.internal.lsc.load.block.2d.ugm.v32i16.v2i8(i1 true, i8 2, <2 x i8> <i8 2, i8 1>, i8 2, i16 8, i16 2, i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y, i32 128, i32 -32, <32 x i16> undef) |
| 42 | + ; CHECK: lsc_load_block2d.ugm.st.uc (M1, 1) [[LOADT:V[0-9]+]]:d32.2x8tn flat[[[BASE]],[[WIDTH]],[[HEIGHT]],[[PITCH]],[[X]]-192,[[Y]]+64] |
| 43 | + %load.t = call <16 x i32> @llvm.vc.internal.lsc.load.block.2d.ugm.transposed.v16i32.v2i8(i1 true, i8 3, <2 x i8> <i8 5, i8 1>, i8 1, i16 2, i16 8, i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y, i32 -192, i32 64, <16 x i32> undef) |
| 44 | + ; CHECK: lsc_load_block2d.ugm.st.ca (M1, 1) [[LOADV:V[0-9]+]]:d8.4x16nt flat[[[BASE]],[[WIDTH]],[[HEIGHT]],[[PITCH]],[[X]],[[Y]]+128] |
| 45 | + %load.v = call <64 x i8> @llvm.vc.internal.lsc.load.block.2d.ugm.vnni.v64i8.v2i8(i1 true, i8 1, <2 x i8> <i8 5, i8 2>, i8 1, i16 4, i16 16, i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y, i32 0, i32 128, <64 x i8> undef) |
| 46 | + |
| 47 | + ; CHECK: lsc_load_block2d.ugm.uc.ca (M1, 1) %null:d64.8x2nn flat[[[BASE]],[[WIDTH]],[[HEIGHT]],[[PITCH]],[[X]]+256,[[Y]]] |
| 48 | + call void @llvm.vc.internal.lsc.prefetch.block.2d.ugm.v2i8(i1 true, i8 4, <2 x i8> <i8 1, i8 2>, i8 1, i16 8, i16 2, i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y, i32 256, i32 0) |
| 49 | + |
| 50 | + ; CHECK: lsc_store_block2d.ugm.wt.wb (M1, 1) flat[[[BASE]],[[WIDTH]],[[HEIGHT]],[[PITCH]],[[X]]-256,[[Y]]-512] [[LOAD:V[0-9]+]]:d32.8x2nn |
| 51 | + call void @llvm.vc.internal.lsc.store.block.2d.ugm.v2i8.v16i32(i1 true, i8 3, <2 x i8> <i8 4, i8 3>, i8 1, i16 8, i16 2, i64 %base, i32 %width, i32 %height, i32 %pitch, i32 %x, i32 %y, i32 -256, i32 -512, <16 x i32> %load) |
| 52 | + ret void |
| 53 | +} |
| 54 | + |
| 55 | +attributes #1 = { noinline nounwind "CMGenxMain" "VC.Stack.Amount"="0" "target-cpu"="XeHPC" } |
| 56 | + |
| 57 | +!spirv.Source = !{!0} |
| 58 | +!opencl.spir.version = !{!1} |
| 59 | +!opencl.ocl.version = !{!0} |
| 60 | +!opencl.used.extensions = !{!2} |
| 61 | +!opencl.used.optional.core.features = !{!2} |
| 62 | +!spirv.Generator = !{!3} |
| 63 | +!genx.kernels = !{!4} |
| 64 | +!genx.kernel.internal = !{!8} |
| 65 | + |
| 66 | +!0 = !{i32 0, i32 0} |
| 67 | +!1 = !{i32 1, i32 2} |
| 68 | +!2 = !{} |
| 69 | +!3 = !{i16 6, i16 14} |
| 70 | +!4 = !{void (i64, i32, i32, i32, i32, i32)* @test, !"test", !5, i32 0, !6, !0, !7, i32 0} |
| 71 | +!5 = !{i32 0, i32 0, i32 0, i32 0, i32 0, i32 0} |
| 72 | +!6 = !{i32 64, i32 72, i32 76, i32 80, i32 84, i32 88} |
| 73 | +!7 = !{!"svmptr_t"} |
| 74 | +!8 = !{void (i64, i32, i32, i32, i32, i32)* @test, null, null, null, null} |
0 commit comments