Skip to content

Commit 5bfe9e1

Browse files
committed
Remove relaxed add/mul for Float16 on wasm, as they cannot be defined.
1 parent 46619b4 commit 5bfe9e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/RealModule/Float16+Real.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ extension Float16: Real {
173173
}
174174
#endif
175175

176+
#if !arch(wasm32)
177+
// WASM doesn't have _Float16 on the C side, so we can't define the C hooks
178+
// that these use. TODO: implement these as Swift builtins instead.
179+
176180
@_transparent
177181
public static func _relaxedAdd(_ a: Float16, _ b: Float16) -> Float16 {
178182
_numerics_relaxed_addf16(a, b)
@@ -182,6 +186,7 @@ extension Float16: Real {
182186
public static func _relaxedMul(_ a: Float16, _ b: Float16) -> Float16 {
183187
_numerics_relaxed_mulf16(a, b)
184188
}
189+
#endif
185190
}
186191

187192
#endif

0 commit comments

Comments
 (0)