db-tu-dresden / TSL

Template SIMD Library (+Generator)
GNU General Public License v3.0
7 stars 8 forks source link

Allow for flag disjunction and synonyms in extensions #49

Closed alexKrauseTUD closed 1 year ago

alexKrauseTUD commented 1 year ago

This PR makes two contributions. First: Until now, lscpu flags in primitive_data definitions represent a conjunctive list of have-to-be-present flags, e.g.:

  • target_extension: "neon" ctype: ["uint8_t", "uint16_t", "uint32_t", "uint64_t", "int8_t", "int16_t", "int32_t", "int64_t", "float", "double"] lscpu_flags: [ 'neon' ] This PR enables the specification of multiple groups of flags, which are disjunctively connected, like so:
  • target_extension: "neon" ctype: ["uint8_t", "uint16_t", "uint32_t", "uint64_t", "int8_t", "int16_t", "int32_t", "int64_t", "float", "double"] lscpu_flags: [['neon'],['asimd']]

The specification makes the respective primitive relevant if either 'neon' *or' 'asimd' is present in the relevant hardware flags.

Second: We introduce the new optional array _synonymflags to extensions, to be used like so:

synonym_flags: {asimd: "neon"}

For every relevant extension, if it has synonym flags, the occurence of the synonym key inside the relevant hardware flags will be replaced by the synonym value. That is

fp asimd evtstrm aes pmull sha1 sha2 crc32

will be converted to

fp neon evtstrm aes pmull sha1 sha2 crc32

alexKrauseTUD commented 1 year ago

Note that this PR does not fix potential errors within the ARM Neon primitive specifications, if any.