@@ -4518,202 +4518,11 @@ LibraryManager.library = {
4518
4518
llvm_log_f64 : 'Math_log' ,
4519
4519
llvm_exp_f32 : 'Math_exp' ,
4520
4520
llvm_exp_f64 : 'Math_exp' ,
4521
- cbrt : function ( x ) {
4522
- return Math . pow ( x , 1 / 3 ) ;
4523
- } ,
4524
- cbrtf : 'cbrt' ,
4525
- cbrtl : 'cbrt' ,
4526
-
4527
- modf : function ( x , intpart ) {
4528
- { { { makeSetValue ( 'intpart' , 0 , '(x < 0) ? Math.ceil(x) : Math.floor(x)' , 'double' ) } } } ;
4529
- return x - { { { makeGetValue ( 'intpart' , 0 , 'double' ) } } } ;
4530
- } ,
4531
- modff: function ( x , intpart ) {
4532
- { { { makeSetValue ( 'intpart' , 0 , '(x < 0) ? Math.ceil(x) : Math.floor(x)' , 'float' ) } } } ;
4533
- return x - { { { makeGetValue ( 'intpart' , 0 , 'float' ) } } } ;
4534
- } ,
4535
- finite: function ( x ) {
4536
- return isFinite ( x ) ;
4537
- } ,
4538
- __finite : 'finite' ,
4539
- isinf : function ( x ) {
4540
- return ! isNaN ( x ) && ! isFinite ( x ) ;
4541
- } ,
4542
- __isinf : 'isinf' ,
4543
- isnan : function ( x ) {
4544
- return isNaN ( x ) ;
4545
- } ,
4546
- __isnan : 'isnan' ,
4547
4521
4548
4522
_reallyNegative : function ( x ) {
4549
4523
return x < 0 || ( x === 0 && ( 1 / x ) === - Infinity ) ;
4550
4524
} ,
4551
4525
4552
- copysign__deps : [ '_reallyNegative' ] ,
4553
- copysign : function ( a , b ) {
4554
- return __reallyNegative ( a ) === __reallyNegative ( b ) ? a : - a ;
4555
- } ,
4556
- copysignf : 'copysign' ,
4557
- copysignl : 'copysign' ,
4558
- __signbit__deps : [ 'copysign' ] ,
4559
- __signbit : function ( x ) {
4560
- // We implement using copysign so that we get support
4561
- // for negative zero (once copysign supports that).
4562
- return _copysign ( 1.0 , x ) < 0 ;
4563
- } ,
4564
- __signbitd : '__signbit' ,
4565
- __signbitf : '__signbit' ,
4566
- __signbitl : '__signbit' ,
4567
- hypot : function ( a , b ) {
4568
- return Math . sqrt ( a * a + b * b ) ;
4569
- } ,
4570
- hypotf : 'hypot' ,
4571
- hypotl : 'hypot' ,
4572
- sinh : function ( x ) {
4573
- var p = Math . pow ( Math . E , x ) ;
4574
- return ( p - ( 1 / p ) ) / 2 ;
4575
- } ,
4576
- sinhf : 'sinh' ,
4577
- sinhl : 'sinh' ,
4578
- cosh : function ( x ) {
4579
- var p = Math . pow ( Math . E , x ) ;
4580
- return ( p + ( 1 / p ) ) / 2 ;
4581
- } ,
4582
- coshf : 'cosh' ,
4583
- coshl : 'cosh' ,
4584
- tanh__deps : [ 'sinh' , 'cosh' ] ,
4585
- tanh : function ( x ) {
4586
- return _sinh ( x ) / _cosh ( x ) ;
4587
- } ,
4588
- tanhf : 'tanh' ,
4589
- tanhl : 'tanh' ,
4590
- asinh : function ( x ) {
4591
- return Math . log ( x + Math . sqrt ( x * x + 1 ) ) ;
4592
- } ,
4593
- asinhf : 'asinh' ,
4594
- asinhl : 'asinh' ,
4595
- acosh : function ( x ) {
4596
- return Math . log ( x * 1 + Math . sqrt ( x * x - 1 ) ) ;
4597
- } ,
4598
- acoshf : 'acosh' ,
4599
- acoshl : 'acosh' ,
4600
- atanh : function ( x ) {
4601
- return Math . log ( ( 1 + x ) / ( 1 - x ) ) / 2 ;
4602
- } ,
4603
- atanhf : 'atanh' ,
4604
- atanhl : 'atanh' ,
4605
- exp2 : function ( x ) {
4606
- return Math . pow ( 2 , x ) ;
4607
- } ,
4608
- exp2f : 'exp2' ,
4609
- exp2l : 'exp2' ,
4610
- expm1 : function ( x ) {
4611
- return Math . exp ( x ) - 1 ;
4612
- } ,
4613
- expm1f : 'expm1' ,
4614
- expm1l : 'expm1' ,
4615
- round : function ( x ) {
4616
- return ( x < 0 ) ? - Math . round ( - x ) : Math . round ( x ) ;
4617
- } ,
4618
- roundf : 'round' ,
4619
- roundl : 'round' ,
4620
- lround : 'round' ,
4621
- lroundf : 'round' ,
4622
- lroundl : 'round' ,
4623
- llround : 'round' ,
4624
- llroundf : 'round' ,
4625
- llroundl : 'round' ,
4626
- rint : function ( x ) {
4627
- if ( Math . abs ( x % 1 ) !== 0.5 ) return Math . round ( x ) ;
4628
- return x + x % 2 + ( ( x < 0 ) ? 1 : - 1 ) ;
4629
- } ,
4630
- rintf : 'rint' ,
4631
- rintl : 'rint' ,
4632
- lrint : 'rint' ,
4633
- lrintf : 'rint' ,
4634
- lrintl : 'rint' ,
4635
- #if USE_TYPED_ARRAYS == 2
4636
- llrint: function ( x ) {
4637
- x = ( x < 0 ) ? - Math . round ( - x ) : Math . round ( x ) ;
4638
- { { { makeStructuralReturn ( splitI64 ( 'x' ) ) } } } ;
4639
- } ,
4640
- #else
4641
- llrint : 'rint' ,
4642
- #endif
4643
- llrintf : 'llrint' ,
4644
- llrintl : 'llrint' ,
4645
- nearbyint : 'rint' ,
4646
- nearbyintf : 'rint' ,
4647
- nearbyintl : 'rint' ,
4648
- trunc : function ( x ) {
4649
- return ( x < 0 ) ? Math . ceil ( x ) : Math . floor ( x ) ;
4650
- } ,
4651
- truncf : 'trunc' ,
4652
- truncl : 'trunc' ,
4653
- fdim : function ( x , y ) {
4654
- return ( x > y ) ? x - y : 0 ;
4655
- } ,
4656
- fdimf : 'fdim' ,
4657
- fdiml : 'fdim' ,
4658
- fmax : function ( x , y ) {
4659
- return isNaN ( x ) ? y : isNaN ( y ) ? x : Math . max ( x , y ) ;
4660
- } ,
4661
- fmaxf : 'fmax' ,
4662
- fmaxl : 'fmax' ,
4663
- fmin : function ( x , y ) {
4664
- return isNaN ( x ) ? y : isNaN ( y ) ? x : Math . min ( x , y ) ;
4665
- } ,
4666
- fminf : 'fmin' ,
4667
- fminl : 'fmin' ,
4668
- fma : function ( x , y , z ) {
4669
- return x * y + z ;
4670
- } ,
4671
- fmaf : 'fma' ,
4672
- fmal : 'fma' ,
4673
- fmod : function ( x , y ) {
4674
- return x % y ;
4675
- } ,
4676
- fmodf : 'fmod' ,
4677
- fmodl : 'fmod' ,
4678
- remainder : 'fmod' ,
4679
- remainderf : 'fmod' ,
4680
- remainderl : 'fmod' ,
4681
- log10 : function ( x ) {
4682
- return Math . log ( x ) / Math . LN10 ;
4683
- } ,
4684
- log10f : 'log10' ,
4685
- log10l : 'log10' ,
4686
- log1p : function ( x ) {
4687
- return Math . log ( 1 + x ) ;
4688
- } ,
4689
- log1pf : 'log1p' ,
4690
- log1pl : 'log1p' ,
4691
- log2 : function ( x ) {
4692
- return Math . log ( x ) / Math . LN2 ;
4693
- } ,
4694
- log2f : 'log2' ,
4695
- log2l : 'log2' ,
4696
- nan : function ( x ) {
4697
- return NaN ;
4698
- } ,
4699
- nanf : 'nan' ,
4700
- nanl : 'nan' ,
4701
-
4702
- sincos : function ( x , sine , cosine ) {
4703
- var sineVal = Math . sin ( x ) ,
4704
- cosineVal = Math . cos ( x ) ;
4705
- { { { makeSetValue ( 'sine' , '0' , 'sineVal' , 'double' ) } } } ;
4706
- { { { makeSetValue ( 'cosine' , '0' , 'cosineVal' , 'double' ) } } } ;
4707
- } ,
4708
- sincosl : 'sincos' ,
4709
-
4710
- sincosf : function ( x , sine , cosine ) {
4711
- var sineVal = Math . sin ( x ) ,
4712
- cosineVal = Math . cos ( x ) ;
4713
- { { { makeSetValue ( 'sine' , '0' , 'sineVal' , 'float' ) } } } ;
4714
- { { { makeSetValue ( 'cosine' , '0' , 'cosineVal' , 'float' ) } } } ;
4715
- } ,
4716
-
4717
4526
div : function ( divt , numer , denom ) {
4718
4527
var quot = ( numer / denom ) | 0 ;
4719
4528
var rem = numer - quot * denom ;
@@ -4722,17 +4531,6 @@ LibraryManager.library = {
4722
4531
return divt ;
4723
4532
} ,
4724
4533
4725
- __fpclassify : function ( x ) {
4726
- if ( isNaN ( x ) ) return { { { cDefine ( 'FP_NAN' ) } } } ;
4727
- if ( ! isFinite ( x ) ) return { { { cDefine ( 'FP_INFINITE' ) } } } ;
4728
- if ( x == 0 ) return { { { cDefine ( 'FP_ZERO' ) } } } ;
4729
- // FP_SUBNORMAL..?
4730
- return { { { cDefine ( 'FP_NORMAL' ) } } } ;
4731
- } ,
4732
- __fpclassifyd: '__fpclassify' , // Needed by tests/python/python.le32.bc
4733
- __fpclassifyf : '__fpclassify' ,
4734
- __fpclassifyl : '__fpclassify' ,
4735
-
4736
4534
// ==========================================================================
4737
4535
// sys/utsname.h
4738
4536
// ==========================================================================
0 commit comments