Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 588f568

Browse files
obastemurchakrabot
authored andcommitted
deps: update ChakraCore to chakra-core/ChakraCore@5a1a799161
[1.8>1.9] [MERGE #4653 @obastemur] asmjs: enable MathBuiltinsCall test for OSX Merge pull request #4653 from obastemur:enable_math_Builtins_osx Fixes #4537 Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
1 parent dead9fe commit 588f568

File tree

3 files changed

+43
-36
lines changed

3 files changed

+43
-36
lines changed

deps/chakrashim/core/test/AsmJs/MathBuiltinsCall.baseline

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ f19 (a[10](1))= 1
188188
f20 (a[10](1))= 1
189189
f1 (a[11](10))= NaN
190190
f2 (a[11](10))= NaN
191-
f3 (a[11](10))= 1.4711276743037347
192191
f4 (a[11](10))= -1
193192
f5 (a[11](10))= -1
194193
f6 (a[11](10))= 1
@@ -698,7 +697,6 @@ f19 (a[40](1))= 1
698697
f20 (a[40](1))= 1
699698
f1 (a[41](10))= NaN
700699
f2 (a[41](10))= NaN
701-
f3 (a[41](10))= 1.4711276743037347
702700
f4 (a[41](10))= -1
703701
f5 (a[41](10))= -1
704702
f6 (a[41](10))= 1
@@ -919,7 +917,6 @@ f19 (a[53](1))= 1
919917
f20 (a[53](1))= 1
920918
f1 (a[54](10.0))= NaN
921919
f2 (a[54](10.0))= NaN
922-
f3 (a[54](10.0))= 1.4711276743037347
923920
f4 (a[54](10.0))= -1
924921
f5 (a[54](10.0))= -1
925922
f6 (a[54](10.0))= 1

deps/chakrashim/core/test/AsmJs/MathBuiltinsCall.js

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
44
//-------------------------------------------------------------------------------------------------------
55

6+
WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
7+
68
function foo() {}
79

810
var all = [ undefined, null,
@@ -12,14 +14,14 @@ var all = [ undefined, null,
1214
1<<32, -(1<<32), (1<<32)-1, 1<<31, -(1<<31), 1<<25, -1<<25, 65536, 46341,
1315
Number.MIN_VALUE, Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY,
1416
new Number(NaN), new Number(+0), new Number( -0), new Number(0), new Number(1),
15-
new Number(10.0), new Number(10.1),
16-
new Number(Number.MIN_VALUE), new Number(Number.NaN),
17+
new Number(10.0), new Number(10.1),
18+
new Number(Number.MIN_VALUE), new Number(Number.NaN),
1719
new Number(Number.POSITIVE_INFINITY), new Number(Number.NEGATIVE_INFINITY),
1820
"", "hello", "hel" + "lo", "+0", "-0", "0", "1", "10.0", "10.1",
1921
new String(""), new String("hello"), new String("he" + "llo"),
2022
new Object(), [1,2,3], new Object(), [1,2,3] , foo
2123
];
22-
24+
2325
function AsmModule(stdlib,foreign,buffer) {
2426
"use asm";
2527

@@ -32,7 +34,7 @@ function AsmModule(stdlib,foreign,buffer) {
3234
var fd2 = +foreign.d2;
3335
var fun1 = foreign.fun1;
3436
var fun2 = foreign.fun2;
35-
37+
3638
// stdlib immutable variable type double
3739
var sInf = stdlib.Infinity, sNaN = stdlib.NaN;
3840
// stdlib math (double) -> double
@@ -67,7 +69,7 @@ function AsmModule(stdlib,foreign,buffer) {
6769
var PI = stdlib.Math.PI;
6870
var SQRT1_2 = stdlib.Math.SQRT1_2;
6971
var SQRT2 = stdlib.Math.SQRT2;
70-
72+
7173
//views
7274
var a=new stdlib.Int8Array(buffer);
7375
var b=new stdlib.Int16Array(buffer);
@@ -77,62 +79,62 @@ function AsmModule(stdlib,foreign,buffer) {
7779
var f=new stdlib.Uint32Array(buffer);
7880
var g=new stdlib.Float32Array(buffer);
7981
var h=new stdlib.Float64Array(buffer);
80-
82+
8183
function f1(x){
8284
x = +x;
8385
return +acos(x);
8486
}
85-
87+
8688
function f2(x){
8789
x = +x;
8890
return +asin(x);
8991
}
90-
92+
9193
function f3(x){
9294
x = +x;
9395
return +atan(x);
9496
}
95-
97+
9698
function f4(x){
9799
x = +x;
98100
return +cos(x);
99101
}
100-
102+
101103
function f5(x){
102104
x = +x;
103105
return +sin(x);
104106
}
105-
107+
106108
function f6(x){
107109
x = +x;
108110
return +tan(x);
109111
}
110-
112+
111113
function f7(x){
112114
x = +x;
113115
return +ceil(x);
114116
}
115-
117+
116118
function f8(x){
117119
x = +x;
118120
return +floor(x);
119121
}
120-
122+
121123
function f9(x){
122124
x = +x;
123125
return +exp(x);
124126
}
125-
127+
126128
function f10(x){
127129
x = +x;
128130
return +log(x);
129131
}
130-
132+
131133
function f11(x){
132134
x = +x;
133135
return +sqrt(x);
134136
}
135-
137+
136138
// stdlib math (signed) -> signed ^ (doublish) -> double
137139
function f12(x){
138140
x = +x;
@@ -142,14 +144,14 @@ function AsmModule(stdlib,foreign,buffer) {
142144
x = x|0;
143145
return abs(x|0)|0;
144146
}
145-
147+
146148
// stdlib math (doublish, doublish) -> double
147149
function f14(x,y){
148150
x = +x;
149151
y = +y;
150152
return +atan2(x,y);
151153
}
152-
154+
153155
function f15(x,y){
154156
x = +x;
155157
y = +y;
@@ -161,29 +163,29 @@ function AsmModule(stdlib,foreign,buffer) {
161163
y = y|0;
162164
return imul(x,y)|0;
163165
}
164-
166+
165167
function f17(x){
166168
x = fround(x);
167169
return fround(ceil(x));
168170
}
169-
171+
170172
function f18(x){
171173
x = fround(x);
172174
return fround(floor(x));
173175
}
174-
176+
175177
function f19(x){
176178
x = fround(x);
177179
return fround(sqrt(x));
178180
}
179-
181+
180182
function f20(x){
181183
x = fround(x);
182184
return fround(abs(x));
183185
}
184-
185-
186-
return {
186+
187+
188+
return {
187189
f1 : f1 ,
188190
f2 : f2 ,
189191
f3 : f3 ,
@@ -215,7 +217,19 @@ var asmModule = AsmModule(global,env,buffer);
215217
for (var i=0; i<all.length; ++i) {
216218
print("f1 (a["+i+"](" + all[i] +"))= " + (asmModule.f1 (all[i])));
217219
print("f2 (a["+i+"](" + all[i] +"))= " + (asmModule.f2 (all[i])));
218-
print("f3 (a["+i+"](" + all[i] +"))= " + (asmModule.f3 (all[i])));
220+
221+
if ((i == 11 || i == 41 || i == 54) && all[i] == 10) {
222+
// f3 => atan(f->1.47....) OSX != Windows / Linux
223+
if (WScript.Platform && WScript.Platform.OS == "darwin")
224+
{
225+
assert.areEqual(asmModule.f3(all[i]), 1.4711276743037344);
226+
} else {
227+
assert.areEqual(asmModule.f3(all[i]), 1.4711276743037347);
228+
}
229+
} else {
230+
print("f3 (a["+i+"](" + all[i] +"))= " + (asmModule.f3 (all[i])));
231+
}
232+
219233
print("f4 (a["+i+"](" + all[i] +"))= " + Math.round(asmModule.f4 (all[i])));
220234
print("f5 (a["+i+"](" + all[i] +"))= " + Math.round(asmModule.f5 (all[i])));
221235
print("f6 (a["+i+"](" + all[i] +"))= " + Math.round(asmModule.f6 (all[i])));
@@ -231,8 +245,8 @@ for (var i=0; i<all.length; ++i) {
231245
print("f19 (a["+i+"](" + all[i] +"))= " + (asmModule.f19 (all[i])));
232246
print("f20 (a["+i+"](" + all[i] +"))= " + (asmModule.f20 (all[i])));
233247
}
234-
for (var i=0; i<all.length; ++i) {
235-
for (var j=0; j<all.length; ++j) {
248+
for (var i = 0; i< all.length; ++i) {
249+
for (var j = 0; j< all.length; ++j) {
236250
// rounding atan2, because crt call gives us slightly different precision
237251
print("f14 (a["+i+"](" + all[i] +") , a["+j+"](" + all[j] +") )= " + Math.round(asmModule.f14 (all[i],all[j])));
238252
print("f15 (a["+i+"](" + all[i] +") , a["+j+"](" + all[j] +") )= " + Math.round(asmModule.f15 (all[i],all[j]))|0);

deps/chakrashim/core/test/AsmJs/rlexe.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,13 @@
118118
<default>
119119
<files>MathBuiltinsCall.js</files>
120120
<baseline>MathBuiltinsCall.baseline</baseline>
121-
<tags>exclude_mac</tags>
122121
<compile-flags>-testtrace:asmjs</compile-flags>
123122
</default>
124123
</test>
125124
<test>
126125
<default>
127126
<files>MathBuiltinsCall.js</files>
128127
<baseline>MathBuiltinsCall.baseline</baseline>
129-
<tags>exclude_mac</tags>
130128
<compile-flags>-testtrace:asmjs -maic:1 -sse:3</compile-flags>
131129
</default>
132130
</test>
@@ -522,8 +520,6 @@
522520
<default>
523521
<files>MathBuiltinsCall.js</files>
524522
<baseline>MathBuiltinsCall.baseline</baseline>
525-
<!-- mac gives has some test which gives different precision result, so exclude it -->
526-
<tags>exclude_mac</tags>
527523
<compile-flags>-testtrace:asmjs -nonative</compile-flags>
528524
</default>
529525
</test>

0 commit comments

Comments
 (0)