Skip to content

Commit e0c9a6e

Browse files
troughtonstephentyrone
authored andcommitted
SIMD Overlay: inline deprecated methods (swiftlang#23250)
On Swift 5, using the deprecated `SIMD.init(_ scalar: Scalar)` initialiser rather than `SIMD.init(repeating scalar: Scalar)` will cause the type to fail to be specialised, resulting in performance degradation. Mark this method and `static prefix func -` as `@_transparent` to ensure they are correctly specialised.
1 parent 6a7b7ad commit e0c9a6e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/Darwin/simd/simd.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Darwin
1818

1919
public extension SIMD {
2020
@available(swift, deprecated:5, renamed: "init(repeating:)")
21+
@_transparent
2122
init(_ scalar: Scalar) { self.init(repeating: scalar) }
2223
}
2324

@@ -35,6 +36,7 @@ internal extension SIMD4 {
3536

3637
public extension SIMD where Scalar : FixedWidthInteger {
3738
@available(swift, deprecated:5, message: "use 0 &- rhs")
39+
@_transparent
3840
static prefix func -(rhs: Self) -> Self { return 0 &- rhs }
3941
}
4042

0 commit comments

Comments
 (0)