Skip to content

Commit 31d1385

Browse files
authored
Merge pull request #2 from plx/feat/swift-6-rollback-clean
Roll back to pre-macro state with Swift 6 modernizations
2 parents 58d082b + 9c97a57 commit 31d1385

File tree

83 files changed

+2175
-3254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2175
-3254
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.xcuserstate
2+
/.swiftpm/xcode/package.xcworkspace/xcuserdata/plx.xcuserdatad/UserInterfaceState.xcuserstate
3+
/Sources/HDXLSIMDSupport/Matrices/.DS_Store
4+
.DS_Store
5+
.build/

Package.swift

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
// swift-tools-version:5.7
1+
// swift-tools-version:6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "HDXLSIMDSupport",
88
platforms: [
9-
.iOS(.v15),
10-
.macOS(.v12),
11-
.tvOS(.v15),
12-
.watchOS(.v9)
9+
.iOS(.v18),
10+
.macOS(.v15),
11+
.tvOS(.v18),
12+
.watchOS(.v11)
1313
],
1414
products: [
15-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
1615
.library(
1716
name: "HDXLSIMDSupport",
18-
targets: ["HDXLSIMDSupport"])
17+
targets: ["HDXLSIMDSupport"]
18+
)
1919
],
2020
dependencies: [
2121
],
2222
targets: [
23-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2523
.target(
2624
name: "HDXLSIMDSupport",
2725
dependencies: []
@@ -31,8 +29,8 @@ let package = Package(
3129
dependencies: ["HDXLSIMDSupport"]
3230
)
3331
],
34-
swiftLanguageVersions: [
35-
.v5
32+
swiftLanguageModes: [
33+
.v6
3634
]
3735
)
3836

README.md

Lines changed: 48 additions & 290 deletions
Large diffs are not rendered by default.

Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix2x2.swift

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Matrix2x2.swift
3-
//
4-
51
import Foundation
62
import simd
73
import SwiftUI
@@ -46,7 +42,7 @@ public struct Matrix2x2<Scalar:ExtendedSIMDScalar> :
4642
@inlinable
4743
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
4844
get {
49-
return passthroughValue.passthroughValue
45+
passthroughValue.passthroughValue
5046
}
5147
set {
5248
passthroughValue.passthroughValue = newValue
@@ -61,33 +57,15 @@ public struct Matrix2x2<Scalar:ExtendedSIMDScalar> :
6157
)
6258
)
6359
}
64-
65-
@inlinable
66-
public var description: String {
67-
get {
68-
return "Matrix2x2: \(String(describing: nativeSIMDRepresentation))"
69-
}
70-
}
71-
72-
@inlinable
73-
public var debugDescription: String {
74-
get {
75-
return "Matrix2x2<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
76-
}
77-
}
7860

7961
@inlinable
8062
public static var zero: Matrix2x2<Scalar> {
81-
get {
82-
return Matrix2x2<Scalar>()
83-
}
63+
Matrix2x2<Scalar>()
8464
}
8565

8666
@inlinable
8767
public var magnitudeSquared: Double {
88-
get {
89-
return Double(componentwiseMagnitudeSquared)
90-
}
68+
Double(componentwiseMagnitudeSquared)
9169
}
9270

9371
@inlinable
@@ -98,3 +76,5 @@ public struct Matrix2x2<Scalar:ExtendedSIMDScalar> :
9876
}
9977

10078
}
79+
80+
extension Matrix2x2: Sendable where Scalar.Matrix2x2Storage: Sendable { }

Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix2x3.swift

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Matrix2x3.swift
3-
//
4-
51
import Foundation
62
import simd
73
import SwiftUI
@@ -49,7 +45,7 @@ public struct Matrix2x3<Scalar:ExtendedSIMDScalar> :
4945
@inlinable
5046
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
5147
get {
52-
return passthroughValue.passthroughValue
48+
passthroughValue.passthroughValue
5349
}
5450
set {
5551
passthroughValue.passthroughValue = newValue
@@ -65,32 +61,14 @@ public struct Matrix2x3<Scalar:ExtendedSIMDScalar> :
6561
)
6662
}
6763

68-
@inlinable
69-
public var description: String {
70-
get {
71-
return "Matrix2x3: \(String(describing: nativeSIMDRepresentation))"
72-
}
73-
}
74-
75-
@inlinable
76-
public var debugDescription: String {
77-
get {
78-
return "Matrix2x3<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
79-
}
80-
}
81-
8264
@inlinable
8365
public static var zero: Matrix2x3<Scalar> {
84-
get {
85-
return Matrix2x3<Scalar>()
86-
}
66+
Matrix2x3<Scalar>()
8767
}
8868

8969
@inlinable
9070
public var magnitudeSquared: Double {
91-
get {
92-
return Double(componentwiseMagnitudeSquared)
93-
}
71+
Double(componentwiseMagnitudeSquared)
9472
}
9573

9674
@inlinable
@@ -101,3 +79,5 @@ public struct Matrix2x3<Scalar:ExtendedSIMDScalar> :
10179
}
10280

