Concrete SIMD.init(repeating:) and SIMD.init(lowHalf:highHalf:) optimizations (#81766)

WIP to add more overloads to optimize SIMD codegen on concrete types.
Here we do:

- init(repeating:)
- init(lowHalf:highHalf:)

These are always inlined, even in debug, since LLVM knows how to lower
them to one or two instructions on the targets that we care about.
This commit is contained in:
Stephen Canon
2025-05-27 15:15:13 -04:00
committed by GitHub
parent 746414bcd8
commit 592d72bba9
12 changed files with 865 additions and 378 deletions

View File

@@ -72,6 +72,16 @@ def all_integer_types(word_bits):
is_word=True, bits=word_bits,
is_signed=is_signed)
def all_signed_types(word_bits):
for bitwidth in _all_integer_type_bitwidths:
yield SwiftIntegerType(
is_word=False, bits=bitwidth,
is_signed=True)
yield SwiftIntegerType(
is_word=True, bits=word_bits,
is_signed=True)
# 'truncatingBitPattern' initializer is defined if the conversion is truncating
# on any platform that Swift supports.