|
1 | | -;; Tests for f32x4.relaxed_fma, f32x4.relaxed_fnma, f64x2.relaxed_fma, and f64x2.relaxed_fnma. |
| 1 | +;; Tests for f32x4.relaxed_madd, f32x4.relaxed_nmadd, f64x2.relaxed_madd, and f64x2.relaxed_nmadd. |
2 | 2 |
|
3 | 3 | (module |
4 | | - (func (export "f32x4.relaxed_fma") (param v128 v128 v128) (result v128) (f32x4.relaxed_fma (local.get 0) (local.get 1) (local.get 2))) |
5 | | - (func (export "f32x4.relaxed_fnma") (param v128 v128 v128) (result v128) (f32x4.relaxed_fnma (local.get 0) (local.get 1) (local.get 2))) |
6 | | - (func (export "f64x2.relaxed_fnma") (param v128 v128 v128) (result v128) (f64x2.relaxed_fnma (local.get 0) (local.get 1) (local.get 2))) |
7 | | - (func (export "f64x2.relaxed_fma") (param v128 v128 v128) (result v128) (f64x2.relaxed_fma (local.get 0) (local.get 1) (local.get 2))) |
| 4 | + (func (export "f32x4.relaxed_madd") (param v128 v128 v128) (result v128) (f32x4.relaxed_madd (local.get 0) (local.get 1) (local.get 2))) |
| 5 | + (func (export "f32x4.relaxed_nmadd") (param v128 v128 v128) (result v128) (f32x4.relaxed_nmadd (local.get 0) (local.get 1) (local.get 2))) |
| 6 | + (func (export "f64x2.relaxed_nmadd") (param v128 v128 v128) (result v128) (f64x2.relaxed_nmadd (local.get 0) (local.get 1) (local.get 2))) |
| 7 | + (func (export "f64x2.relaxed_madd") (param v128 v128 v128) (result v128) (f64x2.relaxed_madd (local.get 0) (local.get 1) (local.get 2))) |
8 | 8 | ) |
9 | 9 |
|
10 | 10 |
|
|
13 | 13 | ;; FLT_MAX (if fma) |
14 | 14 | ;; 0 (if no fma) |
15 | 15 | ;; from https://www.vinc17.net/software/fma-tests.c |
16 | | -(assert_return (invoke "f32x4.relaxed_fma" |
| 16 | +(assert_return (invoke "f32x4.relaxed_madd" |
17 | 17 | (v128.const f32x4 0x1.fffffep+127 0x1.fffffep+127 0x1.fffffep+127 0x1.fffffep+127 ) |
18 | 18 | (v128.const f32x4 2.0 2.0 2.0 2.0) |
19 | 19 | (v128.const f32x4 -0x1.fffffep+127 -0x1.fffffep+127 -0x1.fffffep+127 -0x1.fffffep+127)) |
|
29 | 29 | ;; x.y+z = 0 (2 roundings) |
30 | 30 | ;; fma(x, y, z) = (0x1p-37) 2^-37 |
31 | 31 | ;; from https://accurate-algorithms.readthedocs.io/en/latest/ch09appendix.html#test-system-information |
32 | | -(assert_return (invoke "f32x4.relaxed_fma" |
| 32 | +(assert_return (invoke "f32x4.relaxed_madd" |
33 | 33 | (v128.const f32x4 0x1.000004p+0 0x1.000004p+0 0x1.000004p+0 0x1.000004p+0) |
34 | 34 | (v128.const f32x4 0x1.0002p+0 0x1.0002p+0 0x1.0002p+0 0x1.0002p+0) |
35 | 35 | (v128.const f32x4 -0x1.000204p+0 -0x1.000204p+0 -0x1.000204p+0 -0x1.000204p+0)) |
36 | 36 | (either (v128.const f32x4 0x1p-37 0x1p-37 0x1p-37 0x1p-37) |
37 | 37 | (v128.const f32x4 0 0 0 0))) |
38 | | -(assert_return (invoke "f32x4.relaxed_fnma" |
| 38 | +(assert_return (invoke "f32x4.relaxed_nmadd" |
39 | 39 | (v128.const f32x4 0x1.000004p+0 0x1.000004p+0 0x1.000004p+0 0x1.000004p+0) |
40 | 40 | (v128.const f32x4 0x1.0002p+0 0x1.0002p+0 0x1.0002p+0 0x1.0002p+0) |
41 | 41 | (v128.const f32x4 0x1.000204p+0 0x1.000204p+0 0x1.000204p+0 0x1.000204p+0)) |
|
48 | 48 | ;; 0 (if no fma) |
49 | 49 | ;; form https://www.vinc17.net/software/fma-tests.c |
50 | 50 | ;; from https://www.vinc17.net/software/fma-tests.c |
51 | | -(assert_return (invoke "f64x2.relaxed_fma" |
| 51 | +(assert_return (invoke "f64x2.relaxed_madd" |
52 | 52 | (v128.const f64x2 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+1023) |
53 | 53 | (v128.const f64x2 2.0 2.0) |
54 | 54 | (v128.const f64x2 -0x1.fffffffffffffp+1023 -0x1.fffffffffffffp+1023)) |
|
64 | 64 | ;; x.y+z = 0 (2 roundings) |
65 | 65 | ;; fma(x, y, z) = 0x1p-53 |
66 | 66 | ;; from https://accurate-algorithms.readthedocs.io/en/latest/ch09appendix.html#test-system-information |
67 | | -(assert_return (invoke "f64x2.relaxed_fma" |
| 67 | +(assert_return (invoke "f64x2.relaxed_madd" |
68 | 68 | (v128.const f64x2 0x1.00000004p+0 0x1.00000004p+0) |
69 | 69 | (v128.const f64x2 0x1.000002p+0 0x1.000002p+0) |
70 | 70 | (v128.const f64x2 -0x1.00000204p+0 -0x1.00000204p+0)) |
71 | 71 | (either (v128.const f64x2 0x1p-53 0x1p-53) |
72 | 72 | (v128.const f64x2 0 0))) |
73 | | -(assert_return (invoke "f64x2.relaxed_fnma" |
| 73 | +(assert_return (invoke "f64x2.relaxed_nmadd" |
74 | 74 | (v128.const f64x2 0x1.00000004p+0 0x1.00000004p+0) |
75 | 75 | (v128.const f64x2 0x1.000002p+0 0x1.000002p+0) |
76 | 76 | (v128.const f64x2 0x1.00000204p+0 0x1.00000204p+0)) |
|
0 commit comments