@@ -260,20 +260,10 @@ function clause hartSupports(Ext_Zvkb) = config extensions.Zvkb.supported
260260enum clause extension = Ext_Zvkg
261261mapping clause extensionName = Ext_Zvkg <-> "zvkg"
262262function clause hartSupports (Ext_Zvkg ) = config extensions . Zvkg . supported
263- // NIST Algorithm Suite with carryless multiply
264- enum clause extension = Ext_Zvknc
265- mapping clause extensionName = Ext_Zvknc <-> "zvknc"
266- function clause hartSupports (Ext_Zvknc ) = config extensions . Zvknc . supported
267- function clause currentlyEnabled (Ext_Zvknc ) = hartSupports (Ext_Zvknc )
268263// NIST Suite: Vector AES Block Cipher
269264enum clause extension = Ext_Zvkned
270265mapping clause extensionName = Ext_Zvkned <-> "zvkned"
271266function clause hartSupports (Ext_Zvkned ) = config extensions . Zvkned . supported
272- // NIST Algorithm Suite with GCM
273- enum clause extension = Ext_Zvkng
274- mapping clause extensionName = Ext_Zvkng <-> "zvkng"
275- function clause hartSupports (Ext_Zvkng ) = config extensions . Zvkng . supported
276- function clause currentlyEnabled (Ext_Zvkng ) = hartSupports (Ext_Zvkng )
277267// NIST Suite: Vector SHA-2 Secure Hash (SHA-256 only)
278268enum clause extension = Ext_Zvknha
279269mapping clause extensionName = Ext_Zvknha <-> "zvknha"
@@ -282,42 +272,54 @@ function clause hartSupports(Ext_Zvknha) = config extensions.Zvknha.supported
282272enum clause extension = Ext_Zvknhb
283273mapping clause extensionName = Ext_Zvknhb <-> "zvknhb"
284274function clause hartSupports (Ext_Zvknhb ) = config extensions . Zvknhb . supported
285- // ShangMi Algorithm Suite with carryless multiplication
286- enum clause extension = Ext_Zvksc
287- mapping clause extensionName = Ext_Zvksc <-> "zvksc"
288- function clause hartSupports (Ext_Zvksc ) = config extensions . Zvksc . supported
289- function clause currentlyEnabled (Ext_Zvksc ) = hartSupports (Ext_Zvksc )
290275// ShangMi Suite: SM4 Block Cipher
291276enum clause extension = Ext_Zvksed
292277mapping clause extensionName = Ext_Zvksed <-> "zvksed"
293278function clause hartSupports (Ext_Zvksed ) = config extensions . Zvksed . supported
294- // ShangMi Algorithm Suite with GCM
295- enum clause extension = Ext_Zvksg
296- mapping clause extensionName = Ext_Zvksg <-> "zvksg"
297- function clause hartSupports (Ext_Zvksg ) = config extensions . Zvksg . supported
298- function clause currentlyEnabled (Ext_Zvksg ) = hartSupports (Ext_Zvksg )
299279// ShangMi Suite: SM3 Secure Hash
300280enum clause extension = Ext_Zvksh
301281mapping clause extensionName = Ext_Zvksh <-> "zvksh"
302282function clause hartSupports (Ext_Zvksh ) = config extensions . Zvksh . supported
303- // Zvkn and Zvks are intentionally not in alphabetical order.
304- // Otherwise, we cannot check whether Zvkn or Zvks are implicitly supported
305- // via Zvknc or Zvkng and Zvksc or Zvksg, respectively.
306- // NIST Algorithm Suite
283+ // Vector Data Independent Execution Latency
284+ enum clause extension = Ext_Zvkt
285+ mapping clause extensionName = Ext_Zvkt <-> "zvkt"
286+ function clause hartSupports (Ext_Zvkt ) = config extensions . Zvkt . supported
287+ function clause currentlyEnabled (Ext_Zvkt ) = hartSupports (Ext_Zvkt )
288+ // The following extensions are superset/shorthand extensions that cannot be directly
289+ // configured in the config file and are not part of the device-tree. These extensions
290+ // are automatically enabled when all their required component extensions are enabled.
291+ // This approach simplifies checking for support of subset extensions
307292enum clause extension = Ext_Zvkn
308293mapping clause extensionName = Ext_Zvkn <-> "zvkn"
309- function clause hartSupports (Ext_Zvkn ) = config extensions . Zvkn . supported
310- function clause currentlyEnabled (Ext_Zvkn ) = hartSupports (Ext_Zvkn ) | currentlyEnabled (Ext_Zvknc ) | currentlyEnabled (Ext_Zvkng )
294+ function clause currentlyEnabled (Ext_Zvkn ) =
295+ currentlyEnabled (Ext_Zvkned ) &
296+ currentlyEnabled (Ext_Zvknhb ) &
297+ currentlyEnabled (Ext_Zvkb ) &
298+ currentlyEnabled (Ext_Zvkt )
299+ // NIST Algorithm Suite with carryless multiply
300+ enum clause extension = Ext_Zvknc
301+ mapping clause extensionName = Ext_Zvknc <-> "zvknc"
302+ function clause currentlyEnabled (Ext_Zvknc ) = currentlyEnabled (Ext_Zvkn ) & currentlyEnabled (Ext_Zvbc )
303+ // NIST Algorithm Suite with GCM
304+ enum clause extension = Ext_Zvkng
305+ mapping clause extensionName = Ext_Zvkng <-> "zvkng"
306+ function clause currentlyEnabled (Ext_Zvkng ) = currentlyEnabled (Ext_Zvkn ) & currentlyEnabled (Ext_Zvkg )
311307// ShangMi Algorithm Suite
312308enum clause extension = Ext_Zvks
313309mapping clause extensionName = Ext_Zvks <-> "zvks"
314- function clause hartSupports (Ext_Zvks ) = config extensions . Zvks . supported
315- function clause currentlyEnabled (Ext_Zvks ) = hartSupports (Ext_Zvks ) | currentlyEnabled (Ext_Zvksc ) | currentlyEnabled (Ext_Zvksg )
316- // Vector Data Independent Execution Latency
317- enum clause extension = Ext_Zvkt
318- mapping clause extensionName = Ext_Zvkt <-> "zvkt"
319- function clause hartSupports (Ext_Zvkt ) = config extensions . Zvkt . supported
320- function clause currentlyEnabled (Ext_Zvkt ) = hartSupports (Ext_Zvkt ) | currentlyEnabled (Ext_Zvkn ) | currentlyEnabled (Ext_Zvks )
310+ function clause currentlyEnabled (Ext_Zvks ) =
311+ currentlyEnabled (Ext_Zvksed ) &
312+ currentlyEnabled (Ext_Zvksh ) &
313+ currentlyEnabled (Ext_Zvkb ) &
314+ currentlyEnabled (Ext_Zvkt )
315+ // ShangMi Algorithm Suite with carryless multiplication
316+ enum clause extension = Ext_Zvksc
317+ mapping clause extensionName = Ext_Zvksc <-> "zvksc"
318+ function clause currentlyEnabled (Ext_Zvksc ) = currentlyEnabled (Ext_Zvks ) & currentlyEnabled (Ext_Zvbc )
319+ // ShangMi Algorithm Suite with GCM
320+ enum clause extension = Ext_Zvksg
321+ mapping clause extensionName = Ext_Zvksg <-> "zvksg"
322+ function clause currentlyEnabled (Ext_Zvksg ) = currentlyEnabled (Ext_Zvks ) & currentlyEnabled (Ext_Zvkg )
321323
322324// Count Overflow and Mode-Based Filtering
323325enum clause extension = Ext_Sscofpmf
@@ -436,16 +438,10 @@ let extensions_ordered_for_isa_string = [
436438 Ext_Zvbc ,
437439 Ext_Zvkb ,
438440 Ext_Zvkg ,
439- Ext_Zvkn ,
440- Ext_Zvknc ,
441441 Ext_Zvkned ,
442- Ext_Zvkng ,
443442 Ext_Zvknha ,
444443 Ext_Zvknhb ,
445- Ext_Zvks ,
446- Ext_Zvksc ,
447444 Ext_Zvksed ,
448- Ext_Zvksg ,
449445 Ext_Zvksh ,
450446 Ext_Zvkt ,
451447
0 commit comments