Skip to content

Commit f45f621

Browse files
vsemenov368igcbot
authored andcommitted
Add support for Panther Lake devices
.
1 parent fa73391 commit f45f621

File tree

23 files changed

+684
-1
lines changed

23 files changed

+684
-1
lines changed

IGC/VectorCompiler/cmake/supported_platforms_list.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ set(SUPPORTED_VC_PLATFORMS
1919
"XeHPC"
2020
"XeHPCVG"
2121
"Xe2"
22+
"Xe3"
2223
)

IGC/VectorCompiler/igcdeps/src/TranslationInterface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ getPlatformName(const PLATFORM &Platform) {
177177
if (Product == IGFX_BMG)
178178
return {"Xe2", RevId};
179179
break;
180+
case IGFX_XE3_CORE:
181+
if (Product == IGFX_PTL)
182+
return {"Xe3", RevId};
183+
LLVM_FALLTHROUGH;
180184
default:
181185
break;
182186
}

IGC/VectorCompiler/include/GenXSubtarget.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
6262
XeHPC,
6363
XeHPCVG,
6464
Xe2,
65+
Xe3,
6566
Invalid,
6667
};
6768

@@ -225,6 +226,9 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
225226
/// True if subtarget supports large GRF mode
226227
bool HasLargeGRF = false;
227228

229+
/// True if subtarget supports VRT
230+
bool HasVRT = false;
231+
228232
// True if target supports local integer compare exchange 64-bit
229233
bool HasLocalIntegerCas64 = false;
230234

@@ -423,6 +427,8 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
423427

424428
bool hasLargeGRF() const { return HasLargeGRF; }
425429

430+
bool hasVRT() const { return HasVRT; }
431+
426432
/// * getsHWTIDFromPredef - some subtargets get HWTID from
427433
// predefined variable instead of sr0, returns *true* for such ones.
428434
bool getsHWTIDFromPredef() const { return GetsHWTIDFromPredef; }

