File tree 7 files changed +35
-131
lines changed
7 files changed +35
-131
lines changed Original file line number Diff line number Diff line change @@ -1435,9 +1435,7 @@ export namespace NativeMath {
1435
1435
// @ts -ignore: decorator
1436
1436
@inline
1437
1437
export function signbit ( x : f64 ) : bool {
1438
- // In ECMAScript all NaN values are indistinguishable from each other
1439
- // so we need handle NaN and negative NaN in similar way
1440
- return < bool > ( < i32 > ( reinterpret < u64 > ( x ) >>> 63 ) & i32 ( x == x ) ) ;
1438
+ return < bool > ( reinterpret < u64 > ( x ) >>> 63 ) ;
1441
1439
}
1442
1440
1443
1441
export function sin ( x : f64 ) : f64 { // see: musl/src/math/sin.c
@@ -2714,8 +2712,7 @@ export namespace NativeMathf {
2714
2712
// @ts -ignore: decorator
2715
2713
@inline
2716
2714
export function signbit ( x : f32 ) : bool {
2717
- // @ts -ignore: type
2718
- return < bool > ( ( reinterpret < u32 > ( x ) >>> 31 ) & ( x == x ) ) ;
2715
+ return < bool > ( reinterpret < u32 > ( x ) >>> 31 ) ;
2719
2716
}
2720
2717
2721
2718
export function sin ( x : f32 ) : f32 { // see: musl/src/math/sinf.c
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ Object.defineProperties(globalScope["JSMath"], {
325
325
sincos_cos : { value : 0.0 , writable : true } ,
326
326
signbit : {
327
327
value : function signbit ( x ) {
328
- F64 [ 0 ] = x ; return Boolean ( ( U64 [ 1 ] >>> 31 ) & ( x == x ) ) ;
328
+ F64 [ 0 ] = x ; return Boolean ( U64 [ 1 ] >>> 31 ) ;
329
329
}
330
330
} ,
331
331
sincos : {
Original file line number Diff line number Diff line change 187
187
i64.reinterpret_f64
188
188
i64.const 63
189
189
i64.shr_u
190
- i32.wrap_i64
191
- local.get $0
192
- local.get $0
193
- f64.eq
194
- i32.and
190
+ i64.const 0
191
+ i64.ne
195
192
i32.const 0
196
193
i32.ne
197
194
local.get $1
198
195
i64.reinterpret_f64
199
196
i64.const 63
200
197
i64.shr_u
201
- i32.wrap_i64
202
- local.get $1
203
- local.get $1
204
- f64.eq
205
- i32.and
198
+ i64.const 0
199
+ i64.ne
206
200
i32.const 0
207
201
i32.ne
208
202
i32.eq
382
376
i32.reinterpret_f32
383
377
i32.const 31
384
378
i32.shr_u
385
- local.get $0
386
- local.get $0
387
- f32.eq
388
- i32.and
389
379
i32.const 0
390
380
i32.ne
391
381
local.get $1
392
382
i32.reinterpret_f32
393
383
i32.const 31
394
384
i32.shr_u
395
- local.get $1
396
- local.get $1
397
- f32.eq
398
- i32.and
399
385
i32.const 0
400
386
i32.ne
401
387
i32.eq
Original file line number Diff line number Diff line change @@ -3129,7 +3129,7 @@ assert(NativeMath.signbit(-0.0) == true);
3129
3129
assert ( NativeMath . signbit ( 1.0 ) == false ) ;
3130
3130
assert ( NativeMath . signbit ( - 1.0 ) == true ) ;
3131
3131
assert ( NativeMath . signbit ( + NaN ) == false ) ;
3132
- assert ( NativeMath . signbit ( - NaN ) == false ) ;
3132
+ assert ( NativeMath . signbit ( - NaN ) == true ) ;
3133
3133
assert ( NativeMath . signbit ( + Infinity ) == false ) ;
3134
3134
assert ( NativeMath . signbit ( - Infinity ) == true ) ;
3135
3135
@@ -3142,7 +3142,7 @@ assert(NativeMathf.signbit(-0.0) == true);
3142
3142
assert ( NativeMathf . signbit ( 1.0 ) == false ) ;
3143
3143
assert ( NativeMathf . signbit ( - 1.0 ) == true ) ;
3144
3144
assert ( NativeMathf . signbit ( + NaN ) == false ) ;
3145
- assert ( NativeMathf . signbit ( - NaN ) == false ) ;
3145
+ assert ( NativeMathf . signbit ( - NaN ) == true ) ;
3146
3146
assert ( NativeMathf . signbit ( + Infinity ) == false ) ;
3147
3147
assert ( NativeMathf . signbit ( - Infinity ) == true ) ;
3148
3148
@@ -4121,4 +4121,4 @@ assert(1 ** 0.5 == 1.0);
4121
4121
assert ( 0 ** 0.5 == 0.0 ) ;
4122
4122
assert ( 0 ** - 1.0 == Infinity ) ;
4123
4123
assert ( 0.0 ** 0 == 1.0 ) ;
4124
- assert ( 1.0 ** 1 == 1.0 ) ;
4124
+ assert ( 1.0 ** 1 == 1.0 ) ;
Original file line number Diff line number Diff line change 269
269
i64.reinterpret_f64
270
270
i64.const 63
271
271
i64.shr_u
272
- i32.wrap_i64
273
- local.get $3
274
- local.get $3
275
- f64.eq
276
- i32.and
272
+ i64.const 0
273
+ i64.ne
277
274
i32.const 0
278
275
i32.ne
279
276
local.get $1
282
279
i64.reinterpret_f64
283
280
i64.const 63
284
281
i64.shr_u
285
- i32.wrap_i64
286
- local.get $3
287
- local.get $3
288
- f64.eq
289
- i32.and
282
+ i64.const 0
283
+ i64.ne
290
284
i32.const 0
291
285
i32.ne
292
286
i32.eq
503
497
i32.reinterpret_f32
504
498
i32.const 31
505
499
i32.shr_u
506
- local.get $3
507
- local.get $3
508
- f32.eq
509
- i32.and
510
500
i32.const 0
511
501
i32.ne
512
502
local.get $1
515
505
i32.reinterpret_f32
516
506
i32.const 31
517
507
i32.shr_u
518
- local.get $3
519
- local.get $3
520
- f32.eq
521
- i32.and
522
508
i32.const 0
523
509
i32.ne
524
510
i32.eq
48467
48453
i64.reinterpret_f64
48468
48454
i64.const 63
48469
48455
i64.shr_u
48470
- i32.wrap_i64
48471
- local.get $0
48472
- local.get $0
48473
- f64.eq
48474
- i32.and
48456
+ i64.const 0
48457
+ i64.ne
48475
48458
i32.const 0
48476
48459
i32.ne
48477
48460
i32.const 0
48483
48466
i64.reinterpret_f64
48484
48467
i64.const 63
48485
48468
i64.shr_u
48486
- i32.wrap_i64
48487
- local.get $0
48488
- local.get $0
48489
- f64.eq
48490
- i32.and
48469
+ i64.const 0
48470
+ i64.ne
48491
48471
i32.const 0
48492
48472
i32.ne
48493
48473
i32.const 1
48499
48479
i64.reinterpret_f64
48500
48480
i64.const 63
48501
48481
i64.shr_u
48502
- i32.wrap_i64
48503
- local.get $0
48504
- local.get $0
48505
- f64.eq
48506
- i32.and
48482
+ i64.const 0
48483
+ i64.ne
48507
48484
i32.const 0
48508
48485
i32.ne
48509
48486
i32.const 0
48515
48492
i64.reinterpret_f64
48516
48493
i64.const 63
48517
48494
i64.shr_u
48518
- i32.wrap_i64
48519
- local.get $0
48520
- local.get $0
48521
- f64.eq
48522
- i32.and
48495
+ i64.const 0
48496
+ i64.ne
48523
48497
i32.const 0
48524
48498
i32.ne
48525
48499
i32.const 1
48531
48505
i64.reinterpret_f64
48532
48506
i64.const 63
48533
48507
i64.shr_u
48534
- i32.wrap_i64
48535
- local.get $0
48536
- local.get $0
48537
- f64.eq
48538
- i32.and
48508
+ i64.const 0
48509
+ i64.ne
48539
48510
i32.const 0
48540
48511
i32.ne
48541
48512
i32.const 0
@@ -48548,14 +48519,11 @@
48548
48519
i64.reinterpret_f64
48549
48520
i64.const 63
48550
48521
i64.shr_u
48551
- i32.wrap_i64
48552
- local.get $0
48553
- local.get $0
48554
- f64.eq
48555
- i32.and
48522
+ i64.const 0
48523
+ i64.ne
48556
48524
i32.const 0
48557
48525
i32.ne
48558
- i32.const 0
48526
+ i32.const 1
48559
48527
i32.eq
48560
48528
drop
48561
48529
f64.const inf
48564
48532
i64.reinterpret_f64
48565
48533
i64.const 63
48566
48534
i64.shr_u
48567
- i32.wrap_i64
48568
- local.get $0
48569
- local.get $0
48570
- f64.eq
48571
- i32.and
48535
+ i64.const 0
48536
+ i64.ne
48572
48537
i32.const 0
48573
48538
i32.ne
48574
48539
i32.const 0
48581
48546
i64.reinterpret_f64
48582
48547
i64.const 63
48583
48548
i64.shr_u
48584
- i32.wrap_i64
48585
- local.get $0
48586
- local.get $0
48587
- f64.eq
48588
- i32.and
48549
+ i64.const 0
48550
+ i64.ne
48589
48551
i32.const 0
48590
48552
i32.ne
48591
48553
i32.const 1
48597
48559
i32.reinterpret_f32
48598
48560
i32.const 31
48599
48561
i32.shr_u
48600
- local.get $4
48601
- local.get $4
48602
- f32.eq
48603
- i32.and
48604
48562
i32.const 0
48605
48563
i32.ne
48606
48564
i32.const 0
48612
48570
i32.reinterpret_f32
48613
48571
i32.const 31
48614
48572
i32.shr_u
48615
- local.get $4
48616
- local.get $4
48617
- f32.eq
48618
- i32.and
48619
48573
i32.const 0
48620
48574
i32.ne
48621
48575
i32.const 1
48627
48581
i32.reinterpret_f32
48628
48582
i32.const 31
48629
48583
i32.shr_u
48630
- local.get $4
48631
- local.get $4
48632
- f32.eq
48633
- i32.and
48634
48584
i32.const 0
48635
48585
i32.ne
48636
48586
i32.const 0
48642
48592
i32.reinterpret_f32
48643
48593
i32.const 31
48644
48594
i32.shr_u
48645
- local.get $4
48646
- local.get $4
48647
- f32.eq
48648
- i32.and
48649
48595
i32.const 0
48650
48596
i32.ne
48651
48597
i32.const 1
48657
48603
i32.reinterpret_f32
48658
48604
i32.const 31
48659
48605
i32.shr_u
48660
- local.get $4
48661
- local.get $4
48662
- f32.eq
48663
- i32.and
48664
48606
i32.const 0
48665
48607
i32.ne
48666
48608
i32.const 0
48673
48615
i32.reinterpret_f32
48674
48616
i32.const 31
48675
48617
i32.shr_u
48676
- local.get $4
48677
- local.get $4
48678
- f32.eq
48679
- i32.and
48680
48618
i32.const 0
48681
48619
i32.ne
48682
- i32.const 0
48620
+ i32.const 1
48683
48621
i32.eq
48684
48622
drop
48685
48623
f32.const inf
48688
48626
i32.reinterpret_f32
48689
48627
i32.const 31
48690
48628
i32.shr_u
48691
- local.get $4
48692
- local.get $4
48693
- f32.eq
48694
- i32.and
48695
48629
i32.const 0
48696
48630
i32.ne
48697
48631
i32.const 0
48704
48638
i32.reinterpret_f32
48705
48639
i32.const 31
48706
48640
i32.shr_u
48707
- local.get $4
48708
- local.get $4
48709
- f32.eq
48710
- i32.and
48711
48641
i32.const 0
48712
48642
i32.ne
48713
48643
i32.const 1
Original file line number Diff line number Diff line change 9243
9243
i32.const 3008
9244
9244
i32.const 0
9245
9245
call $~lib/string/parseInt
9246
- local.tee $3
9247
9246
i64.reinterpret_f64
9248
9247
i64.const 63
9249
9248
i64.shr_u
9250
- i32.wrap_i64
9251
- local.get $3
9252
- local.get $3
9253
- f64.eq
9254
- i32.and
9255
- i32.eqz
9249
+ i64.eqz
9256
9250
if
9257
9251
i32.const 0
9258
9252
i32.const 1088
Original file line number Diff line number Diff line change 13147
13147
i64.reinterpret_f64
13148
13148
i64.const 63
13149
13149
i64.shr_u
13150
- i32.wrap_i64
13151
- local.get $32
13152
- local.get $32
13153
- f64.eq
13154
- i32.and
13150
+ i64.const 0
13151
+ i64.ne
13155
13152
i32.const 0
13156
13153
i32.ne
13157
13154
i32.eqz
You can’t perform that action at this time.
0 commit comments