@@ -306,6 +306,9 @@ and 0 representing false.
306
306
* Int32Sle - signed less than or equal
307
307
* Int32Ult - unsigned less than
308
308
* Int32Ule - unsigned less than or equal
309
+ * Int32Clz - count leading zeroes (defined for all values, including 0)
310
+ * Int32Ctz - count trailing zeroes (defined for all values, including 0)
311
+ * Int32Popcnt - count number of ones
309
312
310
313
Division or remainder by zero traps.
311
314
Signed division overflow (` INT32_MIN / -1 ` ) traps. Signed remainder with a
@@ -320,22 +323,6 @@ Note that greater-than and greater-than-or-equal operations are not required,
320
323
since "a < b" == "b > a" and "a <= b" == "b >= a". Such equalities also hold for
321
324
floating point comparisons, even considering NaN.
322
325
323
- Additional 32-bit integer Operations under consideration:
324
-
325
- * Int32SMulHigh - signed multiplication (upper 32-bits)
326
- * Int32UMulHigh - unsigned multiplication (upper 32-bits)
327
- * Int32Clz - count leading zeroes (defined for all values, including 0)
328
- * Int32Ctz - count trailing zeroes (defined for all values, including 0)
329
- * Int32Popcnt - count number of ones
330
- * Int32BSwap - reverse bytes (endian conversion)
331
- * Int32Rotr - bitwise rotate right
332
- * Int32Rotl - bitwise rotate left
333
- * Int32Not - signed-less one's complement
334
- * Int32SMin - signed minimum
335
- * Int32SMax - signed maximum
336
- * Int32UMin - unsigned minimum
337
- * Int32UMax - unsigned maximum
338
-
339
326
## Floating point operations
340
327
341
328
Floating point arithmetic follows the IEEE-754 standard, except that:
@@ -369,10 +356,14 @@ Floating point arithmetic follows the IEEE-754 standard, except that:
369
356
* Float32Copysign - copysign
370
357
* Float32Ceil - ceiling operation
371
358
* Float32Floor - floor operation
359
+ * Float32Trunc - round to nearest integer towards zero
360
+ * Float32NearestInt - round to nearest integer, ties to even
372
361
* Float32Eq - compare equal
373
362
* Float32Lt - less than
374
363
* Float32Le - less than or equal
375
364
* Float32Sqrt - square root
365
+ * Float32Min - minimum (binary operator); if either operand is NaN, returns NaN
366
+ * Float32Max - maximum (binary operator); if either operand is NaN, returns NaN
376
367
377
368
* Float64Add - addition
378
369
* Float64Sub - subtraction
@@ -383,28 +374,16 @@ Floating point arithmetic follows the IEEE-754 standard, except that:
383
374
* Float64Copysign - copysign
384
375
* Float64Ceil - ceiling operation
385
376
* Float64Floor - floor operation
377
+ * Float64Trunc - round to nearest integer towards zero
378
+ * Float64NearestInt - round to nearest integer, ties to even
386
379
* Float64Eq - compare equal
387
380
* Float64Lt - less than
388
381
* Float64Le - less than or equal
389
382
* Float64Sqrt - square root
383
+ * Float64Min - minimum (binary operator); if either operand is NaN, returns NaN
384
+ * Float64Max - maximum (binary operator); if either operand is NaN, returns NaN
390
385
391
- Operations under consideration:
392
-
393
- * Float32Min - minimum; if either operand is NaN, returns NaN
394
- * Float32Max - maximum; if either operand is NaN, returns NaN
395
- * Float32MinNum - minimum; if exactly one operand is NaN, returns the other operand
396
- * Float32MaxNum - maximum; if exactly one operand is NaN, returns the other operand
397
- * Float32Trunc - round to nearest integer towards zero
398
- * Float32NearestInt - round to nearest integer, ties to even
399
-
400
- * Float64Min - minimum; if either operand is NaN, returns NaN
401
- * Float64Max - maximum; if either operand is NaN, returns NaN
402
- * Float64MinNum - minimum; if exactly one operand is NaN, returns the other operand
403
- * Float64MaxNum - maximum; if exactly one operand is NaN, returns the other operand
404
- * Float64Trunc - round to nearest integer towards zero
405
- * Float64NearestInt - round to nearest integer, ties to even
406
-
407
- Min, Max, MinNum, and MaxNum operations would treat -0 as being effectively less than 0.
386
+ Min and Max operations treat -0 as being effectively less than 0.
408
387
409
388
## Datatype conversions, truncations, reinterpretations, promotions, and demotions
410
389
@@ -436,37 +415,3 @@ overflow to infinity or negative infinity as specified by IEEE-754.
436
415
Conversion from floating point to integer where IEEE-754 would specify an
437
416
invalid operation exception (e.g. when the floating point value is NaN or
438
417
outside the range which rounds to an integer in range) traps.
439
-
440
- ## Post-MVP intrinsics
441
-
442
- The following list of intrinsics is being considered for addition after the MVP. The
443
- rationale is that, for the MVP, these operations can be statically linked into the
444
- WebAssembly module by the code generator at small size cost and this avoids a
445
- non-trivial specification burden of their semantics/precision. Adding these
446
- intrinsics post-MVP would allow for better high-level backend optimization of
447
- these intrinsics that require builtin knowledge of their semantics. On the other
448
- hand, a code generator may continue to statically link in its own implementation
449
- since this provides greater control over precision/performance tradeoffs.
450
-
451
- * Float64Sin - trigonometric sine
452
- * Float64Cos - trigonometric cosine
453
- * Float64Tan - trigonometric tangent
454
- * Float64ASin - trigonometric arcsine
455
- * Float64ACos - trigonometric arccosine
456
- * Float64ATan - trigonometric arctangent
457
- * Float64ATan2 - trigonometric arctangent with two arguments
458
- * Float64Exp - exponentiate e
459
- * Float64Ln - natural logarithm
460
- * Float64Pow - exponentiate
461
- * Float32Sin - trigonometric sine
462
- * Float32Cos - trigonometric cosine
463
- * Float32Tan - trigonometric tangent
464
- * Float32ASin - trigonometric arcsine
465
- * Float32ACos - trigonometric arccosine
466
- * Float32ATan - trigonometric arctangent
467
- * Float32ATan2 - trigonometric arctangent with two arguments
468
- * Float32Exp - exponentiate e
469
- * Float32Ln - natural logarithm
470
- * Float32Pow - exponentiate
471
-
472
- The rounding behavior of these operations would need clarification.
0 commit comments