Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

11 changed files:

Changes:

  • src/lisp/irrat.c
    ... ... @@ -56,6 +56,31 @@ extern float cr_expm1f(float);
    56 56
     extern void cr_sincosf(float, float *, float *);
    
    57 57
     #else
    
    58 58
     #include "openlibm_math.h"
    
    59
    +/*
    
    60
    + * Declare the openlibm functions we use.  This is needed because we
    
    61
    + * changed the names of the openlibm functions.
    
    62
    + */
    
    63
    +extern float openlibm_asinhf(float);
    
    64
    +extern float openlibm_atanf(float);
    
    65
    +extern float openlibm_cosf(float);
    
    66
    +extern float openlibm_expm1f(float);
    
    67
    +extern float openlibm_log1pf(float);
    
    68
    +extern float openlibm_sinf(float);
    
    69
    +extern float openlibm_tanf(float);
    
    70
    +extern float openlibm_tanhf(float);
    
    71
    +extern void openlibm_sincosf(float, float*, float*);
    
    72
    +extern float __ieee754_acosf(float);
    
    73
    +extern float __ieee754_acoshf(float);
    
    74
    +extern float __ieee754_logf(float);
    
    75
    +extern float __ieee754_atanhf(float);
    
    76
    +extern float __ieee754_asinf(float);
    
    77
    +extern float __ieee754_atan2f(float, float);
    
    78
    +extern float __ieee754_expf(float);
    
    79
    +extern float __ieee754_coshf(float);
    
    80
    +extern float __ieee754_log10f(float);
    
    81
    +extern float __ieee754_sinhf(float);
    
    82
    +extern float __ieee754_hypotf(float, float);
    
    83
    +
    
    59 84
     #endif
    
    60 85
     
    
    61 86
     
    
    ... ... @@ -350,7 +375,7 @@ lisp_sinf(float x)
    350 375
     #ifdef FEATURE_CORE_MATH
    
    351 376
         return cr_sinf(x);
    
    352 377
     #else    
    
    353
    -    return sinf(x);
    
    378
    +    return openlibm_sinf(x);
    
    354 379
     #endif    
    
    355 380
     }
    
    356 381
     
    
    ... ... @@ -360,7 +385,7 @@ lisp_cosf(float x)
    360 385
     #ifdef FEATURE_CORE_MATH
    
    361 386
         return cr_cosf(x);
    
    362 387
     #else    
    
    363
    -    return cosf(x);
    
    388
    +    return openlibm_cosf(x);
    
    364 389
     #endif
    
    365 390
     }
    
    366 391
     
    
    ... ... @@ -370,7 +395,7 @@ lisp_tanf(float x)
    370 395
     #ifdef FEATURE_CORE_MATH
    
    371 396
         return cr_tanf(x);
    
    372 397
     #else    
    
    373
    -    return tanf(x);
    
    398
    +    return openlibm_tanf(x);
    
    374 399
     #endif
    
    375 400
     }
    
    376 401
     
    
    ... ... @@ -380,7 +405,7 @@ lisp_atanf(float x)
    380 405
     #ifdef FEATURE_CORE_MATH
    
    381 406
         return cr_atanf(x);
    
    382 407
     #else    
    
    383
    -    return atanf(x);
    
    408
    +    return openlibm_atanf(x);
    
    384 409
     #endif
    
    385 410
     }
    
    386 411
     
    
    ... ... @@ -390,7 +415,7 @@ lisp_atan2f(float y, float x)
    390 415
     #ifdef FEATURE_CORE_MATH
    
    391 416
         return cr_atan2f(y, x);
    
    392 417
     #else    
    
    393
    -    return atan2f(y, x);
    
    418
    +    return __ieee754_atan2f(y, x);
    
    394 419
     #endif
    
    395 420
     }
    
    396 421
     
    
    ... ... @@ -400,7 +425,7 @@ lisp_asinf(float x)
    400 425
     #ifdef FEATURE_CORE_MATH
    
    401 426
         return cr_asinf(x);
    
    402 427
     #else    
    
    403
    -    return asinf(x);
    
    428
    +    return __ieee754_asinf(x);
    
    404 429
     #endif
    
    405 430
     }
    
    406 431
     
    
    ... ... @@ -410,7 +435,7 @@ lisp_acosf(float x)
    410 435
     #ifdef FEATURE_CORE_MATH
    
    411 436
         return cr_acosf(x);
    
    412 437
     #else    
    
    413
    -    return acosf(x);
    
    438
    +    return __ieee754_acosf(x);
    
    414 439
     #endif
    
    415 440
     }
    
    416 441
     
    
    ... ... @@ -420,7 +445,7 @@ lisp_sinhf(float x)
    420 445
     #ifdef FEATURE_CORE_MATH
    
    421 446
         return cr_sinhf(x);
    
    422 447
     #else    
    
    423
    -    return sinhf(x);
    
    448
    +    return __ieee754_sinhf(x);
    
    424 449
     #endif
    
    425 450
     }
    
    426 451
     
    
    ... ... @@ -430,7 +455,7 @@ lisp_coshf(float x)
    430 455
     #ifdef FEATURE_CORE_MATH
    
    431 456
         return cr_coshf(x);
    
    432 457
     #else    
    
    433
    -    return coshf(x);
    
    458
    +    return __ieee754_coshf(x);
    
    434 459
     #endif
    
    435 460
     }
    
    436 461
     
    
    ... ... @@ -440,7 +465,7 @@ lisp_tanhf(float x)
    440 465
     #ifdef FEATURE_CORE_MATH
    
    441 466
         return cr_tanhf(x);
    
    442 467
     #else    
    
    443
    -    return tanhf(x);
    
    468
    +    return openlibm_tanhf(x);
    
    444 469
     #endif
    
    445 470
     }
    
    446 471
     
    
    ... ... @@ -450,7 +475,7 @@ lisp_asinhf(float x)
    450 475
     #ifdef FEATURE_CORE_MATH
    
    451 476
         return cr_asinhf(x);
    
    452 477
     #else    
    
    453
    -    return asinhf((double) x);
    
    478
    +    return openlibm_asinhf((double) x);
    
    454 479
     #endif
    
    455 480
     }
    
    456 481
     
    
    ... ... @@ -460,7 +485,7 @@ lisp_acoshf(float x)
    460 485
     #ifdef FEATURE_CORE_MATH
    
    461 486
         return cr_acoshf(x);
    
    462 487
     #else    
    
    463
    -    return acoshf(x);
    
    488
    +    return __ieee754_acoshf(x);
    
    464 489
     #endif
    
    465 490
     }
    
    466 491
     
    
    ... ... @@ -470,7 +495,7 @@ lisp_atanhf(float x)
    470 495
     #ifdef FEATURE_CORE_MATH
    
    471 496
         return cr_atanhf(x);
    
    472 497
     #else    
    
    473
    -    return atanhf(x);
    
    498
    +    return __ieee754_atanhf(x);
    
    474 499
     #endif
    
    475 500
     }
    
    476 501
     
    
    ... ... @@ -480,7 +505,7 @@ lisp_expf(float x)
    480 505
     #ifdef FEATURE_CORE_MATH
    
    481 506
         return cr_expf(x);
    
    482 507
     #else    
    
    483
    -    return expf(x);
    
    508
    +    return __ieee754_expf(x);
    
    484 509
     #endif
    
    485 510
     }
    
    486 511
     
    
    ... ... @@ -490,7 +515,7 @@ lisp_logf(float x)
    490 515
     #ifdef FEATURE_CORE_MATH
    
    491 516
         return cr_logf(x);
    
    492 517
     #else    
    
    493
    -    return log(x);
    
    518
    +    return __ieee754_log(x);
    
    494 519
     #endif
    
    495 520
     }
    
    496 521
     
    
    ... ... @@ -500,7 +525,7 @@ lisp_log10f(float x)
    500 525
     #ifdef FEATURE_CORE_MATH
    
    501 526
         return cr_log10f(x);
    
    502 527
     #else    
    
    503
    -    return log10f(x);
    
    528
    +    return __ieee754_log10f(x);
    
    504 529
     #endif
    
    505 530
     }
    
    506 531
     
    
    ... ... @@ -532,7 +557,7 @@ lisp_hypotf(float x, float y)
    532 557
     #ifdef FEATURE_CORE_MATH
    
    533 558
         return cr_hypotf(x, y);
    
    534 559
     #else    
    
    535
    -    return hypotf(x, y);
    
    560
    +    return __ieee754_hypotf(x, y);
    
    536 561
     #endif
    
    537 562
     }
    
    538 563
     
    
    ... ... @@ -542,7 +567,7 @@ lisp_log1pf(float x)
    542 567
     #ifdef FEATURE_CORE_MATH
    
    543 568
         return cr_log1pf(x);
    
    544 569
     #else    
    
    545
    -    return log1pf(x);
    
    570
    +    return openlibm_log1pf(x);
    
    546 571
     #endif
    
    547 572
     }
    
    548 573
     
    
    ... ... @@ -552,7 +577,7 @@ lisp_expm1f(float x)
    552 577
     #ifdef FEATURE_CORE_MATH
    
    553 578
         return cr_expm1f(x);
    
    554 579
     #else    
    
    555
    -    return expm1f(x);
    
    580
    +    return openlibm_expm1f(x);
    
    556 581
     #endif
    
    557 582
     }
    
    558 583
     
    
    ... ... @@ -562,8 +587,8 @@ lisp_sincosf(float x, float *s, float *c)
    562 587
     #ifdef FEATURE_CORE_MATH
    
    563 588
         cr_sincosf(x, s, c);
    
    564 589
     #else    
    
    565
    -    extern void sincosf(float x, float *s, float *c);
    
    590
    +    extern void openlibm_sincosf(float x, float *s, float *c);
    
    566 591
     
    
    567
    -    sincosf(x, s, c);
    
    592
    +    openlibm_sincosf(x, s, c);
    
    568 593
     #endif
    
    569 594
     }

  • src/lisp/openlibm/math_private.h
    ... ... @@ -309,6 +309,7 @@ irint(double x)
    309 309
     #define	__ieee754_yn	yn
    
    310 310
     #define	__ieee754_remainder remainder
    
    311 311
     #define	__ieee754_sqrtf	sqrtf
    
    312
    +#if 0
    
    312 313
     #define	__ieee754_acosf	acosf
    
    313 314
     #define	__ieee754_acoshf acoshf
    
    314 315
     #define	__ieee754_logf	logf
    
    ... ... @@ -317,14 +318,31 @@ irint(double x)
    317 318
     #define	__ieee754_atan2f atan2f
    
    318 319
     #define	__ieee754_expf	expf
    
    319 320
     #define	__ieee754_coshf	coshf
    
    321
    +#else
    
    322
    +extern float __ieee754_acosf(float);
    
    323
    +extern float __ieee754_acoshf(float);
    
    324
    +extern float __ieee754_logf(float);
    
    325
    +extern float __ieee754_atanhf(float);
    
    326
    +extern float __ieee754_asinf(float);
    
    327
    +extern float __ieee754_atan2f(float, float);
    
    328
    +extern float __ieee754_expf(float);
    
    329
    +extern float __ieee754_coshf(float);
    
    330
    +#endif
    
    320 331
     #define	__ieee754_fmodf	fmodf
    
    321 332
     #define	__ieee754_powf	powf
    
    322 333
     #define	__ieee754_lgammaf lgammaf
    
    323 334
     #define	__ieee754_lgammaf_r lgammaf_r
    
    335
    +#if 0
    
    324 336
     #define	__ieee754_log10f log10f
    
    325 337
     #define	__ieee754_log2f log2f
    
    326 338
     #define	__ieee754_sinhf	sinhf
    
    327 339
     #define	__ieee754_hypotf hypotf
    
    340
    +#else
    
    341
    +extern float __ieee754_log10f(float);
    
    342
    +extern float __ieee754_log2f(float);
    
    343
    +extern float __ieee754_sinhf(float);
    
    344
    +extern float __ieee754_hypotf(float, float);
    
    345
    +#endif
    
    328 346
     #define	__ieee754_j0f	j0f
    
    329 347
     #define	__ieee754_j1f	j1f
    
    330 348
     #define	__ieee754_y0f	y0f
    

  • src/lisp/openlibm/s_asinhf.c
    ... ... @@ -26,7 +26,7 @@ ln2 = 6.9314718246e-01, /* 0x3f317218 */
    26 26
     huge=  1.0000000000e+30;
    
    27 27
     
    
    28 28
     OLM_DLLEXPORT float
    
    29
    -asinhf(float x)
    
    29
    +openlibm_asinhf(float x)
    
    30 30
     {
    
    31 31
     	float t,w;
    
    32 32
     	int32_t hx,ix;
    

  • src/lisp/openlibm/s_atanf.c
    ... ... @@ -47,7 +47,7 @@ one = 1.0,
    47 47
     huge   = 1.0e30;
    
    48 48
     
    
    49 49
     OLM_DLLEXPORT float
    
    50
    -atanf(float x)
    
    50
    +openlibm_atanf(float x)
    
    51 51
     {
    
    52 52
     	float w,s1,s2,z;
    
    53 53
     	int32_t ix,hx,id;
    

  • src/lisp/openlibm/s_cosf.c
    ... ... @@ -36,7 +36,7 @@ c3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */
    36 36
     c4pio2 = 4*M_PI_2;			/* 0x401921FB, 0x54442D18 */
    
    37 37
     
    
    38 38
     OLM_DLLEXPORT float
    
    39
    -cosf(float x)
    
    39
    +openlibm_cosf(float x)
    
    40 40
     {
    
    41 41
     	double y;
    
    42 42
     	int32_t n, hx, ix;
    

  • src/lisp/openlibm/s_expm1f.c
    ... ... @@ -38,7 +38,7 @@ Q1 = -3.3333212137e-2, /* -0x888868.0p-28 */
    38 38
     Q2 =  1.5807170421e-3;		/*  0xcf3010.0p-33 */
    
    39 39
     
    
    40 40
     OLM_DLLEXPORT float
    
    41
    -expm1f(float x)
    
    41
    +openlibm_expm1f(float x)
    
    42 42
     {
    
    43 43
     	float y,hi,lo,c,t,e,hxs,hfx,r1,twopk;
    
    44 44
     	int32_t k,xsb;
    

  • src/lisp/openlibm/s_log1pf.c
    ... ... @@ -36,7 +36,7 @@ Lp7 = 1.4798198640e-01; /* 3E178897 */
    36 36
     static const float zero = 0.0;
    
    37 37
     
    
    38 38
     OLM_DLLEXPORT float
    
    39
    -log1pf(float x)
    
    39
    +openlibm_log1pf(float x)
    
    40 40
     {
    
    41 41
     	float hfsq,f,c,s,z,R,u;
    
    42 42
     	int32_t k,hx,hu,ax;
    

  • src/lisp/openlibm/s_sincosf.c
    ... ... @@ -73,7 +73,7 @@ __kernel_sincosdf( double x, float * s, float * c )
    73 73
     }
    
    74 74
     
    
    75 75
     OLM_DLLEXPORT void
    
    76
    -sincosf(float x, float * s, float * c) {
    
    76
    +openlibm_sincosf(float x, float * s, float * c) {
    
    77 77
     	// Worst approximation of sin and cos NA
    
    78 78
     	*s = x;
    
    79 79
     	*c = x;
    

  • src/lisp/openlibm/s_sinf.c
    ... ... @@ -36,7 +36,7 @@ s3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */
    36 36
     s4pio2 = 4*M_PI_2;			/* 0x401921FB, 0x54442D18 */
    
    37 37
     
    
    38 38
     OLM_DLLEXPORT float
    
    39
    -sinf(float x)
    
    39
    +openlibm_sinf(float x)
    
    40 40
     {
    
    41 41
     	double y;
    
    42 42
     	int32_t n, hx, ix;
    

  • src/lisp/openlibm/s_tanf.c
    ... ... @@ -34,7 +34,7 @@ t3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */
    34 34
     t4pio2 = 4*M_PI_2;			/* 0x401921FB, 0x54442D18 */
    
    35 35
     
    
    36 36
     OLM_DLLEXPORT float
    
    37
    -tanf(float x)
    
    37
    +openlibm_tanf(float x)
    
    38 38
     {
    
    39 39
     	double y;
    
    40 40
     	int32_t n, hx, ix;
    

  • src/lisp/openlibm/s_tanhf.c
    ... ... @@ -22,7 +22,7 @@
    22 22
     
    
    23 23
     static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30;
    
    24 24
     OLM_DLLEXPORT float
    
    25
    -tanhf(float x)
    
    25
    +openlibm_tanhf(float x)
    
    26 26
     {
    
    27 27
     	float t,z;
    
    28 28
     	int32_t jx,ix;