mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1153602 - SIMD (interpreter): Added more test cases for ReciprocalSqrtApproximation. r=Waldo
This commit is contained in:
parent
64bf8520c3
commit
3e469a89a7
@ -52,7 +52,8 @@ function test() {
|
||||
for ([v, w] of [[float64x2(1, 2), float64x2(3, 4)],
|
||||
[float64x2(1.894, 2.8909), float64x2(100.764, 200.987)],
|
||||
[float64x2(-1, -2), float64x2(-14.54, 57)],
|
||||
[float64x2(+Infinity, -Infinity), float64x2(NaN, -0)]])
|
||||
[float64x2(+Infinity, -Infinity), float64x2(NaN, -0)],
|
||||
[float64x2(Math.pow(2, 31), Math.pow(2, -31)), float64x2(Math.pow(2, -1047), Math.pow(2, -149))]])
|
||||
{
|
||||
testAdd(v, w);
|
||||
testSub(v, w);
|
||||
|
@ -51,13 +51,16 @@ function testFloat32x4reciprocalApproximation() {
|
||||
|
||||
function testFloat32x4reciprocalSqrtApproximation() {
|
||||
function reciprocalsqrtf(a) {
|
||||
return Math.fround(1 / Math.sqrt(a));
|
||||
assertEq(Math.fround(a), a);
|
||||
return Math.fround(1 / Math.fround(Math.sqrt(a)));
|
||||
}
|
||||
|
||||
var vals = [
|
||||
[[1, 1, 0.25, 0.25], [1, 1, 2, 2]],
|
||||
[[25, 16, 6.25, 1.5625], [25, 16, 6.25, 1.5625].map(reciprocalsqrtf)],
|
||||
[[NaN, -0, Infinity, -Infinity], [NaN, -0, Infinity, -Infinity].map(reciprocalsqrtf)]
|
||||
[[NaN, -0, Infinity, -Infinity], [NaN, -0, Infinity, -Infinity].map(reciprocalsqrtf)],
|
||||
[[Math.pow(2, 32), Math.pow(2, -32), +0, Math.pow(2, -148)],
|
||||
[Math.pow(2, -16), Math.pow(2, 16), Infinity, Math.pow(2, 74)]]
|
||||
];
|
||||
|
||||
for (var [v,w] of vals) {
|
||||
|
Loading…
Reference in New Issue
Block a user