@@ -2271,7 +2271,7 @@ class WasmFoundationTests: XCTestCase {
2271
2271
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . add)
2272
2272
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2273
2273
}
2274
- } , " 4.8[0-9]*,7.4[0-9]*,9.6[0-9]*,11.8[0-9]* " ) , // for floating point math need to allow trailing digits
2274
+ } , " 4.8[0-9]*,7.4[0-9]*,9.6[0-9]*,11.8[0-9]* " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2275
2275
// Test float sub
2276
2276
( { wasmModule in
2277
2277
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2281,7 +2281,7 @@ class WasmFoundationTests: XCTestCase {
2281
2281
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . sub)
2282
2282
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2283
2283
}
2284
- } , " 4.8[0-9]*,-4.4[0-9]*,4.4[0-9]*,4.4[0-9]* " ) , // for floating point math need to allow trailing digits
2284
+ } , " 4.8[0-9]*,-4.4[0-9]*,4.4[0-9]*,4.4[0-9]* " ) ,
2285
2285
// Test float mul
2286
2286
( { wasmModule in
2287
2287
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2291,7 +2291,7 @@ class WasmFoundationTests: XCTestCase {
2291
2291
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . mul)
2292
2292
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2293
2293
}
2294
- } , " 0,8.85[0-9]*,(18.1[0-9]*|18.2[0-9]*),29.97[0-9]* " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2294
+ } , " 0,8.85[0-9]*,(18.1[0-9]*|18.2[0-9]*),29.97[0-9]* " ) ,
2295
2295
// Test float div
2296
2296
( { wasmModule in
2297
2297
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2301,7 +2301,7 @@ class WasmFoundationTests: XCTestCase {
2301
2301
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . div)
2302
2302
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2303
2303
}
2304
- } , " 0,0.2542[0-9]*,2.6923[0-9]*,2.1891[0-9]* " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2304
+ } , " 0,0.2542[0-9]*,2.6923[0-9]*,2.1891[0-9]* " ) ,
2305
2305
// Test float min
2306
2306
( { wasmModule in
2307
2307
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2311,7 +2311,7 @@ class WasmFoundationTests: XCTestCase {
2311
2311
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . min)
2312
2312
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2313
2313
}
2314
- } , " 0,1.5[0-9]*,NaN,NaN " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2314
+ } , " 0,1.5[0-9]*,NaN,NaN " ) ,
2315
2315
// Test float max
2316
2316
( { wasmModule in
2317
2317
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2321,7 +2321,7 @@ class WasmFoundationTests: XCTestCase {
2321
2321
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . max)
2322
2322
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2323
2323
}
2324
- } , " 4.8[0-9]*,5.9[0-9]*,NaN,NaN " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2324
+ } , " 4.8[0-9]*,5.9[0-9]*,NaN,NaN " ) ,
2325
2325
// Test float pmin
2326
2326
( { wasmModule in
2327
2327
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2331,7 +2331,7 @@ class WasmFoundationTests: XCTestCase {
2331
2331
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . pmin)
2332
2332
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2333
2333
}
2334
- } , " 0,1.5[0-9]*,7,NaN " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2334
+ } , " 0,1.5[0-9]*,7,NaN " ) ,
2335
2335
// Test float pmax
2336
2336
( { wasmModule in
2337
2337
let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
@@ -2341,7 +2341,27 @@ class WasmFoundationTests: XCTestCase {
2341
2341
let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . pmax)
2342
2342
return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2343
2343
}
2344
- } , " 4.8[0-9]*,5.9[0-9]*,7,NaN " ) , // for floating point math need to allow trailing digits and take into account rounding issues
2344
+ } , " 4.8[0-9]*,5.9[0-9]*,7,NaN " ) ,
2345
+ // Test float relaxed_min
2346
+ ( { wasmModule in
2347
+ let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
2348
+ wasmModule. addWasmFunction ( with: [ ] => returnType) { function, label, args in
2349
+ let varA = function. constSimd128 ( value: floatToByteArray ( [ 0.0 , 5.9 , 7.0 , 0.0 / 0.0 ] ) )
2350
+ let varB = function. constSimd128 ( value: floatToByteArray ( [ 4.8 , 1.5 , 0.0 / 0.0 , 3.7 ] ) )
2351
+ let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . relaxed_min)
2352
+ return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2353
+ }
2354
+ } , " 0,1.5[0-9]*,(NaN|7),(NaN|3.7[0-9]*) " ) ,
2355
+ // Test float relaxed_max
2356
+ ( { wasmModule in
2357
+ let returnType = ( 0 ..< 4 ) . map { _ in ILType . wasmf32}
2358
+ wasmModule. addWasmFunction ( with: [ ] => returnType) { function, label, args in
2359
+ let varA = function. constSimd128 ( value: floatToByteArray ( [ 0.0 , 5.9 , 7.0 , 0.0 / 0.0 ] ) )
2360
+ let varB = function. constSimd128 ( value: floatToByteArray ( [ 4.8 , 1.5 , 0.0 / 0.0 , 3.7 ] ) )
2361
+ let result = function. wasmSimd128FloatBinOp ( varA, varB, WasmSimd128Shape . f32x4, WasmSimd128FloatBinOpKind . relaxed_max)
2362
+ return ( 0 ..< 4 ) . map { function. wasmSimdExtractLane ( kind: WasmSimdExtractLane . Kind. F32x4, result, $0) }
2363
+ }
2364
+ } , " 4.8[0-9]*,5.9[0-9]*,(NaN|7),(NaN|3.7[0-9]*) " ) ,
2345
2365
2346
2366
2347
2367
]
0 commit comments