Skip to content

Commit 2821b8f

Browse files
committed
Fix up AdditiveArithmetic conformance.
1 parent c8df93f commit 2821b8f

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

stdlib/public/core/SIMDVector.swift

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ extension SIMD where Scalar: FloatingPoint {
12211221

12221222
@_transparent
12231223
// SWIFT_ENABLE_TENSORFLOW
1224-
@differentiable(vjp: _vjpAdd(lhs:rhs:)
1224+
@differentiable(vjp: _vjpSubtract(lhs:rhs:)
12251225
where Self : Differentiable,
12261226
Self.TangentVector : SIMD,
12271227
Scalar : Differentiable & BinaryFloatingPoint,
@@ -1269,7 +1269,7 @@ extension SIMD where Scalar: FloatingPoint {
12691269

12701270
@_transparent
12711271
// SWIFT_ENABLE_TENSORFLOW
1272-
@differentiable(vjp: _vjpAdd(lhs:rhs:)
1272+
@differentiable(vjp: _vjpSubtract(lhs:rhs:)
12731273
where Self : Differentiable,
12741274
Self.TangentVector : SIMD,
12751275
Scalar : Differentiable & BinaryFloatingPoint,
@@ -1303,16 +1303,6 @@ extension SIMD where Scalar: FloatingPoint {
13031303
return lhs / Self(repeating: rhs)
13041304
}
13051305

1306-
// @_transparent
1307-
// public static func +=(lhs: inout Self, rhs: Self) {
1308-
// lhs = lhs + rhs
1309-
// }
1310-
1311-
// @_transparent
1312-
// public static func -=(lhs: inout Self, rhs: Self) {
1313-
// lhs = lhs - rhs
1314-
// }
1315-
13161306
@_transparent
13171307
public static func *=(lhs: inout Self, rhs: Self) {
13181308
lhs = lhs * rhs
@@ -1323,11 +1313,6 @@ extension SIMD where Scalar: FloatingPoint {
13231313
lhs = lhs / rhs
13241314
}
13251315

1326-
// @_transparent
1327-
// public static func *=(lhs: inout Self, rhs: Scalar) {
1328-
// lhs = lhs * rhs
1329-
// }
1330-
13311316
@_transparent
13321317
public static func +=(lhs: inout Self, rhs: Scalar) {
13331318
lhs = lhs + rhs
@@ -1337,6 +1322,11 @@ extension SIMD where Scalar: FloatingPoint {
13371322
public static func -=(lhs: inout Self, rhs: Scalar) {
13381323
lhs = lhs - rhs
13391324
}
1325+
1326+
@_transparent
1327+
public static func *=(lhs: inout Self, rhs: Scalar) {
1328+
lhs = lhs * rhs
1329+
}
13401330

13411331
@_transparent
13421332
public static func /=(lhs: inout Self, rhs: Scalar) {

stdlib/public/core/SIMDVectorTypes.swift.gyb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ extension SIMD${n} where Scalar: BinaryFloatingPoint {
192192
// SWIFT_ENABLE_TENSORFLOW
193193
extension SIMD${n} : AdditiveArithmetic where Scalar : FloatingPoint {}
194194

195-
//extension SIMD${n} : VectorNumeric where Scalar : FloatingPoint {}
196-
197195
extension SIMD${n} : Differentiable
198196
where Scalar : Differentiable & BinaryFloatingPoint,
199197
Scalar.TangentVector: BinaryFloatingPoint {

0 commit comments

Comments
 (0)