10381
}
82+
83+
extension Matrix2x3: Sendable where Scalar.Matrix2x3Storage: Sendable { }

Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix2x4.swift

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Matrix2x4.swift
3-
//
4-
51
import Foundation
62
import simd
73
import SwiftUI
@@ -49,7 +45,7 @@ public struct Matrix2x4<Scalar:ExtendedSIMDScalar> :
4945
@inlinable
5046
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
5147
get {
52-
return passthroughValue.passthroughValue
48+
passthroughValue.passthroughValue
5349
}
5450
set {
5551
passthroughValue.passthroughValue = newValue
@@ -65,39 +61,23 @@ public struct Matrix2x4<Scalar:ExtendedSIMDScalar> :
6561
)
6662
}
6763

68-
@inlinable
69-
public var description: String {
70-
get {
71-
return "Matrix2x4: \(String(describing: nativeSIMDRepresentation))"
72-
}
73-
}
74-
75-
@inlinable
76-
public var debugDescription: String {
77-
get {
78-
return "Matrix2x4<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
79-
}
80-
}
81-
8264
@inlinable
8365
public static var zero: Matrix2x4<Scalar> {
84-
get {
85-
return Matrix2x4<Scalar>()
86-
}
66+
Matrix2x4<Scalar>()
8767
}
8868

8969
@inlinable
9070
public var magnitudeSquared: Double {
91-
get {
92-
return Double(componentwiseMagnitudeSquared)
93-
}
71+
Double(componentwiseMagnitudeSquared)
9472
}
9573

9674
@inlinable
9775
public mutating func scale(by factor: Double) {
98-
self.formMultiplication(
76+
formMultiplication(
9977
by: Scalar(factor)
10078
)
10179
}
10280

10381
}
82+
83+
extension Matrix2x4: Sendable where Scalar.Matrix2x4Storage: Sendable { }

Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix3x2.swift

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Matrix3x2.swift
3-
//
4-
51
import Foundation
62
import simd
73
import SwiftUI
@@ -50,7 +46,7 @@ public struct Matrix3x2<Scalar:ExtendedSIMDScalar> :
5046
@inlinable
5147
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
5248
get {
53-
return passthroughValue.passthroughValue
49+
passthroughValue.passthroughValue
5450
}
5551
set {
5652
passthroughValue.passthroughValue = newValue
@@ -66,39 +62,23 @@ public struct Matrix3x2<Scalar:ExtendedSIMDScalar> :
6662
)
6763
}
6864

69-
@inlinable
70-
public var description: String {
71-
get {
72-
return "Matrix3x2: \(String(describing: nativeSIMDRepresentation))"
73-
}
74-
}
75-
76-
@inlinable
77-
public var debugDescription: String {
78-
get {
79-
return "Matrix3x2<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
80-
}
81-
}
82-
8365
@inlinable
8466
public static var zero: Matrix3x2<Scalar> {
85-
get {
86-
return Matrix3x2<Scalar>()
87-
}
67+
Matrix3x2<Scalar>()
8868
}
8969

9070
@inlinable
9171
public var magnitudeSquared: Double {
92-
get {
93-
return Double(componentwiseMagnitudeSquared)
94-
}
72+
Double(componentwiseMagnitudeSquared)
9573
}
9674

9775
@inlinable
9876
public mutating func scale(by factor: Double) {
99-
self.formMultiplication(
77+
formMultiplication(
10078
by: Scalar(factor)
10179
)
10280
}
10381

10482
}
83+
84+
extension Matrix3x2: Sendable where Scalar.Matrix3x2Storage: Sendable { }

Sources/HDXLSIMDSupport/Matrices/Matrices/Matrix3x3.swift

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Matrix3x3.swift
3-
//
4-
51
import Foundation
62
import simd
73
import SwiftUI
@@ -48,7 +44,7 @@ public struct Matrix3x3<Scalar:ExtendedSIMDScalar> :
4844
@inlinable
4945
public var nativeSIMDRepresentation: NativeSIMDRepresentation {
5046
get {
51-
return passthroughValue.passthroughValue
47+
passthroughValue.passthroughValue
5248
}
5349
set {
5450
passthroughValue.passthroughValue = newValue
@@ -63,33 +59,15 @@ public struct Matrix3x3<Scalar:ExtendedSIMDScalar> :
6359
)
6460
)
6561
}
66-
67-
@inlinable
68-
public var description: String {
69-
get {
70-
return "Matrix3x3: \(String(describing: nativeSIMDRepresentation))"
71-
}
72-
}
73-
74-
@inlinable
75-
public var debugDescription: String {
76-
get {
77-
return "Matrix3x3<\(String(reflecting: Scalar.self))>(nativeSIMDRepresentation: \(String(reflecting: nativeSIMDRepresentation)))"
78-
}
79-
}
8062

8163
@inlinable
8264
public static var zero: Matrix3x3<Scalar> {
83-
get {
84-
return Matrix3x3<Scalar>()
85-
}
65+
Matrix3x3<Scalar>()
8666
}
8767

8868
@inlinable
8969
public var magnitudeSquared: Double {
90-
get {
91-
return Double(componentwiseMagnitudeSquared)
92-
}
70+
Double(componentwiseMagnitudeSquared)
9371
}
9472

9573
@inlinable
@@ -100,3 +78,5 @@ public struct Matrix3x3<Scalar:ExtendedSIMDScalar> :
10078
}
10179

10280
}
81+
82+
extension Matrix3x3: Sendable where Scalar.Matrix3x3Storage: Sendable { }

0 commit comments

Comments
 (0)