IGC/VectorCompiler/lib/Driver/Driver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,12 @@ static Error fillApiOptions(const opt::ArgList &ApiOptions,
798798
if (opt::Arg *A = ApiOptions.getLastArg(OPT_exp_register_file_size_common)) {
799799
StringRef V = A->getValue();
800800
auto MaybeGRFSize = StringSwitch<llvm::Optional<unsigned>>(V)
801+
.Case("32", 32)
802+
.Case("64", 64)
803+
.Case("96", 96)
801804
.Case("128", 128)
805+
.Case("160", 160)
806+
.Case("192", 192)
802807
.Case("256", 256)
803808
.Default({});
804809
if (!MaybeGRFSize)

IGC/VectorCompiler/lib/GenXCodeGen/GenX.td

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ def FeatureHasMediaWalker : SubtargetFeature<"feature_has_media_walker",
237237
def FeatureHasLargeGRF : SubtargetFeature<"feature_has_large_grf",
238238
"HasLargeGRF", "true",
239239
"Target supports large GRF mode">;
240+
def FeatureHasVRT : SubtargetFeature<"feature_has_variable_regs_per_thread",
241+
"HasVRT", "true",
242+
"Target supports variable amount of registers per thread">;
243+
def FeatureHas10ThreadsPerEU : SubtargetFeature<"feature_10threads_per_eu",
244+
"NumThreadsPerEU", "10",
245+
"Target has 10 threads per EU">;
240246
def FeatureHas7ThreadsPerEU : SubtargetFeature<"feature_7threads_per_eu",
241247
"NumThreadsPerEU", "7",
242248
"Target has 7 threads per EU">;
@@ -525,6 +531,39 @@ def : Proc<"Xe2", [
525531
FeatureTransLegacy,
526532
]>;
527533

534+
def : Proc<"Xe3", [
535+
FeatureFP64,
536+
FeatureGRFByteSize64,
537+
FeatureHas10ThreadsPerEU,
538+
FeatureHasAdd3,
539+
FeatureHasBfn,
540+
FeatureHasLSC,
541+
FeatureHasLSCOffset,
542+
FeatureHasLSCTyped,
543+
FeatureHasLargeGRF,
544+
FeatureHasMadSimd32,
545+
FeatureHasNamedBarriers,
546+
FeatureHasOWordSLM,
547+
FeatureHasSampler,
548+
FeatureHasVRT,
549+
FeatureIEEEDivSqrt,
550+
FeatureIndirectGRFCrossing,
551+
FeatureInstr64BitRotate,
552+
FeatureInstrAdd64,
553+
FeatureInstrGlobalAtomicAddF64,
554+
FeatureInstrLocalIntegerCas64,
555+
FeatureLSCMaxWidth32,
556+
FeatureLongLong,
557+
FeatureNoLegacyDataport,
558+
FeaturePartialI64Emulation,
559+
FeaturePreemption,
560+
FeatureSLM128K,
561+
FeatureSwitchjmp,
562+
FeatureSystolicDenormControl,
563+
FeatureThreadPayloadInMemory,
564+
FeatureTransLegacy,
565+
]>;
566+
528567
def GenX : Target {
529568
// Nothing here (yet?)
530569
}

IGC/VectorCompiler/lib/GenXCodeGen/GenXSubtarget.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ void GenXSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
7070
.Case("XeHPC", XeHPC)
7171
.Case("XeHPCVG", XeHPCVG)
7272
.Case("Xe2", Xe2)
73+
.Case("Xe3", Xe3)
7374
.Default(Invalid);
7475

7576
std::string CPUName(CPU);
@@ -103,6 +104,8 @@ uint32_t GenXSubtarget::getMaxThreadsNumPerSubDevice() const {
103104
return 1 << 12;
104105
case Xe2:
105106
return 1 << 13;
107+
case Xe3:
108+
return 1 << 15;
106109
}
107110
return 0;
108111
}
@@ -148,6 +151,16 @@ ArrayRef<std::pair<int, int>> GenXSubtarget::getThreadIdReservedBits() const {
148151
static const std::pair<int, int> Bits[] = {{10, 1}, {7, 1}, {3, 1}};
149152
return Bits;
150153
}
154+
case GenXSubtarget::Xe3: {
155+
// [17:14] Slice ID.
156+
// [13:12] : Reserved MBZ
157+
// [11:8] SubSlice ID
158+
// [7] : Reserved MBZ
159+
// [6:4] : EUID
160+
// [3:0] : TID
161+
static const std::pair<int, int> Bits[] = {{12, 2}, {7, 1}};
162+
return Bits;
163+
}
151164
default:
152165
// All other platforms have pre-defined Thread ID register
153166
return {};
@@ -205,7 +218,8 @@ ArrayRef<std::pair<int, int>> GenXSubtarget::getEUIdBits() const {
205218
static const std::pair<int, int> Bits[] = {{4, 2}, {8, 1}};
206219
return Bits;
207220
}
208-
case GenXSubtarget::Xe2: {
221+
case GenXSubtarget::Xe2:
222+
case GenXSubtarget::Xe3: {
209223
// [6:4] : EUID
210224
static const std::pair<int, int> Bits[] = {{4, 3}};
211225
return Bits;
@@ -218,6 +232,11 @@ ArrayRef<std::pair<int, int>> GenXSubtarget::getEUIdBits() const {
218232

219233
ArrayRef<std::pair<int, int>> GenXSubtarget::getThreadIdBits() const {
220234
switch (TargetId) {
235+
case GenXSubtarget::Xe3: {
236+
// [3:0] : EUID
237+
static const std::pair<int, int> Bits[] = {{0, 4}};
238+
return Bits;
239+
}
221240
default:
222241
static const std::pair<int, int> Bits[] = {{0, 3}};
223242
return Bits;
@@ -252,6 +271,8 @@ TARGET_PLATFORM GenXSubtarget::getVisaPlatform() const {
252271
return TARGET_PLATFORM::Xe_PVCXT;
253272
case Xe2:
254273
return TARGET_PLATFORM::Xe2;
274+
case Xe3:
275+
return TARGET_PLATFORM::Xe3;
255276
default:
256277
return TARGET_PLATFORM::GENX_NONE;
257278
}
@@ -287,6 +308,11 @@ bool GenXSubtarget::isValidGRFSize(unsigned Size) const {
287308
case GenXSubtarget::XeHPCVG:
288309
case GenXSubtarget::Xe2:
289310
return Size == 128 || Size == 256;
311+
case GenXSubtarget::Xe3: {
312+
static const std::unordered_set<unsigned> Supported = {32, 64, 96, 128,
313+
160, 192, 256};
314+
return Supported.count(Size);
315+
}
290316
default:
291317
return Size == 128; // platforms <= TGL
292318
}

IGC/VectorCompiler/lib/GenXCodeGen/Utils/cisa_gen_intrinsics.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3652,6 +3652,20 @@
36523652
"opc": "ISA_SBARRIER",
36533653
"signal_flag": [ "BYTE", 1 ]
36543654
},
3655+
"genx_qf_cvt": {
3656+
"opc": "ISA_FCVT",
3657+
"exec_size": [ "EXECSIZE_NOMASK" ],
3658+
"elementwise": [ "ELEMENTWISE" ],
3659+
"dst": [ "GENERAL", "UNSIGNED", "SATURATION_INTALLOWED", 0 ],
3660+
"src0": [ "GENERAL", "UNSIGNED", "NOIMM", 1 ]
3661+
},
3662+
"genx_hf8_cvt": {
3663+
"opc": "ISA_FCVT",
3664+
"exec_size": [ "EXECSIZE_NOMASK" ],
3665+
"elementwise": [ "ELEMENTWISE" ],
3666+
"dst": [ "GENERAL", "SIGNED", "SATURATION_INTALLOWED", 0 ],
3667+
"src0": [ "GENERAL", "SIGNED", "NOIMM", 1 ]
3668+
},
36553669
"genx_bfrev": {
36563670
"opc": "ISA_BFREV",
36573671
"exec_size": [ "EXECSIZE" ],
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2021-2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; COM: ;;;;;;;;;; RUNNERS ;;;;;;;;;;
10+
11+
; RUN: %llc_typed_ptrs %s -march=genx64 -mcpu=Xe3 -vc-skip-ocl-runtime-info -finalizer-opts='-dumpcommonisa -isaasmToConsole' -o /dev/null \
12+
; RUN: | FileCheck %s
13+
; RUN: %llc_opaque_ptrs %s -march=genx64 -mcpu=Xe3 -vc-skip-ocl-runtime-info -finalizer-opts='-dumpcommonisa -isaasmToConsole' -o /dev/null \
14+
; RUN: | FileCheck %s
15+
16+
; COM: ;;;;;;;;;; CHECKERS ;;;;;;;;;;
17+
18+
; CHECK-DAG: .decl [[SRC:V[^ ]+]] v_type=G type=ub num_elts=16 alias
19+
; CHECK-DAG: .decl [[DST:V[^ ]+]] v_type=G type=hf num_elts=16 alias
20+
; CHECK: fcvt (M1_NM, 16) [[DST]](0,0)<1> [[SRC]](0,0)<1;1,0>
21+
22+
23+
24+
; COM: ;;;;;;;;;; KERNEL ;;;;;;;;;;
25+
26+
target datalayout = "e-p:64:64-i64:64-n8:16:32"
27+
target triple = "genx64-unknown-unknown"
28+
29+
declare <16 x i8> @llvm.genx.oword.ld.v16i8(i32, i32, i32)
30+
declare <16 x half> @llvm.genx.qf.cvt.v16f16.v16i8(<16 x i8>)
31+
declare void @llvm.genx.oword.st.v16f16(i32, i32, <16 x half>)
32+
33+
define dllexport spir_kernel void @bf8_cvtKernel_in(i32 %0, i32 %1) local_unnamed_addr #0 {
34+
%vec = tail call <16 x i8> @llvm.genx.oword.ld.v16i8(i32 0, i32 %0, i32 0)
35+
%upd_vec = tail call <16 x half> @llvm.genx.qf.cvt.v16f16.v16i8(<16 x i8> %vec)
36+
tail call void @llvm.genx.oword.st.v16f16(i32 %1, i32 0, <16 x half> %upd_vec)
37+
ret void
38+
}
39+
40+
attributes #0 = { noinline nounwind "CMGenxMain" }
41+
42+
!spirv.Source = !{!1}
43+
!opencl.spir.version = !{!2}
44+
!opencl.ocl.version = !{!1}
45+
!opencl.used.extensions = !{!0}
46+
!opencl.used.optional.core.features = !{!0}
47+
!spirv.Generator = !{!3}
48+
!genx.kernels = !{!4}
49+
!genx.kernel.internal = !{!8}
50+
51+
!0 = !{}
52+
!1 = !{i32 0, i32 0}
53+
!2 = !{i32 1, i32 2}
54+
!3 = !{i16 6, i16 14}
55+
!4 = !{void (i32, i32)* @bf8_cvtKernel_in, !"bf8_cvtKernel_in", !5, i32 0, !6, !1, !7, i32 0}
56+
!5 = !{i32 2, i32 2}
57+
!6 = !{i32 64, i32 68}
58+
!7 = !{!"buffer_t", !"buffer_t"}
59+
!8 = !{void (i32, i32)* @bf8_cvtKernel_in, null, null, null, null}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2021-2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; COM: ;;;;;;;;;; RUNNERS ;;;;;;;;;;
10+
11+
; RUN: %llc_typed_ptrs %s -march=genx64 -mcpu=Xe3 -vc-skip-ocl-runtime-info -finalizer-opts='-dumpcommonisa -isaasmToConsole' -o /dev/null \
12+
; RUN: | FileCheck %s
13+
; RUN: %llc_opaque_ptrs %s -march=genx64 -mcpu=Xe3 -vc-skip-ocl-runtime-info -finalizer-opts='-dumpcommonisa -isaasmToConsole' -o /dev/null \
14+
; RUN: | FileCheck %s
15+
16+
; COM: ;;;;;;;;;; CHECKERS ;;;;;;;;;;
17+
18+
; CHECK-DAG: .decl [[SRC:V[^ ]+]] v_type=G type=ub num_elts=16 alias
19+
; CHECK-DAG: .decl [[DST:V[^ ]+]] v_type=G type=hf num_elts=16 alias
20+
; CHECK: fcvt (M1_NM, 16) [[DST]](0,0)<1> [[SRC]](0,0)<1;1,0>
21+
; CHECK-NEXT: mov.sat (M1, 16) [[SAT:V[0-9]+]](0,0)<1>
22+
23+
24+
25+
; COM: ;;;;;;;;;; KERNEL ;;;;;;;;;;
26+
27+
target datalayout = "e-p:64:64-i64:64-n8:16:32"
28+
target triple = "genx64-unknown-unknown"
29+
30+
declare <16 x i8> @llvm.genx.oword.ld.v16i8(i32, i32, i32)
31+
declare <16 x half> @llvm.genx.qf.cvt.v16f16.v16i8(<16 x i8>)
32+
declare <16 x half> @llvm.genx.sat.v16f16(<16 x half>)
33+
declare void @llvm.genx.oword.st.v16f16(i32, i32, <16 x half>)
34+
35+
define dllexport spir_kernel void @bf8_cvtKernel_in_sat(i32 %0, i32 %1) local_unnamed_addr #0 {
36+
%vec = tail call <16 x i8> @llvm.genx.oword.ld.v16i8(i32 0, i32 %0, i32 0)
37+
%upd_vec = tail call <16 x half> @llvm.genx.qf.cvt.v16f16.v16i8(<16 x i8> %vec)
38+
%sat = tail call <16 x half> @llvm.genx.sat.v16f16(<16 x half> %upd_vec)
39+
tail call void @llvm.genx.oword.st.v16f16(i32 %1, i32 0, <16 x half> %sat)
40+
ret void
41+
}
42+
43+
attributes #0 = { noinline nounwind "CMGenxMain" }
44+
45+
!spirv.Source = !{!1}
46+
!opencl.spir.version = !{!2}
47+
!opencl.ocl.version = !{!1}
48+
!opencl.used.extensions = !{!0}
49+
!opencl.used.optional.core.features = !{!0}
50+
!spirv.Generator = !{!3}
51+
!genx.kernels = !{!4}
52+
!genx.kernel.internal = !{!8}
53+
54+
!0 = !{}
55+
!1 = !{i32 0, i32 0}
56+
!2 = !{i32 1, i32 2}
57+
!3 = !{i16 6, i16 14}
58+
!4 = !{void (i32, i32)* @bf8_cvtKernel_in_sat, !"bf8_cvtKernel_in_sat", !5, i32 0, !6, !1, !7, i32 0}
59+
!5 = !{i32 2, i32 2}
60+
!6 = !{i32 64, i32 68}
61+
!7 = !{!"buffer_t", !"buffer_t"}
62+
!8 = !{void (i32, i32)* @bf8_cvtKernel_in_sat, null, null, null, null}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2021-2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; COM: ;;;;;;;;;; RUNNERS ;;;;;;;;;;
10+
11+
; RUN: %llc_typed_ptrs %s -march=genx64 -mcpu=Xe3 -vc-skip-ocl-runtime-info -finalizer-opts='-dumpcommonisa -isaasmToConsole' -o /dev/null \
12+
; RUN: | FileCheck %s
13+
; RUN: %llc_opaque_ptrs %s -march=genx64 -mcpu=Xe3 -vc-skip-ocl-runtime-info -finalizer-opts='-dumpcommonisa -isaasmToConsole' -o /dev/null \
14+
; RUN: | FileCheck %s
15+
16+
17+
; COM: ;;;;;;;;;; CHECKERS ;;;;;;;;;;
18+
19+
; CHECK-DAG: .decl [[SRC:V[^ ]+]] v_type=G type=hf num_elts=16 alias
20+
; CHECK-DAG: .decl [[DST:V[^ ]+]] v_type=G type=ub num_elts=16 alias
21+
; CHECK: fcvt (M1_NM, 16) [[DST]](0,0)<1> [[SRC]](0,0)<1;1,0>
22+
23+
24+
25+
; COM: ;;;;;;;;;; KERNEL ;;;;;;;;;;
26+
27+
target datalayout = "e-p:64:64-i64:64-n8:16:32"
28+
target triple = "genx64-unknown-unknown"
29+
30+
declare <16 x half> @llvm.genx.oword.ld.v16f16(i32, i32, i32)
31+
declare <16 x i8> @llvm.genx.qf.cvt.v16i8.v16f16(<16 x half>)
32+
declare void @llvm.genx.oword.st.v16i8(i32, i32, <16 x i8>)
33+
34+
define dllexport spir_kernel void @bf8_cvtKernel_out(i32 %0, i32 %1) local_unnamed_addr #0 {
35+
%vec = tail call <16 x half> @llvm.genx.oword.ld.v16f16(i32 0, i32 %0, i32 0)
36+
%upd_vec = tail call <16 x i8> @llvm.genx.qf.cvt.v16i8.v16f16(<16 x half> %vec)
37+
tail call void @llvm.genx.oword.st.v16i8(i32 %1, i32 0, <16 x i8> %upd_vec)
38+
ret void
39+
}
40+
41+
attributes #0 = { noinline nounwind "CMGenxMain" }
42+
43+
!spirv.Source = !{!1}
44+
!opencl.spir.version = !{!2}
45+
!opencl.ocl.version = !{!1}
46+
!opencl.used.extensions = !{!0}
47+
!opencl.used.optional.core.features = !{!0}
48+
!spirv.Generator = !{!3}
49+
!genx.kernels = !{!4}
50+
!genx.kernel.internal = !{!8}
51+
52+
!0 = !{}
53+
!1 = !{i32 0, i32 0}
54+
!2 = !{i32 1, i32 2}
55+
!3 = !{i16 6, i16 14}
56+
!4 = !{void (i32, i32)* @bf8_cvtKernel_out, !"bf8_cvtKernel_out", !5, i32 0, !6, !1, !7, i32 0}
57+
!5 = !{i32 2, i32 2}
58+
!6 = !{i32 64, i32 68}
59+
!7 = !{!"buffer_t", !"buffer_t"}
60+
!8 = !{void (i32, i32)* @bf8_cvtKernel_out, null, null, null, null}

0 commit comments

Comments
 (0)