Skip to content

Commit fbd1d4c

Browse files
Use the blessed (repeating: Scalar) init instead of (Scalar) in simd. (swiftlang#23534)
1 parent fe215ed commit fbd1d4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ public func max(_ x: ${vectype}, _ y: ${vectype}) -> ${vectype} {
8686
/// corresponding element of the input vector and the scalar.
8787
@_transparent
8888
public func min(_ vector: ${vectype}, _ scalar: ${scalar}) -> ${vectype} {
89-
return min(vector, ${vectype}(scalar))
89+
return min(vector, ${vectype}(repeating: scalar))
9090
}
9191
9292
/// Vector-scalar maximum. Each component of the result is the maximum of the
9393
/// corresponding element of the input vector and the scalar.
9494
@_transparent
9595
public func max(_ vector: ${vectype}, _ scalar: ${scalar}) -> ${vectype} {
96-
return max(vector, ${vectype}(scalar))
96+
return max(vector, ${vectype}(repeating: scalar))
9797
}
9898
9999
/// Each component of the result is the corresponding element of `x` clamped to
@@ -370,7 +370,7 @@ extension ${mattype} {
370370
371371
/// Initialize matrix to have `scalar` on main diagonal, zeros elsewhere.
372372
public init(_ scalar: ${type}) {
373-
self.init(diagonal: ${diagtype}(scalar))
373+
self.init(diagonal: ${diagtype}(repeating: scalar))
374374
}
375375
376376
/// Initialize matrix to have specified `diagonal`, and zeros elsewhere.

0 commit comments

Comments
 (0)