From 5bfe9e16ce296a3d82f99db148f2d26d4a0d178a Mon Sep 17 00:00:00 2001 From: Stephen Canon Date: Thu, 14 Aug 2025 09:45:04 -0400 Subject: [PATCH] Remove relaxed add/mul for Float16 on wasm, as they cannot be defined. --- Sources/RealModule/Float16+Real.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/RealModule/Float16+Real.swift b/Sources/RealModule/Float16+Real.swift index 6781683..98e97e8 100644 --- a/Sources/RealModule/Float16+Real.swift +++ b/Sources/RealModule/Float16+Real.swift @@ -173,6 +173,10 @@ extension Float16: Real { } #endif + #if !arch(wasm32) + // WASM doesn't have _Float16 on the C side, so we can't define the C hooks + // that these use. TODO: implement these as Swift builtins instead. + @_transparent public static func _relaxedAdd(_ a: Float16, _ b: Float16) -> Float16 { _numerics_relaxed_addf16(a, b) @@ -182,6 +186,7 @@ extension Float16: Real { public static func _relaxedMul(_ a: Float16, _ b: Float16) -> Float16 { _numerics_relaxed_mulf16(a, b) } + #endif } #endif