11/* ========================== begin_copyright_notice ============================
22
3- Copyright (C) 2017-2024 Intel Corporation
3+ Copyright (C) 2017-2025 Intel Corporation
44
55SPDX-License-Identifier: MIT
66
@@ -63,6 +63,7 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
6363 XeHPCVG,
6464 Xe2,
6565 Xe3,
66+ Xe3P,
6667 Invalid,
6768 };
6869
@@ -79,6 +80,12 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
7980 // HasFP64 - True if subtarget supports double type
8081 bool HasFP64 = false ;
8182
83+ // HasNativeBFloat16 - True if subtarget supports bfloat16 arithmeics
84+ bool HasNativeBFloat16 = false ;
85+
86+ // HasMxfp - True if subtarget supports mxfp* operations
87+ bool HasMxfp = false ;
88+
8289 // HasIEEEDivSqrt - True if subtarget supports IEEE-754 div and sqrt
8390 bool HasIEEEDivSqrt = false ;
8491
@@ -123,6 +130,10 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
123130 // True if it is profitable to use native DxD->Q multiplication
124131 bool UseMulDDQ = false ;
125132
133+ // True if it is profitable to use native DxD+D->Q and DxD+Q->Q multiply-add
134+ // operations
135+ bool UseMadDDQ = false ;
136+
126137 // True if codegenerating for OCL runtime (set by default since CMRT removed)
127138 bool OCLRuntime = true ;
128139
@@ -175,6 +186,15 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
175186 // / True if subtarget supports half SIMD LSC messages
176187 bool HasHalfSIMDLSC = false ;
177188
189+ // / True if subtarget supports efficient 64-bit addressing mode
190+ bool HasEfficient64b = false ;
191+
192+ // / True if efficient 64-bit mode is enabled
193+ bool EnabledEfficient64b = false ;
194+
195+ // / Number of supported cache levels
196+ unsigned NumCacheLevels = 2 ;
197+
178198 // / True if subtarget supports sampler messages
179199 bool HasSampler = false ;
180200
@@ -235,12 +255,21 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
235255 // True if target supports global double precision atomic add/sub
236256 bool HasGlobalAtomicAddF64 = false ;
237257
258+ // True if target supports half precision atomics
259+ bool HasInstrAtomicHF16 = false ;
260+
261+ // True if target supports local single precision atomic add/sub
262+ bool HasInstrLocalAtomicAddF32 = false ;
263+
238264 // / Max supported SLM size (in kbytes)
239265 int MaxSLMSize = 64 ;
240266
241267 // Number of elements in Address Register
242268 unsigned AddressRegisterElements = 16 ;
243269
270+ // True if subtarget supports SIMD32 programming model
271+ bool HasEfficientSIMD32 = false ;
272+
244273 // Shows which surface should we use for stack
245274 PreDefined_Surface StackSurf;
246275
@@ -303,6 +332,18 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
303332
304333 bool hasLSCOffset () const { return HasLSCOffset; }
305334
335+ // * efficient 64-bit addressing is supported
336+ bool supportEfficient64b () const { return HasEfficient64b; }
337+
338+ // * efficient 64-bit addressing is supported and enabled
339+ bool hasEfficient64b () const {
340+ return HasEfficient64b && EnabledEfficient64b;
341+ }
342+
343+ bool hasLSCBase () const { return hasEfficient64b (); }
344+
345+ unsigned getLSCScaleMax () const { return hasEfficient64b () ? 32 : 1 ; }
346+
306347 bool translateLegacyMessages () const {
307348 return HasLSCMessages && TranslateLegacyMessages;
308349 }
@@ -332,6 +373,12 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
332373 // / * hasFP64 - true if target supports double fp
333374 bool hasFP64 () const { return HasFP64; }
334375
376+ // / * hasNativeBFloat16 - true if target supports bfloat16 arithmetic
377+ bool hasNativeBFloat16 () const { return HasNativeBFloat16; }
378+
379+ // / * hasMxfp - true if target supports mxfp* operations
380+ bool hasMxfp () const { return HasMxfp; }
381+
335382 // / * hasIEEEDivSqrt - true if target supports IEEE-754 div and sqrt
336383 bool hasIEEEDivSqrt () const { return HasIEEEDivSqrt; }
337384
@@ -344,6 +391,10 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
344391 // / * useMulDDQ - true if is desired to emit DxD->Q mul instruction
345392 bool useMulDDQ () const { return UseMulDDQ; }
346393
394+ // / * useMadDDQ - true if is desired to emit DxD+Q->Q and DxD+D->Q mad
395+ // / instruction
396+ bool useMadDDQ () const { return UseMadDDQ; }
397+
347398 // / * disableJmpi - true if jmpi is disabled.
348399 bool disableJmpi () const { return DisableJmpi; }
349400
@@ -411,6 +462,9 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
411462
412463 bool hasGlobalAtomicAddF64 () const { return HasGlobalAtomicAddF64; }
413464
465+ bool hasInstrAtomicHF16 () const { return HasInstrAtomicHF16; }
466+ bool hasInstrLocalAtomicAddF32 () const { return HasInstrLocalAtomicAddF32; }
467+
414468 bool hasL1ReadOnlyCache () const { return HasL1ReadOnlyCache; }
415469 bool hasLocalMemFenceSupress () const { return HasLocalMemFenceSupress; }
416470 bool hasMultiTile () const { return HasMultiTile; };
@@ -447,13 +501,19 @@ class GenXSubtarget final : public GenXGenSubtargetInfo {
447501 // / bit fields for ThreadID (from lsb to msb).
448502 ArrayRef<std::pair<int , int >> getThreadIdBits () const ;
449503
450- unsigned getNumCacheLevels () const { return 2 ; }
504+ unsigned getNumCacheLevels () const {
505+ if (hasEfficient64b ())
506+ return NumCacheLevels;
507+ return 2 ;
508+ }
451509
452510 // Address Register size in elements.
453511 unsigned getAddressRegisterElements () const {
454512 return AddressRegisterElements;
455513 }
456514
515+ bool hasEfficientSIMD32 () const { return HasEfficientSIMD32; }
516+
457517 // Generic helper functions...
458518 const Triple &getTargetTriple () const { return TargetTriple; }
459519
0 commit comments