home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2332 < prev    next >
Internet Message Format  |  1990-12-28  |  56KB

  1. From: glenn@qed.physics.su.OZ.AU (Glenn Geers)
  2. Newsgroups: alt.sources
  3. Subject: Alternative 80386 math lib v2.0 part03/06
  4. Message-ID: <1990Dec16.210323.28153@metro.ucc.su.OZ.AU>
  5. Date: 16 Dec 90 21:03:23 GMT
  6.  
  7. Submitted-by: root@trantor
  8. Archive-name: mathlib2.0/part03
  9.  
  10. ---- Cut Here and feed the following to sh ----
  11. #!/bin/sh
  12. # this is mathlib.03 (part 3 of mathlib2.0)
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file erff.c continued
  15. #
  16. if test ! -r _shar_seq_.tmp; then
  17.     echo 'Please unpack part 1 first!'
  18.     exit 1
  19. fi
  20. (read Scheck
  21.  if test "$Scheck" != 3; then
  22.     echo Please unpack part "$Scheck" next!
  23.     exit 1
  24.  else
  25.     exit 0
  26.  fi
  27. ) < _shar_seq_.tmp || exit 1
  28. if test ! -f _shar_wnt_.tmp; then
  29.     echo 'x - still skipping erff.c'
  30. else
  31. echo 'x - continuing file erff.c'
  32. sed 's/^X//' << 'SHAR_EOF' >> 'erff.c' &&
  33. X                skip++;
  34. X            }
  35. X        }
  36. X        if (!skip) {
  37. X            ysq = ONE/(y*y);
  38. X            xnum = P[5]*ysq;
  39. X            xden = ysq;
  40. X            for (i = 0; i <= 3; i++) {
  41. X                xnum = (xnum+P[i])*ysq;
  42. X                xden = (xden+Q[i])*ysq;
  43. X            }
  44. X            result = ysq*(xnum+P[4])/(xden+Q[4]);
  45. X            result = (SQRPI-result)/y;
  46. X            if (jint != 2) {
  47. X                i = (int)(y*SIXTEN); ysq = (double)i/SIXTEN;
  48. X                result *= exp(-ysq*ysq)*exp(-(y-ysq)*(y+ysq));
  49. X            }
  50. X        }
  51. X    }
  52. X    if (jint == 0) {    /* Fix up for negative argument, erf, etc. */
  53. X        result = HALF-result; result += HALF;
  54. X        if (x < ZERO)
  55. X            result = -result;
  56. X    }
  57. X    else if (jint == 1) {
  58. X        if (x < ZERO)
  59. X            result = TWO-result;
  60. X    }
  61. X    else if (x < ZERO) {
  62. X        if (x < XNEG)
  63. X            result = XINF;
  64. X        else {
  65. X            i = (int)(x*SIXTEN); ysq = (double)i/SIXTEN;
  66. X            y = exp(ysq*ysq)*exp((x-ysq)*(x+ysq));
  67. X            result = -result; result += y+y;
  68. X        }
  69. X    }
  70. X    return result;
  71. }
  72. X
  73. /* 
  74. X *  This subprogram computes approximate values for erf(x).
  75. X *    (see comments heading calerf()).
  76. X * 
  77. X *    Author/date: W. J. Cody, January 8, 1985
  78. X */
  79. float
  80. erff(float x)
  81. {
  82. X    return ((float)calerf(x,0));
  83. }
  84. X
  85. /* 
  86. X *  This subprogram computes approximate values for erfc(x).
  87. X *    (see comments heading calerf()).
  88. X * 
  89. X *    Author/date: W. J. Cody, January 8, 1985
  90. X */
  91. float
  92. erfcf(float x)
  93. {
  94. X    return ((float)calerf(x,1));
  95. }
  96. X
  97. /* 
  98. X *  This subprogram computes approximate values for exp(x*x) * erfc(x).
  99. X *    (see comments heading calerf()).
  100. X * 
  101. X *    Author/date: W. J. Cody, March 30, 1987
  102. X */
  103. float
  104. erfcxf(float x)
  105. {
  106. X    return ((float)calerf(x,2));
  107. }
  108. SHAR_EOF
  109. echo 'File erff.c is complete' &&
  110. chmod 0644 erff.c ||
  111. echo 'restore of erff.c failed'
  112. Wc_c="`wc -c < 'erff.c'`"
  113. test 9376 -eq "$Wc_c" ||
  114.     echo 'erff.c: original size 9376, current size' "$Wc_c"
  115. rm -f _shar_wnt_.tmp
  116. fi
  117. # ============= nextafterf.c ==============
  118. if test -f 'nextafterf.c' -a X"$1" != X"-c"; then
  119.     echo 'x - skipping nextafterf.c (File already exists)'
  120.     rm -f _shar_wnt_.tmp
  121. else
  122. > _shar_wnt_.tmp
  123. echo 'x - extracting nextafterf.c (Text)'
  124. sed 's/^X//' << 'SHAR_EOF' > 'nextafterf.c' &&
  125. /*
  126. ** This file is part of the alternative 80386 math library and is
  127. ** covered by the GNU General Public license with my modification
  128. ** as noted in the README file that accompanied this file.
  129. **
  130. ** Copyright 1990 G. Geers
  131. **
  132. ** A mix of C and assembler - well I've got the functions so I might 
  133. ** as well use them!
  134. **
  135. */
  136. X
  137. #include "fpumath.h"
  138. X
  139. asm(".align 4");
  140. asm(".Lulp:");
  141. asm(".double 5.9604644775390625e-08");
  142. X
  143. asm(".align 4");
  144. asm(".Lulpup:");
  145. asm(".double 1.1920928955078125e-07");
  146. X
  147. float
  148. nextafterf(float x, float y)
  149. {
  150. X    asm("subl $8, %esp");
  151. X
  152. X    if (isnanf(x) || isnanf(y))
  153. X        return(quiet_nanf(1.0));
  154. X
  155. X    if (isinff(x))
  156. X        if (y > x)
  157. X            return(-max_normalf());
  158. X        else
  159. X        if (y < x)
  160. X            return(max_normalf());
  161. X
  162. X    if (x == 0.0) {
  163. X        if (y > 0.0)
  164. X            return(min_subnormalf());
  165. X        else
  166. X            return(-min_subnormalf());
  167. X    }
  168. X
  169. X    if (isnormalf(x)) {
  170. X        if ((x == min_normalf()) && y < x)
  171. X            return(max_subnormalf());
  172. X
  173. X        if ((x == max_normalf()) && y > x)
  174. X            return(infinityf());
  175. X
  176. X        if ((x == -max_normalf()) && y < x)
  177. X            return(-infinityf());
  178. X
  179. X        asm("movl 8(%ebp), %eax");
  180. X        asm("andl $0x7f800000, %eax");
  181. X        asm("movl %eax, -8(%ebp)");
  182. X        asm("flds -8(%ebp)");
  183. X
  184. X        if (fabsf(x) <= 2.0 && y < x) 
  185. X            asm("fldl .Lulp");
  186. X        else
  187. X            asm("fldl .Lulpup");
  188. X
  189. X        asm("fmulp");
  190. X
  191. X        if (y > x) {
  192. X            asm("flds 8(%ebp)");
  193. X            asm("faddp");
  194. X            asm("leave");
  195. X            asm("ret");
  196. X        }
  197. X        if (y < x) {
  198. X            asm("flds 8(%ebp)");
  199. X            asm("fsubp");
  200. X            asm("leave");
  201. X            asm("ret");
  202. X        }
  203. X    }
  204. X    else
  205. X    if (issubnormalf(x)) {
  206. X        if ((x == max_subnormalf()) && y > x)
  207. X            return(min_normalf());
  208. X
  209. X        if ((x == -max_subnormalf()) && y < x)
  210. X            return(-min_normalf());
  211. X
  212. X        if (y > x) 
  213. X            return(x + min_subnormalf());
  214. X
  215. X        if (y < x)
  216. X            return(x - min_subnormalf());
  217. X    }
  218. X    
  219. X    return(x);
  220. }
  221. SHAR_EOF
  222. chmod 0644 nextafterf.c ||
  223. echo 'restore of nextafterf.c failed'
  224. Wc_c="`wc -c < 'nextafterf.c'`"
  225. test 1717 -eq "$Wc_c" ||
  226.     echo 'nextafterf.c: original size 1717, current size' "$Wc_c"
  227. rm -f _shar_wnt_.tmp
  228. fi
  229. # ============= acos.s ==============
  230. if test -f 'acos.s' -a X"$1" != X"-c"; then
  231.     echo 'x - skipping acos.s (File already exists)'
  232.     rm -f _shar_wnt_.tmp
  233. else
  234. > _shar_wnt_.tmp
  235. echo 'x - extracting acos.s (Text)'
  236. sed 's/^X//' << 'SHAR_EOF' > 'acos.s' &&
  237. /*
  238. ** This file is part of the alternative 80386 math library and is
  239. ** covered by the GNU General Public license with my modification
  240. ** as noted in the README file that accompanied this file.
  241. **
  242. ** Copyright 1990 G. Geers
  243. **
  244. */
  245. X
  246. X    .align 4
  247. .Lhalfpi:
  248. X    .double 1.57079632679489661923
  249. X
  250. X    .align 4
  251. X    .globl acos
  252. acos:
  253. X    pushl %ebp
  254. X    movl %esp,%ebp
  255. X
  256. X    fldl 8(%ebp)
  257. X
  258. X    ftst
  259. X    fstsw %ax
  260. X    sahf
  261. X    jz .Lzero
  262. X
  263. X    fst %st(1)
  264. X    fmull 8(%ebp)
  265. X    fld1
  266. X    fsubp
  267. X    fsqrt
  268. X    fdivp
  269. X    fld1
  270. X    fpatan
  271. X    jnc .Ldone
  272. X
  273. X    fldpi
  274. X    faddp
  275. X    leave
  276. X    ret
  277. X
  278. .Lzero:
  279. X    fldl .Lhalfpi
  280. X
  281. .Ldone:
  282. X    leave
  283. X    ret
  284. SHAR_EOF
  285. chmod 0644 acos.s ||
  286. echo 'restore of acos.s failed'
  287. Wc_c="`wc -c < 'acos.s'`"
  288. test 544 -eq "$Wc_c" ||
  289.     echo 'acos.s: original size 544, current size' "$Wc_c"
  290. rm -f _shar_wnt_.tmp
  291. fi
  292. # ============= copysign.s ==============
  293. if test -f 'copysign.s' -a X"$1" != X"-c"; then
  294.     echo 'x - skipping copysign.s (File already exists)'
  295.     rm -f _shar_wnt_.tmp
  296. else
  297. > _shar_wnt_.tmp
  298. echo 'x - extracting copysign.s (Text)'
  299. sed 's/^X//' << 'SHAR_EOF' > 'copysign.s' &&
  300. /*
  301. ** This file is part of the alternative 80386 math library and is
  302. ** covered by the GNU General Public license with my modification
  303. ** as noted in the README file that accompanied this file.
  304. **
  305. ** Copyright 1990 G. Geers
  306. **
  307. */
  308. X
  309. X    .align 4
  310. .globl copysign
  311. copysign:
  312. X    pushl %ebp
  313. X    movl %esp,%ebp
  314. X
  315. X    movl 20(%ebp), %eax
  316. X    andl $0x80000000, %eax
  317. X    cmpl $0x80000000, %eax
  318. X    je .Lneg
  319. X    andl $0x7fffffff, 12(%ebp)
  320. X    fldl 8(%ebp)        /* Store argument for return */
  321. X    leave
  322. X    ret
  323. .Lneg:
  324. X    orl $0x80000000, 12(%ebp)
  325. X    fldl 8(%ebp)        /* Store argument for return */
  326. X    leave
  327. X    ret
  328. SHAR_EOF
  329. chmod 0644 copysign.s ||
  330. echo 'restore of copysign.s failed'
  331. Wc_c="`wc -c < 'copysign.s'`"
  332. test 555 -eq "$Wc_c" ||
  333.     echo 'copysign.s: original size 555, current size' "$Wc_c"
  334. rm -f _shar_wnt_.tmp
  335. fi
  336. # ============= drem.s ==============
  337. if test -f 'drem.s' -a X"$1" != X"-c"; then
  338.     echo 'x - skipping drem.s (File already exists)'
  339.     rm -f _shar_wnt_.tmp
  340. else
  341. > _shar_wnt_.tmp
  342. echo 'x - extracting drem.s (Text)'
  343. sed 's/^X//' << 'SHAR_EOF' > 'drem.s' &&
  344. /*
  345. ** This file is part of the alternative 80386 math library and is
  346. ** covered by the GNU General Public license with my modification
  347. ** as noted in the README file that accompanied this file.
  348. **
  349. ** Copyright 1990 G. Geers
  350. **
  351. */
  352. X
  353. X    .align 4
  354. X    .globl drem
  355. drem:
  356. X    pushl %ebp
  357. X    movl %esp,%ebp
  358. X    
  359. X    fldl 16(%ebp)
  360. X    fldl 8(%ebp)
  361. .Lnotred:
  362. X    fprem1
  363. X
  364. X    fstsw %ax
  365. X    sahf
  366. X    jp .Lnotred
  367. X
  368. X    leave
  369. X    ret
  370. SHAR_EOF
  371. chmod 0644 drem.s ||
  372. echo 'restore of drem.s failed'
  373. Wc_c="`wc -c < 'drem.s'`"
  374. test 381 -eq "$Wc_c" ||
  375.     echo 'drem.s: original size 381, current size' "$Wc_c"
  376. rm -f _shar_wnt_.tmp
  377. fi
  378. # ============= fabs.s ==============
  379. if test -f 'fabs.s' -a X"$1" != X"-c"; then
  380.     echo 'x - skipping fabs.s (File already exists)'
  381.     rm -f _shar_wnt_.tmp
  382. else
  383. > _shar_wnt_.tmp
  384. echo 'x - extracting fabs.s (Text)'
  385. sed 's/^X//' << 'SHAR_EOF' > 'fabs.s' &&
  386. /*
  387. ** This file is part of the alternative 80386 math library and is
  388. ** covered by the GNU General Public license with my modification
  389. ** as noted in the README file that accompanied this file.
  390. **
  391. ** Copyright 1990 G. Geers
  392. **
  393. */
  394. X
  395. X    .align 4
  396. X    .globl fabs
  397. fabs:
  398. X    pushl %ebp
  399. X    movl %esp,%ebp
  400. X
  401. X    fldl 8(%ebp)
  402. X    fabs
  403. X
  404. X    leave
  405. X    ret
  406. SHAR_EOF
  407. chmod 0644 fabs.s ||
  408. echo 'restore of fabs.s failed'
  409. Wc_c="`wc -c < 'fabs.s'`"
  410. test 322 -eq "$Wc_c" ||
  411.     echo 'fabs.s: original size 322, current size' "$Wc_c"
  412. rm -f _shar_wnt_.tmp
  413. fi
  414. # ============= hypot.s ==============
  415. if test -f 'hypot.s' -a X"$1" != X"-c"; then
  416.     echo 'x - skipping hypot.s (File already exists)'
  417.     rm -f _shar_wnt_.tmp
  418. else
  419. > _shar_wnt_.tmp
  420. echo 'x - extracting hypot.s (Text)'
  421. sed 's/^X//' << 'SHAR_EOF' > 'hypot.s' &&
  422. /*
  423. ** This file is part of the alternative 80386 math library and is
  424. ** covered by the GNU General Public license with my modification
  425. ** as noted in the README file that accompanied this file.
  426. **
  427. ** Copyright 1990 G. Geers
  428. **
  429. */
  430. X
  431. X    .align 4
  432. .globl hypot
  433. hypot:
  434. X    pushl %ebp
  435. X    movl %esp,%ebp
  436. X
  437. X    fldl 8(%ebp)
  438. X    fmull 8(%ebp)
  439. X    fldl 16(%ebp)
  440. X    fmull 16(%ebp)
  441. X    faddp
  442. X    fsqrt
  443. X
  444. X    leave
  445. X    ret
  446. SHAR_EOF
  447. chmod 0644 hypot.s ||
  448. echo 'restore of hypot.s failed'
  449. Wc_c="`wc -c < 'hypot.s'`"
  450. test 377 -eq "$Wc_c" ||
  451.     echo 'hypot.s: original size 377, current size' "$Wc_c"
  452. rm -f _shar_wnt_.tmp
  453. fi
  454. # ============= logb.s ==============
  455. if test -f 'logb.s' -a X"$1" != X"-c"; then
  456.     echo 'x - skipping logb.s (File already exists)'
  457.     rm -f _shar_wnt_.tmp
  458. else
  459. > _shar_wnt_.tmp
  460. echo 'x - extracting logb.s (Text)'
  461. sed 's/^X//' << 'SHAR_EOF' > 'logb.s' &&
  462. /*
  463. ** This file is part of the alternative 80386 math library and is
  464. ** covered by the GNU General Public license with my modification
  465. ** as noted in the README file that accompanied this file.
  466. **
  467. ** Copyright 1990 G. Geers
  468. **
  469. */
  470. X
  471. X    .align 4
  472. X    .globl logb
  473. logb:
  474. X    pushl %ebp
  475. X    movl %esp,%ebp
  476. X    
  477. X    fldl 8(%ebp)
  478. X    fxtract
  479. X    fldl %st(1)
  480. X
  481. X    leave
  482. X    ret
  483. SHAR_EOF
  484. chmod 0644 logb.s ||
  485. echo 'restore of logb.s failed'
  486. Wc_c="`wc -c < 'logb.s'`"
  487. test 339 -eq "$Wc_c" ||
  488.     echo 'logb.s: original size 339, current size' "$Wc_c"
  489. rm -f _shar_wnt_.tmp
  490. fi
  491. # ============= scalb.s ==============
  492. if test -f 'scalb.s' -a X"$1" != X"-c"; then
  493.     echo 'x - skipping scalb.s (File already exists)'
  494.     rm -f _shar_wnt_.tmp
  495. else
  496. > _shar_wnt_.tmp
  497. echo 'x - extracting scalb.s (Text)'
  498. sed 's/^X//' << 'SHAR_EOF' > 'scalb.s' &&
  499. /*
  500. ** This file is part of the alternative 80386 math library and is
  501. ** covered by the GNU General Public license with my modification
  502. ** as noted in the README file that accompanied this file.
  503. **
  504. ** Copyright 1990 G. Geers
  505. **
  506. */
  507. X
  508. X    .align 4
  509. X    .globl scalb
  510. scalb:
  511. X    pushl %ebp
  512. X    movl %esp,%ebp
  513. X    
  514. X    fildl 16(%ebp)
  515. X    fldl 8(%ebp)
  516. X    fscale
  517. X
  518. X    leave
  519. X    ret
  520. SHAR_EOF
  521. chmod 0644 scalb.s ||
  522. echo 'restore of scalb.s failed'
  523. Wc_c="`wc -c < 'scalb.s'`"
  524. test 343 -eq "$Wc_c" ||
  525.     echo 'scalb.s: original size 343, current size' "$Wc_c"
  526. rm -f _shar_wnt_.tmp
  527. fi
  528. # ============= tan.s ==============
  529. if test -f 'tan.s' -a X"$1" != X"-c"; then
  530.     echo 'x - skipping tan.s (File already exists)'
  531.     rm -f _shar_wnt_.tmp
  532. else
  533. > _shar_wnt_.tmp
  534. echo 'x - extracting tan.s (Text)'
  535. sed 's/^X//' << 'SHAR_EOF' > 'tan.s' &&
  536. /*
  537. ** This file is part of the alternative 80386 math library and is
  538. ** covered by the GNU General Public license with my modification
  539. ** as noted in the README file that accompanied this file.
  540. **
  541. ** Copyright 1990 G. Geers
  542. **
  543. */
  544. X
  545. X    .align 4
  546. X    .globl tan
  547. tan:
  548. X    pushl %ebp
  549. X    movl %esp,%ebp
  550. X
  551. X    fldl 8(%ebp)
  552. X    fptan
  553. X    fstp %st(0)
  554. X
  555. X    leave
  556. X    ret
  557. SHAR_EOF
  558. chmod 0644 tan.s ||
  559. echo 'restore of tan.s failed'
  560. Wc_c="`wc -c < 'tan.s'`"
  561. test 334 -eq "$Wc_c" ||
  562.     echo 'tan.s: original size 334, current size' "$Wc_c"
  563. rm -f _shar_wnt_.tmp
  564. fi
  565. # ============= asin.s ==============
  566. if test -f 'asin.s' -a X"$1" != X"-c"; then
  567.     echo 'x - skipping asin.s (File already exists)'
  568.     rm -f _shar_wnt_.tmp
  569. else
  570. > _shar_wnt_.tmp
  571. echo 'x - extracting asin.s (Text)'
  572. sed 's/^X//' << 'SHAR_EOF' > 'asin.s' &&
  573. /*
  574. ** This file is part of the alternative 80386 math library and is
  575. ** covered by the GNU General Public license with my modification
  576. ** as noted in the README file that accompanied this file.
  577. **
  578. ** Copyright 1990 G. Geers
  579. **
  580. */
  581. X
  582. X    .align 4
  583. X    .globl asin
  584. asin:
  585. X    pushl %ebp
  586. X    movl %esp,%ebp
  587. X
  588. X    fldl 8(%ebp)
  589. X    fst %st(1)
  590. X    fst %st(2)
  591. X    fmulp
  592. X    fld1
  593. X    fsubp
  594. X    fsqrt
  595. X    fld1
  596. X    fdivp
  597. X    fmulp
  598. X    fld1
  599. X    fpatan
  600. X
  601. X    leave
  602. X    ret
  603. SHAR_EOF
  604. chmod 0644 asin.s ||
  605. echo 'restore of asin.s failed'
  606. Wc_c="`wc -c < 'asin.s'`"
  607. test 401 -eq "$Wc_c" ||
  608.     echo 'asin.s: original size 401, current size' "$Wc_c"
  609. rm -f _shar_wnt_.tmp
  610. fi
  611. # ============= ceil.s ==============
  612. if test -f 'ceil.s' -a X"$1" != X"-c"; then
  613.     echo 'x - skipping ceil.s (File already exists)'
  614.     rm -f _shar_wnt_.tmp
  615. else
  616. > _shar_wnt_.tmp
  617. echo 'x - extracting ceil.s (Text)'
  618. sed 's/^X//' << 'SHAR_EOF' > 'ceil.s' &&
  619. /*
  620. ** This file is part of the alternative 80386 math library and is
  621. ** covered by the GNU General Public license with my modification
  622. ** as noted in the README file that accompanied this file.
  623. **
  624. ** Could use ceil(x) = -floor(-x) but this is quicker.
  625. **
  626. ** Copyright 1990 G. Geers
  627. **
  628. */
  629. X
  630. X    .align 4
  631. X    .globl ceil
  632. ceil:
  633. X    pushl %ebp
  634. X    movl %esp,%ebp
  635. X    subl $8, %esp
  636. X    
  637. X    fldl 8(%ebp)        /* load data */
  638. X
  639. X    fstcw -12(%ebp)        /* store control word */
  640. X    fstcw -16(%ebp)        /* store it again */
  641. X    orw $0x0800, -16(%ebp)    /* round toward +inf */
  642. X    fldcw -16(%ebp)        /* store new control word */
  643. X    frndint            /* rounding gives ceil(x) */
  644. X    fldcw -12(%ebp)        /* restore original control word */
  645. X
  646. X    leave
  647. X    ret
  648. SHAR_EOF
  649. chmod 0644 ceil.s ||
  650. echo 'restore of ceil.s failed'
  651. Wc_c="`wc -c < 'ceil.s'`"
  652. test 682 -eq "$Wc_c" ||
  653.     echo 'ceil.s: original size 682, current size' "$Wc_c"
  654. rm -f _shar_wnt_.tmp
  655. fi
  656. # ============= exp.s ==============
  657. if test -f 'exp.s' -a X"$1" != X"-c"; then
  658.     echo 'x - skipping exp.s (File already exists)'
  659.     rm -f _shar_wnt_.tmp
  660. else
  661. > _shar_wnt_.tmp
  662. echo 'x - extracting exp.s (Text)'
  663. sed 's/^X//' << 'SHAR_EOF' > 'exp.s' &&
  664. /*
  665. ** This file is part of the alternative 80386 math library and is
  666. ** covered by the GNU General Public license with my modification
  667. ** as noted in the README file that accompanied this file.
  668. **
  669. ** Copyright 1990 G. Geers
  670. **
  671. */
  672. X
  673. X    .align 4
  674. X    .globl exp
  675. exp:
  676. X    pushl %ebp
  677. X    movl %esp,%ebp
  678. X
  679. X    fldl 8(%ebp)
  680. X    fldl2e
  681. X    fmulp
  682. X    fstl %st(1)
  683. X    frndint
  684. X    fstl %st(2)
  685. X    fsubrp
  686. X    f2xm1
  687. X    fld1
  688. X    faddp
  689. X    fscale
  690. X
  691. X    leave
  692. X    ret
  693. SHAR_EOF
  694. chmod 0644 exp.s ||
  695. echo 'restore of exp.s failed'
  696. Wc_c="`wc -c < 'exp.s'`"
  697. test 400 -eq "$Wc_c" ||
  698.     echo 'exp.s: original size 400, current size' "$Wc_c"
  699. rm -f _shar_wnt_.tmp
  700. fi
  701. # ============= expm1.s ==============
  702. if test -f 'expm1.s' -a X"$1" != X"-c"; then
  703.     echo 'x - skipping expm1.s (File already exists)'
  704.     rm -f _shar_wnt_.tmp
  705. else
  706. > _shar_wnt_.tmp
  707. echo 'x - extracting expm1.s (Text)'
  708. sed 's/^X//' << 'SHAR_EOF' > 'expm1.s' &&
  709. /*
  710. ** This file is part of the alternative 80386 math library and is
  711. ** covered by the GNU General Public license with my modification
  712. ** as noted in the README file that accompanied this file.
  713. **
  714. ** Copyright 1990 G. Geers
  715. **
  716. */
  717. X
  718. X    .align 4
  719. X    .globl expm1
  720. expm1:
  721. X    pushl %ebp
  722. X    movl %esp,%ebp
  723. X    subl $8, %esp
  724. X
  725. X    fldl 8(%ebp)
  726. X    fldl2e
  727. X    fmulp
  728. X    fstl %st(1)
  729. X    frndint
  730. X    fstl %st(2)
  731. X    fsubrp
  732. X    f2xm1
  733. X    fld1
  734. X    faddp
  735. X    fscale
  736. X
  737. X    fstpl -8(%ebp)
  738. X
  739. X    fldl 8(%ebp)
  740. X    fchs
  741. X    fldl2e
  742. X    fmulp
  743. X    fstl %st(1)
  744. X    frndint
  745. X    fstl %st(2)
  746. X    fsubrp
  747. X    f2xm1
  748. X    fld1
  749. X    faddp
  750. X    fscale
  751. X
  752. X    fld1
  753. X    fsubp
  754. X    fmull -8(%ebp)
  755. X
  756. X    leave
  757. X    ret
  758. SHAR_EOF
  759. chmod 0644 expm1.s ||
  760. echo 'restore of expm1.s failed'
  761. Wc_c="`wc -c < 'expm1.s'`"
  762. test 573 -eq "$Wc_c" ||
  763.     echo 'expm1.s: original size 573, current size' "$Wc_c"
  764. rm -f _shar_wnt_.tmp
  765. fi
  766. # ============= finite.s ==============
  767. if test -f 'finite.s' -a X"$1" != X"-c"; then
  768.     echo 'x - skipping finite.s (File already exists)'
  769.     rm -f _shar_wnt_.tmp
  770. else
  771. > _shar_wnt_.tmp
  772. echo 'x - extracting finite.s (Text)'
  773. sed 's/^X//' << 'SHAR_EOF' > 'finite.s' &&
  774. /*
  775. ** This file is part of the alternative 80386 math library and is
  776. ** covered by the GNU General Public license with my modification
  777. ** as noted in the README file that accompanied this file.
  778. **
  779. ** Copyright 1990 G. Geers
  780. **
  781. */
  782. X
  783. X    .align 4
  784. X    .globl finite
  785. finite:
  786. X    pushl %ebp
  787. X    movl %esp,%ebp
  788. X
  789. X    movl 12(%ebp), %eax
  790. X    andl $0x7ff00000, %eax
  791. X    cmpl $0x7ff00000, %eax
  792. X    je    .Lnotfinite
  793. X
  794. X    movl $1, %eax
  795. X    leave
  796. X    ret
  797. X
  798. .Lnotfinite:
  799. X    movl $0, %eax
  800. X    leave
  801. X    ret
  802. SHAR_EOF
  803. chmod 0644 finite.s ||
  804. echo 'restore of finite.s failed'
  805. Wc_c="`wc -c < 'finite.s'`"
  806. test 447 -eq "$Wc_c" ||
  807.     echo 'finite.s: original size 447, current size' "$Wc_c"
  808. rm -f _shar_wnt_.tmp
  809. fi
  810. # ============= log.s ==============
  811. if test -f 'log.s' -a X"$1" != X"-c"; then
  812.     echo 'x - skipping log.s (File already exists)'
  813.     rm -f _shar_wnt_.tmp
  814. else
  815. > _shar_wnt_.tmp
  816. echo 'x - extracting log.s (Text)'
  817. sed 's/^X//' << 'SHAR_EOF' > 'log.s' &&
  818. /*
  819. ** This file is part of the alternative 80386 math library and is
  820. ** covered by the GNU General Public license with my modification
  821. ** as noted in the README file that accompanied this file.
  822. **
  823. ** Copyright 1990 G. Geers
  824. **
  825. */
  826. X
  827. X    .align 4
  828. X    .globl log
  829. log:
  830. X    pushl %ebp
  831. X    movl %esp,%ebp
  832. X
  833. X    fldln2
  834. X    fldl 8(%ebp)
  835. X    fyl2x
  836. X
  837. X    leave
  838. X    ret
  839. SHAR_EOF
  840. chmod 0644 log.s ||
  841. echo 'restore of log.s failed'
  842. Wc_c="`wc -c < 'log.s'`"
  843. test 329 -eq "$Wc_c" ||
  844.     echo 'log.s: original size 329, current size' "$Wc_c"
  845. rm -f _shar_wnt_.tmp
  846. fi
  847. # ============= log1p.s ==============
  848. if test -f 'log1p.s' -a X"$1" != X"-c"; then
  849.     echo 'x - skipping log1p.s (File already exists)'
  850.     rm -f _shar_wnt_.tmp
  851. else
  852. > _shar_wnt_.tmp
  853. echo 'x - extracting log1p.s (Text)'
  854. sed 's/^X//' << 'SHAR_EOF' > 'log1p.s' &&
  855. /*
  856. ** This file is part of the alternative 80386 math library and is
  857. ** covered by the GNU General Public license with my modification
  858. ** as noted in the README file that accompanied this file.
  859. **
  860. ** Copyright 1990 G. Geers
  861. **
  862. */
  863. X
  864. X    .align 4
  865. X    .globl log1p
  866. log1p:
  867. X    pushl %ebp
  868. X    movl %esp,%ebp
  869. X
  870. X    fldln2
  871. X    fldl 8(%ebp)
  872. X    fld1
  873. X    faddp
  874. X    fyl2x
  875. X
  876. X    leave
  877. X    ret
  878. SHAR_EOF
  879. chmod 0644 log1p.s ||
  880. echo 'restore of log1p.s failed'
  881. Wc_c="`wc -c < 'log1p.s'`"
  882. test 346 -eq "$Wc_c" ||
  883.     echo 'log1p.s: original size 346, current size' "$Wc_c"
  884. rm -f _shar_wnt_.tmp
  885. fi
  886. # ============= pow.s ==============
  887. if test -f 'pow.s' -a X"$1" != X"-c"; then
  888.     echo 'x - skipping pow.s (File already exists)'
  889.     rm -f _shar_wnt_.tmp
  890. else
  891. > _shar_wnt_.tmp
  892. echo 'x - extracting pow.s (Text)'
  893. sed 's/^X//' << 'SHAR_EOF' > 'pow.s' &&
  894. /*
  895. ** This file is part of the alternative 80386 math library and is
  896. ** covered by the GNU General Public license with my modification
  897. ** as noted in the README file that accompanied this file.
  898. **
  899. ** This file started life as a C implemenation of pow, it then evolved
  900. ** into an embeded asm version (with some C) and finally, all assembler.
  901. ** It's actually hacked assembler produced by gcc.
  902. **
  903. ** Copyright 1990 G. Geers
  904. **
  905. */
  906. X
  907. .text
  908. .LC0:
  909. X    .ascii "pow: DOMAIN error\12\0"
  910. X    .align 4
  911. .LC1:
  912. X    .double 0d0.00000000000000000000e+00
  913. X    .align 4
  914. .LC2:
  915. X    .double 0d1.00000000000000000000e+00
  916. X    .align 4
  917. .globl pow
  918. pow:
  919. X    pushl %ebp
  920. X    movl %esp,%ebp
  921. X    subl $28,%esp
  922. X    pushl %edi
  923. X    pushl %esi
  924. X    pushl %ebx
  925. X    movl 16(%ebp),%esi
  926. X    movl 20(%ebp),%edi
  927. X    movl $0,-4(%ebp)
  928. X    movl $1,%ebx
  929. X    fldl 8(%ebp)
  930. X    ftst
  931. X    fstp %st(0)
  932. X    fnstsw %ax
  933. X    sahf
  934. X    jae .L2
  935. X    movl %ebx,-4(%ebp)
  936. X    pushl %edi
  937. X    pushl %esi
  938. /**/
  939. X    fldl 16(%ebp)
  940. X
  941. X    fstcw -8(%ebp)
  942. X    fstcw -12(%ebp)
  943. X    orw $0x0400, -12(%ebp)
  944. X    fldcw -12(%ebp)
  945. X
  946. X    frndint
  947. X    fldcw -8(%ebp)
  948. /**/
  949. X    fstpl -16(%ebp)
  950. X    pushl %edi
  951. X    pushl %esi
  952. X    fldl (%esp) 
  953. X    addl $8,%esp
  954. X    fsubl -16(%ebp)
  955. X    fstpl -16(%ebp)
  956. X    addl $8,%esp
  957. X    fldl -16(%ebp)
  958. X    ftst
  959. X    fstp %st(0)
  960. X    fnstsw %ax
  961. X    sahf
  962. X    je .L3
  963. X    movl $33,errno
  964. X    pushl $.LC0
  965. X    pushl $_iob+32
  966. X    call fprintf
  967. X    fldl .LC1
  968. X    jmp .L1
  969. X    .align 4
  970. .L3:
  971. X    pushl %edi
  972. X    pushl %esi
  973. /**/
  974. X    fldl    16(%ebp)
  975. X    fistpl    -8(%ebp)
  976. X    movl    -8(%ebp),%eax
  977. /**/
  978. X    testl %eax,%eax
  979. X    jge .L5
  980. X    incl %eax
  981. .L5:
  982. X    andl $-2,%eax
  983. X    movl -8(%ebp),%ecx
  984. X    subl %eax,%ecx
  985. X    movl %ecx,%eax
  986. X    testl %eax,%eax
  987. X    je .L2
  988. X    xorl %ebx,%ebx
  989. .L2:
  990. X    fldl 8(%ebp)
  991. X    ftst
  992. X    fstp %st(0)
  993. X    fnstsw %ax
  994. X    sahf
  995. X    jne .L6
  996. X    pushl %edi
  997. X    pushl %esi
  998. X    fldl (%esp) 
  999. X    addl $8,%esp
  1000. X    ftst
  1001. X    fstp %st(0)
  1002. X    fnstsw %ax
  1003. X    sahf
  1004. X    je .L6
  1005. X    fldl .LC1
  1006. X    jmp .L1
  1007. X    .align 4
  1008. .L6:
  1009. X    pushl %edi
  1010. X    pushl %esi
  1011. X    fldl (%esp) 
  1012. X    addl $8,%esp
  1013. X    ftst
  1014. X    fstp %st(0)
  1015. X    fnstsw %ax
  1016. X    sahf
  1017. X    jne .L8
  1018. X    fldl .LC2
  1019. X    jmp .L1
  1020. X    .align 4
  1021. .L8:
  1022. /APP
  1023. X    fldl 16(%ebp)
  1024. X    fldl 8(%ebp)
  1025. /NO_APP
  1026. X    cmpl $0,-4(%ebp)
  1027. X    je .L10
  1028. /APP
  1029. X    fchs
  1030. /NO_APP
  1031. .L10:
  1032. /APP
  1033. X    fyl2x
  1034. X    fstl %st(1)
  1035. X    frndint
  1036. X    fstl %st(2)
  1037. X    fsubrp
  1038. X    f2xm1
  1039. X    fld1
  1040. X    faddp
  1041. X    fscale
  1042. /NO_APP
  1043. X    testl %ebx,%ebx
  1044. X    jne .L1
  1045. /APP
  1046. X    fchs
  1047. /NO_APP
  1048. .L1:
  1049. X    leal -28(%ebp),%esp
  1050. X    popl %ebx
  1051. X    popl %esi
  1052. X    popl %edi
  1053. X    leave
  1054. X    ret
  1055. SHAR_EOF
  1056. chmod 0644 pow.s ||
  1057. echo 'restore of pow.s failed'
  1058. Wc_c="`wc -c < 'pow.s'`"
  1059. test 2128 -eq "$Wc_c" ||
  1060.     echo 'pow.s: original size 2128, current size' "$Wc_c"
  1061. rm -f _shar_wnt_.tmp
  1062. fi
  1063. # ============= sin.s ==============
  1064. if test -f 'sin.s' -a X"$1" != X"-c"; then
  1065.     echo 'x - skipping sin.s (File already exists)'
  1066.     rm -f _shar_wnt_.tmp
  1067. else
  1068. > _shar_wnt_.tmp
  1069. echo 'x - extracting sin.s (Text)'
  1070. sed 's/^X//' << 'SHAR_EOF' > 'sin.s' &&
  1071. /*
  1072. ** This file is part of the alternative 80386 math library and is
  1073. ** covered by the GNU General Public license with my modification
  1074. ** as noted in the README file that accompanied this file.
  1075. **
  1076. ** Copyright 1990 G. Geers
  1077. **
  1078. */
  1079. X
  1080. X    .align 4
  1081. X    .globl sin
  1082. sin:
  1083. X    pushl %ebp
  1084. X    movl %esp,%ebp
  1085. X
  1086. X    fldl 8(%ebp)
  1087. X    fsin
  1088. X
  1089. X    leave
  1090. X    ret
  1091. SHAR_EOF
  1092. chmod 0644 sin.s ||
  1093. echo 'restore of sin.s failed'
  1094. Wc_c="`wc -c < 'sin.s'`"
  1095. test 320 -eq "$Wc_c" ||
  1096.     echo 'sin.s: original size 320, current size' "$Wc_c"
  1097. rm -f _shar_wnt_.tmp
  1098. fi
  1099. # ============= atan.s ==============
  1100. if test -f 'atan.s' -a X"$1" != X"-c"; then
  1101.     echo 'x - skipping atan.s (File already exists)'
  1102.     rm -f _shar_wnt_.tmp
  1103. else
  1104. > _shar_wnt_.tmp
  1105. echo 'x - extracting atan.s (Text)'
  1106. sed 's/^X//' << 'SHAR_EOF' > 'atan.s' &&
  1107. /*
  1108. ** This file is part of the alternative 80386 math library and is
  1109. ** covered by the GNU General Public license with my modification
  1110. ** as noted in the README file that accompanied this file.
  1111. **
  1112. ** Copyright 1990 G. Geers
  1113. **
  1114. */
  1115. X
  1116. X    .align 4
  1117. X    .globl atan
  1118. atan:
  1119. X    pushl %ebp
  1120. X    movl %esp,%ebp
  1121. X    
  1122. X    fldl 8(%ebp)
  1123. X    fld1
  1124. X    fpatan
  1125. X
  1126. X    leave
  1127. X    ret
  1128. SHAR_EOF
  1129. chmod 0644 atan.s ||
  1130. echo 'restore of atan.s failed'
  1131. Wc_c="`wc -c < 'atan.s'`"
  1132. test 331 -eq "$Wc_c" ||
  1133.     echo 'atan.s: original size 331, current size' "$Wc_c"
  1134. rm -f _shar_wnt_.tmp
  1135. fi
  1136. # ============= cos.s ==============
  1137. if test -f 'cos.s' -a X"$1" != X"-c"; then
  1138.     echo 'x - skipping cos.s (File already exists)'
  1139.     rm -f _shar_wnt_.tmp
  1140. else
  1141. > _shar_wnt_.tmp
  1142. echo 'x - extracting cos.s (Text)'
  1143. sed 's/^X//' << 'SHAR_EOF' > 'cos.s' &&
  1144. /*
  1145. ** This file is part of the alternative 80386 math library and is
  1146. ** covered by the GNU General Public license with my modification
  1147. ** as noted in the README file that accompanied this file.
  1148. **
  1149. ** Copyright 1990 G. Geers
  1150. **
  1151. */
  1152. X
  1153. X    .align 4
  1154. X    .globl cos
  1155. cos:
  1156. X    pushl %ebp
  1157. X    movl %esp,%ebp
  1158. X
  1159. X    fldl 8(%ebp)
  1160. X    fcos
  1161. X
  1162. X    leave
  1163. X    ret
  1164. SHAR_EOF
  1165. chmod 0644 cos.s ||
  1166. echo 'restore of cos.s failed'
  1167. Wc_c="`wc -c < 'cos.s'`"
  1168. test 320 -eq "$Wc_c" ||
  1169.     echo 'cos.s: original size 320, current size' "$Wc_c"
  1170. rm -f _shar_wnt_.tmp
  1171. fi
  1172. # ============= exp10.s ==============
  1173. if test -f 'exp10.s' -a X"$1" != X"-c"; then
  1174.     echo 'x - skipping exp10.s (File already exists)'
  1175.     rm -f _shar_wnt_.tmp
  1176. else
  1177. > _shar_wnt_.tmp
  1178. echo 'x - extracting exp10.s (Text)'
  1179. sed 's/^X//' << 'SHAR_EOF' > 'exp10.s' &&
  1180. /*
  1181. ** This file is part of the alternative 80386 math library and is
  1182. ** covered by the GNU General Public license with my modification
  1183. ** as noted in the README file that accompanied this file.
  1184. **
  1185. ** Copyright 1990 G. Geers
  1186. **
  1187. */
  1188. X
  1189. X    .align 4
  1190. X    .globl exp10
  1191. exp10:
  1192. X    pushl %ebp
  1193. X    movl %esp,%ebp
  1194. X
  1195. X    fldl 8(%ebp)
  1196. X    fldl2t
  1197. X    fmulp
  1198. X    fstl %st(1)
  1199. X    frndint
  1200. X    fstl %st(2)
  1201. X    fsubrp
  1202. X    f2xm1
  1203. X    fld1
  1204. X    faddp
  1205. X    fscale
  1206. X
  1207. X    leave
  1208. X    ret
  1209. SHAR_EOF
  1210. chmod 0644 exp10.s ||
  1211. echo 'restore of exp10.s failed'
  1212. Wc_c="`wc -c < 'exp10.s'`"
  1213. test 404 -eq "$Wc_c" ||
  1214.     echo 'exp10.s: original size 404, current size' "$Wc_c"
  1215. rm -f _shar_wnt_.tmp
  1216. fi
  1217. # ============= floor.s ==============
  1218. if test -f 'floor.s' -a X"$1" != X"-c"; then
  1219.     echo 'x - skipping floor.s (File already exists)'
  1220.     rm -f _shar_wnt_.tmp
  1221. else
  1222. > _shar_wnt_.tmp
  1223. echo 'x - extracting floor.s (Text)'
  1224. sed 's/^X//' << 'SHAR_EOF' > 'floor.s' &&
  1225. /*
  1226. ** This file is part of the alternative 80386 math library and is
  1227. ** covered by the GNU General Public license with my modification
  1228. ** as noted in the README file that accompanied this file.
  1229. **
  1230. ** Copyright 1990 G. Geers
  1231. **
  1232. */
  1233. X
  1234. X    .align 4
  1235. X    .globl floor
  1236. floor:
  1237. X    pushl %ebp
  1238. X    movl %esp,%ebp
  1239. X    subl $8, %esp
  1240. X    
  1241. X    fldl 8(%ebp)        /* load data */
  1242. X
  1243. X    fstcw -12(%ebp)        /* store control word */
  1244. X    fstcw -16(%ebp)        /* store it again */
  1245. X    orw $0x0400, -16(%ebp)    /* round toward -inf */
  1246. X    fldcw -16(%ebp)        /* store new control word */
  1247. X
  1248. X    frndint            /* rounding gives floor(x) */
  1249. X    fldcw -12(%ebp)        /* restore original control word */
  1250. X
  1251. X    leave
  1252. X    ret
  1253. SHAR_EOF
  1254. chmod 0644 floor.s ||
  1255. echo 'restore of floor.s failed'
  1256. Wc_c="`wc -c < 'floor.s'`"
  1257. test 628 -eq "$Wc_c" ||
  1258.     echo 'floor.s: original size 628, current size' "$Wc_c"
  1259. rm -f _shar_wnt_.tmp
  1260. fi
  1261. # ============= log10.s ==============
  1262. if test -f 'log10.s' -a X"$1" != X"-c"; then
  1263.     echo 'x - skipping log10.s (File already exists)'
  1264.     rm -f _shar_wnt_.tmp
  1265. else
  1266. > _shar_wnt_.tmp
  1267. echo 'x - extracting log10.s (Text)'
  1268. sed 's/^X//' << 'SHAR_EOF' > 'log10.s' &&
  1269. /*
  1270. ** This file is part of the alternative 80386 math library and is
  1271. ** covered by the GNU General Public license with my modification
  1272. ** as noted in the README file that accompanied this file.
  1273. **
  1274. ** Copyright 1990 G. Geers
  1275. **
  1276. */
  1277. X
  1278. X    .align 4
  1279. X    .globl log10
  1280. log10:
  1281. X    pushl %ebp
  1282. X    movl %esp,%ebp
  1283. X
  1284. X    fldlg2
  1285. X    fldl 8(%ebp)
  1286. X    fyl2x
  1287. X
  1288. X    leave
  1289. X    ret
  1290. SHAR_EOF
  1291. chmod 0644 log10.s ||
  1292. echo 'restore of log10.s failed'
  1293. Wc_c="`wc -c < 'log10.s'`"
  1294. test 333 -eq "$Wc_c" ||
  1295.     echo 'log10.s: original size 333, current size' "$Wc_c"
  1296. rm -f _shar_wnt_.tmp
  1297. fi
  1298. # ============= rint.s ==============
  1299. if test -f 'rint.s' -a X"$1" != X"-c"; then
  1300.     echo 'x - skipping rint.s (File already exists)'
  1301.     rm -f _shar_wnt_.tmp
  1302. else
  1303. > _shar_wnt_.tmp
  1304. echo 'x - extracting rint.s (Text)'
  1305. sed 's/^X//' << 'SHAR_EOF' > 'rint.s' &&
  1306. /*
  1307. ** This file is part of the alternative 80386 math library and is
  1308. ** covered by the GNU General Public license with my modification
  1309. ** as noted in the README file that accompanied this file.
  1310. **
  1311. ** Copyright 1990 G. Geers
  1312. **
  1313. */
  1314. X
  1315. X    .align 4
  1316. X    .globl rint
  1317. rint:
  1318. X    pushl %ebp
  1319. X    movl %esp,%ebp
  1320. X    
  1321. X    fldl 8(%ebp)
  1322. X    frndint
  1323. X
  1324. X    leave
  1325. X    ret
  1326. SHAR_EOF
  1327. chmod 0644 rint.s ||
  1328. echo 'restore of rint.s failed'
  1329. Wc_c="`wc -c < 'rint.s'`"
  1330. test 326 -eq "$Wc_c" ||
  1331.     echo 'rint.s: original size 326, current size' "$Wc_c"
  1332. rm -f _shar_wnt_.tmp
  1333. fi
  1334. # ============= sqrt.s ==============
  1335. if test -f 'sqrt.s' -a X"$1" != X"-c"; then
  1336.     echo 'x - skipping sqrt.s (File already exists)'
  1337.     rm -f _shar_wnt_.tmp
  1338. else
  1339. > _shar_wnt_.tmp
  1340. echo 'x - extracting sqrt.s (Text)'
  1341. sed 's/^X//' << 'SHAR_EOF' > 'sqrt.s' &&
  1342. /*
  1343. ** This file is part of the alternative 80386 math library and is
  1344. ** covered by the GNU General Public license with my modification
  1345. ** as noted in the README file that accompanied this file.
  1346. **
  1347. ** Copyright 1990 G. Geers
  1348. **
  1349. ** sqrt in the prevailing precision
  1350. */
  1351. X
  1352. X    .align 4
  1353. X    .globl sqrt
  1354. sqrt:
  1355. X    pushl %ebp
  1356. X    movl %esp,%ebp
  1357. X
  1358. X    fldl 8(%ebp)
  1359. X    fsqrt
  1360. X
  1361. X    leave
  1362. X    ret
  1363. SHAR_EOF
  1364. chmod 0644 sqrt.s ||
  1365. echo 'restore of sqrt.s failed'
  1366. Wc_c="`wc -c < 'sqrt.s'`"
  1367. test 359 -eq "$Wc_c" ||
  1368.     echo 'sqrt.s: original size 359, current size' "$Wc_c"
  1369. rm -f _shar_wnt_.tmp
  1370. fi
  1371. # ============= exp2.s ==============
  1372. if test -f 'exp2.s' -a X"$1" != X"-c"; then
  1373.     echo 'x - skipping exp2.s (File already exists)'
  1374.     rm -f _shar_wnt_.tmp
  1375. else
  1376. > _shar_wnt_.tmp
  1377. echo 'x - extracting exp2.s (Text)'
  1378. sed 's/^X//' << 'SHAR_EOF' > 'exp2.s' &&
  1379. /*
  1380. ** This file is part of the alternative 80386 math library and is
  1381. ** covered by the GNU General Public license with my modification
  1382. ** as noted in the README file that accompanied this file.
  1383. **
  1384. ** Copyright 1990 G. Geers
  1385. **
  1386. */
  1387. X
  1388. X    .align 4
  1389. X    .globl exp2
  1390. exp2:
  1391. X    pushl %ebp
  1392. X    movl %esp,%ebp
  1393. X
  1394. X    fldl 8(%ebp)
  1395. X    fstl %st(1)
  1396. X    frndint
  1397. X    fstl %st(2)
  1398. X    fsubrp
  1399. X    f2xm1
  1400. X    fld1
  1401. X    faddp
  1402. X    fscale
  1403. X
  1404. X    leave
  1405. X    ret
  1406. SHAR_EOF
  1407. chmod 0644 exp2.s ||
  1408. echo 'restore of exp2.s failed'
  1409. Wc_c="`wc -c < 'exp2.s'`"
  1410. test 387 -eq "$Wc_c" ||
  1411.     echo 'exp2.s: original size 387, current size' "$Wc_c"
  1412. rm -f _shar_wnt_.tmp
  1413. fi
  1414. # ============= log2.s ==============
  1415. if test -f 'log2.s' -a X"$1" != X"-c"; then
  1416.     echo 'x - skipping log2.s (File already exists)'
  1417.     rm -f _shar_wnt_.tmp
  1418. else
  1419. > _shar_wnt_.tmp
  1420. echo 'x - extracting log2.s (Text)'
  1421. sed 's/^X//' << 'SHAR_EOF' > 'log2.s' &&
  1422. /*
  1423. ** This file is part of the alternative 80386 math library and is
  1424. ** covered by the GNU General Public license with my modification
  1425. ** as noted in the README file that accompanied this file.
  1426. **
  1427. ** Copyright 1990 G. Geers
  1428. **
  1429. */
  1430. X
  1431. X    .align 4
  1432. X    .globl log2
  1433. log2:
  1434. X    pushl %ebp
  1435. X    movl %esp,%ebp
  1436. X
  1437. X    fld1
  1438. X    fldl 8(%ebp)
  1439. X    fyl2x
  1440. X
  1441. X    leave
  1442. X    ret
  1443. SHAR_EOF
  1444. chmod 0644 log2.s ||
  1445. echo 'restore of log2.s failed'
  1446. Wc_c="`wc -c < 'log2.s'`"
  1447. test 329 -eq "$Wc_c" ||
  1448.     echo 'log2.s: original size 329, current size' "$Wc_c"
  1449. rm -f _shar_wnt_.tmp
  1450. fi
  1451. # ============= sinh.s ==============
  1452. if test -f 'sinh.s' -a X"$1" != X"-c"; then
  1453.     echo 'x - skipping sinh.s (File already exists)'
  1454.     rm -f _shar_wnt_.tmp
  1455. else
  1456. > _shar_wnt_.tmp
  1457. echo 'x - extracting sinh.s (Text)'
  1458. sed 's/^X//' << 'SHAR_EOF' > 'sinh.s' &&
  1459. /*
  1460. ** This file is part of the alternative 80386 math library and is
  1461. ** covered by the GNU General Public license with my modification
  1462. ** as noted in the README file that accompanied this file.
  1463. **
  1464. ** Copyright 1990 G. Geers
  1465. **
  1466. ** This file started life as a C program but has been massively hacked.
  1467. **
  1468. ** The coefficients are from Hart, et.al. via Berkeley
  1469. **
  1470. */
  1471. X
  1472. .data
  1473. X    .align 4
  1474. p0:
  1475. X    .double 0d-6.30767364049771680000e+05
  1476. X    .align 4
  1477. p1:
  1478. X    .double 0d-8.99127202203950870000e+04
  1479. X    .align 4
  1480. p2:
  1481. X    .double 0d-2.89421135598956380000e+03
  1482. X    .align 4
  1483. p3:
  1484. X    .double 0d-2.63056321339749710000e+01
  1485. X    .align 4
  1486. q0:
  1487. X    .double 0d-6.30767364049771680000e+05
  1488. X    .align 4
  1489. q1:
  1490. X    .double 0d1.52151737879001900000e+04
  1491. X    .align 4
  1492. q2:
  1493. X    .double 0d-1.73678953558233700000e+02
  1494. X
  1495. .text
  1496. X    .align 4
  1497. .LC0:
  1498. X    .double 0d2.10000000000000000000e+01
  1499. X    .align 4
  1500. .LC1:
  1501. X    .double 0d5.00000000000000000000e-01
  1502. X
  1503. X    .align 4
  1504. .globl sinh
  1505. X
  1506. sinh:
  1507. X    pushl %ebp
  1508. X    movl %esp,%ebp
  1509. X    subl $72,%esp
  1510. X    fldl 8(%ebp)
  1511. X    fstpl -8(%ebp)
  1512. X    movl $1,%edx
  1513. X    fldl -8(%ebp)
  1514. X    ftst
  1515. X    fstp %st(0)
  1516. X    fnstsw %ax
  1517. X    sahf
  1518. X    jae .L2
  1519. X    fldl -8(%ebp)
  1520. X    fchs
  1521. X    fstpl -8(%ebp)
  1522. X    movl $-1,%edx
  1523. .L2:
  1524. X    fldl .LC0
  1525. X    fldl -8(%ebp)
  1526. X    fcompp
  1527. X    fnstsw %ax
  1528. X    sahf
  1529. X    jbe .L3
  1530. X    fldl -8(%ebp)
  1531. X    fldl2e
  1532. X    fmulp
  1533. X    fstl %st(1)
  1534. X    frndint
  1535. X    fstl %st(2)
  1536. X    fsubrp
  1537. X    f2xm1
  1538. X    fld1
  1539. X    faddp
  1540. X    fscale
  1541. X    fldl .LC1
  1542. X    fmulp
  1543. X    testl %edx,%edx
  1544. X    jg .L7
  1545. X    fchs
  1546. .L7:
  1547. X    leave
  1548. X    ret
  1549. .L3:
  1550. X    fldl .LC1
  1551. X    fldl -8(%ebp)
  1552. X    fcompp
  1553. X    fnstsw %ax
  1554. X    sahf
  1555. X    jbe .L6
  1556. X    fldl 8(%ebp)
  1557. X    fldl2e
  1558. X    fmulp
  1559. X    fstl %st(1)
  1560. X    frndint
  1561. X    fstl %st(2)
  1562. X    fsubrp
  1563. X    f2xm1
  1564. X    fld1
  1565. X    faddp
  1566. X    fscale
  1567. X    fst %st(1)
  1568. X    fld1
  1569. X    fdivp
  1570. X    fsubrp
  1571. X    fldl .LC1
  1572. X    fmulp
  1573. X    leave
  1574. X    ret
  1575. .L6:
  1576. X    fldl -8(%ebp)
  1577. X    fmull -8(%ebp)
  1578. X    fstl -16(%ebp)
  1579. X    fmull p3
  1580. X    faddl p2
  1581. X    fmull -16(%ebp)
  1582. X    faddl p1
  1583. X    fmull -16(%ebp)
  1584. X    faddl p0
  1585. X    fmull -8(%ebp)
  1586. X    fstpl -72(%ebp)
  1587. X    fldl -16(%ebp)
  1588. X    faddl q2
  1589. X    fmull -16(%ebp)
  1590. X    faddl q1
  1591. X    fmull -16(%ebp)
  1592. X    faddl q0
  1593. X    fstpl -56(%ebp)
  1594. X    fldl -72(%ebp)
  1595. X    fdivl -56(%ebp)
  1596. X    pushl %edx
  1597. X    fildl (%esp)
  1598. X    addl $4,%esp
  1599. X    fstpl -64(%ebp)
  1600. X    fmull -64(%ebp)
  1601. X    leal -76(%ebp),%esp
  1602. X    leave
  1603. X    ret
  1604. SHAR_EOF
  1605. chmod 0644 sinh.s ||
  1606. echo 'restore of sinh.s failed'
  1607. Wc_c="`wc -c < 'sinh.s'`"
  1608. test 1943 -eq "$Wc_c" ||
  1609.     echo 'sinh.s: original size 1943, current size' "$Wc_c"
  1610. rm -f _shar_wnt_.tmp
  1611. fi
  1612. # ============= cosh.s ==============
  1613. if test -f 'cosh.s' -a X"$1" != X"-c"; then
  1614.     echo 'x - skipping cosh.s (File already exists)'
  1615.     rm -f _shar_wnt_.tmp
  1616. else
  1617. > _shar_wnt_.tmp
  1618. echo 'x - extracting cosh.s (Text)'
  1619. sed 's/^X//' << 'SHAR_EOF' > 'cosh.s' &&
  1620. /*
  1621. ** This file is part of the alternative 80386 math library and is
  1622. ** covered by the GNU General Public license with my modification
  1623. ** as noted in the README file that accompanied this file.
  1624. **
  1625. ** Copyright 1990 G. Geers
  1626. **
  1627. */
  1628. X
  1629. X    .align 4
  1630. .LC2:
  1631. X    .double 0.500
  1632. X
  1633. X    .align 4
  1634. X    .globl cosh
  1635. cosh:
  1636. X    pushl %ebp
  1637. X    movl %esp,%ebp
  1638. X
  1639. X    fldl 8(%ebp)
  1640. X    ftst
  1641. X    fstsw %ax
  1642. X    sahf
  1643. X    ja .Lpos
  1644. X    fchs
  1645. X
  1646. .Lpos:
  1647. X    fldl2e
  1648. X    fmulp
  1649. X    fstl %st(1)
  1650. X    frndint
  1651. X    fstl %st(2)
  1652. X    fsubrp
  1653. X    f2xm1
  1654. X    fld1
  1655. X    faddp
  1656. X    fscale
  1657. X    fst %st(1)
  1658. X
  1659. X    fld1
  1660. X    fdivp
  1661. X    faddp
  1662. X
  1663. X    fldl .LC2
  1664. X    fmulp
  1665. X
  1666. X    leave
  1667. X    ret
  1668. SHAR_EOF
  1669. chmod 0644 cosh.s ||
  1670. echo 'restore of cosh.s failed'
  1671. Wc_c="`wc -c < 'cosh.s'`"
  1672. test 533 -eq "$Wc_c" ||
  1673.     echo 'cosh.s: original size 533, current size' "$Wc_c"
  1674. rm -f _shar_wnt_.tmp
  1675. fi
  1676. # ============= tanh.s ==============
  1677. if test -f 'tanh.s' -a X"$1" != X"-c"; then
  1678.     echo 'x - skipping tanh.s (File already exists)'
  1679.     rm -f _shar_wnt_.tmp
  1680. else
  1681. > _shar_wnt_.tmp
  1682. echo 'x - extracting tanh.s (Text)'
  1683. sed 's/^X//' << 'SHAR_EOF' > 'tanh.s' &&
  1684. /*
  1685. ** This file is part of the alternative 80386 math library and is
  1686. ** covered by the GNU General Public license with my modification
  1687. ** as noted in the README file that accompanied this file.
  1688. **
  1689. ** Copyright 1990 G. Geers
  1690. **
  1691. */
  1692. X
  1693. X    .align 4
  1694. X    .globl tanh
  1695. tanh:
  1696. X    pushl %ebp
  1697. X    movl %esp,%ebp
  1698. X    subl $8, %esp
  1699. X
  1700. X    fldl 8(%ebp)
  1701. X    fldl2e
  1702. X    fmulp
  1703. X    fstl %st(1)
  1704. X    frndint
  1705. X    fstl %st(2)
  1706. X    fsubrp
  1707. X    f2xm1
  1708. X    fld1
  1709. X    faddp
  1710. X    fscale
  1711. X    fstl %st(1)
  1712. X    fstl -16(%ebp)
  1713. X
  1714. X    fld1
  1715. X    fdivp
  1716. X
  1717. X    fsubr
  1718. X    faddl -16(%ebp)
  1719. X    fdivrp
  1720. X
  1721. X    leave
  1722. X    ret
  1723. SHAR_EOF
  1724. chmod 0644 tanh.s ||
  1725. echo 'restore of tanh.s failed'
  1726. Wc_c="`wc -c < 'tanh.s'`"
  1727. test 493 -eq "$Wc_c" ||
  1728.     echo 'tanh.s: original size 493, current size' "$Wc_c"
  1729. rm -f _shar_wnt_.tmp
  1730. fi
  1731. # ============= asinh.s ==============
  1732. if test -f 'asinh.s' -a X"$1" != X"-c"; then
  1733.     echo 'x - skipping asinh.s (File already exists)'
  1734.     rm -f _shar_wnt_.tmp
  1735. else
  1736. > _shar_wnt_.tmp
  1737. echo 'x - extracting asinh.s (Text)'
  1738. sed 's/^X//' << 'SHAR_EOF' > 'asinh.s' &&
  1739. /*
  1740. ** This file is part of the alternative 80386 math library and is
  1741. ** covered by the GNU General Public license with my modification
  1742. ** as noted in the README file that accompanied this file.
  1743. **
  1744. ** Copyright 1990 G. Geers
  1745. **
  1746. */
  1747. X
  1748. X    .align 4
  1749. X    .globl asinh
  1750. asinh:
  1751. X    pushl %ebp
  1752. X    movl %esp,%ebp
  1753. X
  1754. X    fldl 8(%ebp)
  1755. X
  1756. X    fmull 8(%ebp)
  1757. X    fld1
  1758. X    faddp
  1759. X    fsqrt
  1760. X    faddl 8(%ebp)
  1761. X    fldln2
  1762. X    fxch %st(1)
  1763. X    fyl2x
  1764. X
  1765. X    leave
  1766. X    ret
  1767. SHAR_EOF
  1768. chmod 0644 asinh.s ||
  1769. echo 'restore of asinh.s failed'
  1770. Wc_c="`wc -c < 'asinh.s'`"
  1771. test 397 -eq "$Wc_c" ||
  1772.     echo 'asinh.s: original size 397, current size' "$Wc_c"
  1773. rm -f _shar_wnt_.tmp
  1774. fi
  1775. # ============= acosh.s ==============
  1776. if test -f 'acosh.s' -a X"$1" != X"-c"; then
  1777.     echo 'x - skipping acosh.s (File already exists)'
  1778.     rm -f _shar_wnt_.tmp
  1779. else
  1780. > _shar_wnt_.tmp
  1781. echo 'x - extracting acosh.s (Text)'
  1782. sed 's/^X//' << 'SHAR_EOF' > 'acosh.s' &&
  1783. /*
  1784. ** This file is part of the alternative 80386 math library and is
  1785. ** covered by the GNU General Public license with my modification
  1786. ** as noted in the README file that accompanied this file.
  1787. **
  1788. ** Copyright 1990 G. Geers
  1789. **
  1790. */
  1791. X
  1792. X    .align 4
  1793. X    .globl acosh
  1794. acosh:
  1795. X    pushl %ebp
  1796. X    movl %esp,%ebp
  1797. X
  1798. X    fldl 8(%ebp)
  1799. X
  1800. X    fmull 8(%ebp)
  1801. X    fld1
  1802. X    fsubrp
  1803. X    fsqrt
  1804. X    faddl 8(%ebp)
  1805. X    fldln2
  1806. X    fxch %st(1)
  1807. X    fyl2x
  1808. X
  1809. X    leave
  1810. X    ret
  1811. SHAR_EOF
  1812. chmod 0644 acosh.s ||
  1813. echo 'restore of acosh.s failed'
  1814. Wc_c="`wc -c < 'acosh.s'`"
  1815. test 398 -eq "$Wc_c" ||
  1816.     echo 'acosh.s: original size 398, current size' "$Wc_c"
  1817. rm -f _shar_wnt_.tmp
  1818. fi
  1819. # ============= atanh.s ==============
  1820. if test -f 'atanh.s' -a X"$1" != X"-c"; then
  1821.     echo 'x - skipping atanh.s (File already exists)'
  1822.     rm -f _shar_wnt_.tmp
  1823. else
  1824. > _shar_wnt_.tmp
  1825. echo 'x - extracting atanh.s (Text)'
  1826. sed 's/^X//' << 'SHAR_EOF' > 'atanh.s' &&
  1827. /*
  1828. ** This file is part of the alternative 80386 math library and is
  1829. ** covered by the GNU General Public license with my modification
  1830. ** as noted in the README file that accompanied this file.
  1831. **
  1832. ** Copyright 1990 G. Geers
  1833. **
  1834. */
  1835. X
  1836. X    .align 4
  1837. .Lhalf:
  1838. X    .double 0.500
  1839. X
  1840. X    .align 4
  1841. X    .globl atanh
  1842. atanh:
  1843. X    pushl %ebp
  1844. X    movl %esp,%ebp
  1845. X
  1846. X    fld1
  1847. X    faddl 8(%ebp)
  1848. X    fld1
  1849. X    fsubl 8(%ebp)
  1850. X    fdivrp
  1851. X
  1852. X    fldln2
  1853. X    fxch %st(1)
  1854. X    fyl2x
  1855. X
  1856. X    fldl .Lhalf
  1857. X    fmulp
  1858. X
  1859. X    leave
  1860. X    ret
  1861. SHAR_EOF
  1862. chmod 0644 atanh.s ||
  1863. echo 'restore of atanh.s failed'
  1864. Wc_c="`wc -c < 'atanh.s'`"
  1865. test 438 -eq "$Wc_c" ||
  1866.     echo 'atanh.s: original size 438, current size' "$Wc_c"
  1867. rm -f _shar_wnt_.tmp
  1868. fi
  1869. # ============= atan2.s ==============
  1870. if test -f 'atan2.s' -a X"$1" != X"-c"; then
  1871.     echo 'x - skipping atan2.s (File already exists)'
  1872.     rm -f _shar_wnt_.tmp
  1873. else
  1874. > _shar_wnt_.tmp
  1875. echo 'x - extracting atan2.s (Text)'
  1876. sed 's/^X//' << 'SHAR_EOF' > 'atan2.s' &&
  1877. /*
  1878. ** This file is part of the alternative 80386 math library and is
  1879. ** covered by the GNU General Public license with my modification
  1880. ** as noted in the README file that accompanied this file.
  1881. **
  1882. ** Copyright 1990 G. Geers
  1883. **
  1884. */
  1885. X
  1886. X    .align 4
  1887. .Lpi:
  1888. X    .double 3.14159265358979323846
  1889. X
  1890. X    .align 4
  1891. .Lmpi:
  1892. X    .double -3.14159265358979323846
  1893. X
  1894. X    .align 4
  1895. .Lhalfpi: 
  1896. X    .double 1.57079632679489661923
  1897. X
  1898. X    .align 4
  1899. .Lmhalfpi:
  1900. X    .double -1.57079632679489661923
  1901. X
  1902. X    .align 4
  1903. X    .globl atan2
  1904. atan2:
  1905. X    pushl %ebp
  1906. X    movl %esp,%ebp
  1907. X
  1908. X    fldl 16(%ebp)
  1909. X    ftst
  1910. X    fnstsw %ax
  1911. X    sahf 
  1912. X    fldl 8(%ebp)
  1913. X    jz .Lgotzero
  1914. X    jc .Lgotneg
  1915. X
  1916. X    fdivp
  1917. X    fld1
  1918. X    fpatan
  1919. X
  1920. X    leave
  1921. X    ret
  1922. X
  1923. .Lgotneg:
  1924. X    ftst
  1925. X    fnstsw %ax
  1926. X    sahf 
  1927. X    jc .Lneg1
  1928. X
  1929. X    fdivp
  1930. X    fld1
  1931. X    fpatan
  1932. X    fldl .Lmpi
  1933. X    fsubrp
  1934. X
  1935. X    leave
  1936. X    ret
  1937. X
  1938. .Lneg1:
  1939. X    fdivp
  1940. X    fld1
  1941. X    fpatan
  1942. X    fldl .Lpi
  1943. X    fsubrp
  1944. X
  1945. X    leave
  1946. X    ret
  1947. X
  1948. .Lgotzero:
  1949. X    ftst
  1950. X    fnstsw %ax
  1951. X    sahf
  1952. X    jz .Lzero
  1953. X    jc .Lneg
  1954. X
  1955. X    fldl .Lhalfpi
  1956. X
  1957. X    leave
  1958. X    ret
  1959. X
  1960. .Lzero:
  1961. X    fldz
  1962. X
  1963. X    leave
  1964. X    ret
  1965. X
  1966. .Lneg:
  1967. X    fldl .Lmhalfpi
  1968. X
  1969. X    leave
  1970. X    ret
  1971. SHAR_EOF
  1972. chmod 0644 atan2.s ||
  1973. echo 'restore of atan2.s failed'
  1974. Wc_c="`wc -c < 'atan2.s'`"
  1975. test 931 -eq "$Wc_c" ||
  1976.     echo 'atan2.s: original size 931, current size' "$Wc_c"
  1977. rm -f _shar_wnt_.tmp
  1978. fi
  1979. # ============= fmod.s ==============
  1980. if test -f 'fmod.s' -a X"$1" != X"-c"; then
  1981.     echo 'x - skipping fmod.s (File already exists)'
  1982.     rm -f _shar_wnt_.tmp
  1983. else
  1984. > _shar_wnt_.tmp
  1985. echo 'x - extracting fmod.s (Text)'
  1986. sed 's/^X//' << 'SHAR_EOF' > 'fmod.s' &&
  1987. /*
  1988. ** This file is part of the alternative 80386 math library and is
  1989. ** covered by the GNU General Public license with my modification
  1990. ** as noted in the README file that accompanied this file.
  1991. **
  1992. ** Copyright 1990 G. Geers
  1993. **
  1994. */
  1995. X
  1996. X    .align 4
  1997. X    .globl fmod
  1998. fmod:
  1999. X    pushl %ebp
  2000. X    movl %esp,%ebp
  2001. X    
  2002. X    fldl 16(%ebp)
  2003. X    fldl 8(%ebp)
  2004. .Lnotred:
  2005. X    fprem
  2006. X
  2007. X    fstsw %ax
  2008. X    sahf
  2009. X    jp .Lnotred
  2010. X
  2011. X    leave
  2012. X    ret
  2013. SHAR_EOF
  2014. chmod 0644 fmod.s ||
  2015. echo 'restore of fmod.s failed'
  2016. Wc_c="`wc -c < 'fmod.s'`"
  2017. test 380 -eq "$Wc_c" ||
  2018.     echo 'fmod.s: original size 380, current size' "$Wc_c"
  2019. rm -f _shar_wnt_.tmp
  2020. fi
  2021. # ============= ieee_ext.s ==============
  2022. if test -f 'ieee_ext.s' -a X"$1" != X"-c"; then
  2023.     echo 'x - skipping ieee_ext.s (File already exists)'
  2024.     rm -f _shar_wnt_.tmp
  2025. else
  2026. > _shar_wnt_.tmp
  2027. echo 'x - extracting ieee_ext.s (Text)'
  2028. sed 's/^X//' << 'SHAR_EOF' > 'ieee_ext.s' &&
  2029. /*
  2030. ** This file is part of the alternative 80386 math library and is
  2031. ** covered by the GNU General Public license with my modification
  2032. ** as noted in the README file that accompanied this file.
  2033. **
  2034. ** Copyright 1990 G. Geers
  2035. **
  2036. */
  2037. X
  2038. X    .align 4
  2039. X    .globl isnan
  2040. isnan:
  2041. X    pushl %ebp
  2042. X    movl %esp,%ebp
  2043. X
  2044. X    movl 12(%ebp), %eax
  2045. X    andl $0x7ff00000, %eax
  2046. X    cmpl $0x7ff00000, %eax
  2047. X    jne .Lnotnan
  2048. X    movl 12(%ebp), %eax
  2049. X    andl $0xfffff, %eax
  2050. X    orl 8(%ebp), %eax
  2051. X    je .Lnotnan
  2052. X
  2053. X    movl $1, %eax
  2054. X    leave 
  2055. X    ret
  2056. X
  2057. .Lnotnan:
  2058. X    movl $0, %eax
  2059. X
  2060. .Ldone:
  2061. X    leave
  2062. X    ret
  2063. X
  2064. X    .align 4
  2065. X    .globl isinf
  2066. isinf:
  2067. X    pushl %ebp
  2068. X    movl %esp,%ebp
  2069. X
  2070. X    movl 12(%ebp), %eax
  2071. X    andl $0x7ff00000, %eax
  2072. X    cmpl $0x7ff00000, %eax
  2073. X    je .Lcouldbeinf
  2074. X
  2075. .Lnotinf:
  2076. X    movl $0, %eax
  2077. X    leave
  2078. X    ret
  2079. X
  2080. .Lcouldbeinf:
  2081. X    movl 12(%ebp), %eax
  2082. X    andl $0xfffff, %eax
  2083. X    orl 8(%ebp), %eax
  2084. X    jne .Lnotinf
  2085. X
  2086. X    movl $1, %eax
  2087. X    leave
  2088. X    ret
  2089. X
  2090. X    .align 4
  2091. X    .globl iszero
  2092. iszero:
  2093. X    pushl %ebp
  2094. X    movl %esp,%ebp
  2095. X
  2096. X    movl 12(%ebp), %eax
  2097. X    cmpl $0x0, %eax
  2098. X    je .Lcouldbezero
  2099. .Lnotzero:
  2100. X    movl $0, %eax
  2101. X    leave
  2102. X    ret
  2103. X
  2104. .Lcouldbezero:
  2105. X    andl $0xfffff, %eax
  2106. X    orl 8(%ebp), %eax
  2107. X    jne .Lnotzero
  2108. X
  2109. X    movl $1, %eax
  2110. X    leave
  2111. X    ret
  2112. X
  2113. X    .align 4
  2114. X    .globl signbit
  2115. signbit:
  2116. X    pushl %ebp
  2117. X    movl %esp,%ebp
  2118. X
  2119. X    movl 12(%ebp), %eax
  2120. X    andl $0x80000000, %eax
  2121. X    cmpl $0x80000000, %eax
  2122. X    jne .Lpos
  2123. X    movl $1, %eax
  2124. X    leave
  2125. X    ret
  2126. X
  2127. .Lpos:
  2128. X    movl $0, %eax
  2129. X    leave
  2130. X    ret
  2131. X
  2132. X    .align 4
  2133. X    .globl issubnormal
  2134. issubnormal:
  2135. X    pushl %ebp
  2136. X    movl %esp,%ebp
  2137. X
  2138. X    movl 12(%ebp), %eax
  2139. X    andl $0x7ff00000, %eax
  2140. X    cmpl $0x0, %eax
  2141. X    je .Lcouldbesub
  2142. X
  2143. .Lnotsubnorm:
  2144. X    movl $0, %eax
  2145. X    leave
  2146. X    ret
  2147. X
  2148. .Lcouldbesub:
  2149. X    movl 12(%ebp), %eax
  2150. X    andl $0xfffff, %eax
  2151. X    orl 8(%ebp), %eax
  2152. X    je .Lnotsubnorm
  2153. X
  2154. X    movl $1, %eax
  2155. X    leave
  2156. X    ret
  2157. X
  2158. X    .align 4
  2159. X    .globl isnormal
  2160. isnormal:
  2161. X    pushl %ebp
  2162. X    movl %esp,%ebp
  2163. X
  2164. X    movl 12(%ebp), %eax
  2165. X    andl $0x7ff00000, %eax /* mask sign bit */
  2166. X    xorl $0x7ff00000, %eax 
  2167. X    cmpl $0x0, %eax
  2168. X    je .Lnotnorm
  2169. X    cmpl $0x7ff00000, %eax
  2170. X    je .Lnotnorm
  2171. X
  2172. .Lnorm:
  2173. X    movl $1, %eax
  2174. X    leave
  2175. X    ret
  2176. X
  2177. .Lcouldbenorm:
  2178. X    movl 12(%ebp), %eax
  2179. X    andl $0xfffff, %eax
  2180. X    orl 8(%ebp), %eax
  2181. X    je .Lnorm
  2182. X
  2183. .Lnotnorm:
  2184. X    movl $0, %eax
  2185. X    leave
  2186. X    ret
  2187. SHAR_EOF
  2188. chmod 0644 ieee_ext.s ||
  2189. echo 'restore of ieee_ext.s failed'
  2190. Wc_c="`wc -c < 'ieee_ext.s'`"
  2191. test 1994 -eq "$Wc_c" ||
  2192.     echo 'ieee_ext.s: original size 1994, current size' "$Wc_c"
  2193. rm -f _shar_wnt_.tmp
  2194. fi
  2195. # ============= infinity.s ==============
  2196. if test -f 'infinity.s' -a X"$1" != X"-c"; then
  2197.     echo 'x - skipping infinity.s (File already exists)'
  2198.     rm -f _shar_wnt_.tmp
  2199. else
  2200. > _shar_wnt_.tmp
  2201. echo 'x - extracting infinity.s (Text)'
  2202. sed 's/^X//' << 'SHAR_EOF' > 'infinity.s' &&
  2203. /*
  2204. ** This file is part of the alternative 80386 math library and is
  2205. ** covered by the GNU General Public license with my modification
  2206. ** as noted in the README file that accompanied this file.
  2207. **
  2208. ** Copyright 1990 G. Geers
  2209. **
  2210. */
  2211. X
  2212. X    .align 4
  2213. X    .globl infinity
  2214. infinity:
  2215. X    pushl %ebp
  2216. X    movl %esp,%ebp
  2217. X    subl $8, %esp
  2218. X
  2219. X    movl $0x7ff00000, -12(%ebp)
  2220. X    movl $0x0, -16(%ebp)
  2221. X
  2222. X    fldl -16(%ebp)
  2223. X    
  2224. X    leave
  2225. X    ret
  2226. SHAR_EOF
  2227. chmod 0644 infinity.s ||
  2228. echo 'restore of infinity.s failed'
  2229. Wc_c="`wc -c < 'infinity.s'`"
  2230. test 394 -eq "$Wc_c" ||
  2231.     echo 'infinity.s: original size 394, current size' "$Wc_c"
  2232. rm -f _shar_wnt_.tmp
  2233. fi
  2234. # ============= sqrtp.s ==============
  2235. if test -f 'sqrtp.s' -a X"$1" != X"-c"; then
  2236.     echo 'x - skipping sqrtp.s (File already exists)'
  2237.     rm -f _shar_wnt_.tmp
  2238. else
  2239. > _shar_wnt_.tmp
  2240. echo 'x - extracting sqrtp.s (Text)'
  2241. sed 's/^X//' << 'SHAR_EOF' > 'sqrtp.s' &&
  2242. /*
  2243. ** This file is part of the alternative 80386 math library and is
  2244. ** covered by the GNU General Public license with my modification
  2245. ** as noted in the README file that accompanied this file.
  2246. **
  2247. ** Copyright 1990 G. Geers
  2248. **
  2249. ** sqrt in 64 bit precision always
  2250. */
  2251. X
  2252. X    .align 4
  2253. X    .globl sqrtp
  2254. sqrtp:
  2255. X    pushl %ebp
  2256. X    movl %esp,%ebp
  2257. X    subl $8, %esp
  2258. X
  2259. X    fnstcw -12(%ebp)        /* store current control word */
  2260. X    fnstcw -16(%ebp)           /* store again */
  2261. X    andw  $0xf2ff, -12(%ebp)       /* enable 64 bit precision */
  2262. X    fldcw -12(%ebp)
  2263. X
  2264. X    fldl 8(%ebp)
  2265. X    fsqrt
  2266. X
  2267. X    fldcw -16(%ebp)           /* restore original control word */
  2268. X
  2269. X    leave
  2270. X    ret
  2271. SHAR_EOF
  2272. chmod 0644 sqrtp.s ||
  2273. echo 'restore of sqrtp.s failed'
  2274. Wc_c="`wc -c < 'sqrtp.s'`"
  2275. test 605 -eq "$Wc_c" ||
  2276.     echo 'sqrtp.s: original size 605, current size' "$Wc_c"
  2277. rm -f _shar_wnt_.tmp
  2278. fi
  2279. # ============= ieee_values.s ==============
  2280. if test -f 'ieee_values.s' -a X"$1" != X"-c"; then
  2281.     echo 'x - skipping ieee_values.s (File already exists)'
  2282.     rm -f _shar_wnt_.tmp
  2283. else
  2284. > _shar_wnt_.tmp
  2285. echo 'x - extracting ieee_values.s (Text)'
  2286. sed 's/^X//' << 'SHAR_EOF' > 'ieee_values.s' &&
  2287. /*
  2288. ** This file is part of the alternative 80386 math library and is
  2289. ** covered by the GNU General Public license with my modification
  2290. ** as noted in the README file that accompanied this file.
  2291. **
  2292. ** Copyright 1990 G. Geers
  2293. **
  2294. */
  2295. X
  2296. X    .align 4
  2297. X    .globl max_normal
  2298. X
  2299. max_normal:
  2300. X    pushl %ebp
  2301. X    movl %esp,%ebp
  2302. X    subl $8, %esp
  2303. X
  2304. X    movl $0x7fefffff, -12(%ebp)
  2305. X    movl $0xffffffff, -16(%ebp)
  2306. X
  2307. X    fldl -16(%ebp)
  2308. X    
  2309. X    leave
  2310. X    ret
  2311. X
  2312. X    .align 4
  2313. X    .globl min_normal
  2314. X
  2315. min_normal:
  2316. X    pushl %ebp
  2317. X    movl %esp,%ebp
  2318. X    subl $8, %esp
  2319. X
  2320. X    movl $0x00100000, -12(%ebp)
  2321. X    movl $0x00000001, -16(%ebp)
  2322. X
  2323. X    fldl -16(%ebp)
  2324. X    
  2325. X    leave
  2326. X    ret
  2327. X
  2328. X    .align 4
  2329. X    .globl min_subnormal
  2330. X
  2331. min_subnormal:
  2332. X    pushl %ebp
  2333. X    movl %esp,%ebp
  2334. X    subl $8, %esp
  2335. X
  2336. X    movl $0x0, -12(%ebp)
  2337. X    movl $0x00000001, -16(%ebp)
  2338. X
  2339. X    fldl -16(%ebp)
  2340. X    
  2341. X    leave
  2342. X    ret
  2343. X
  2344. X    .align 4
  2345. X    .globl max_subnormal
  2346. X
  2347. max_subnormal:
  2348. X    pushl %ebp
  2349. X    movl %esp,%ebp
  2350. X    subl $8, %esp
  2351. X
  2352. X    movl $0x000fffff, -12(%ebp)
  2353. X    movl $0xffffffff, -16(%ebp)
  2354. X
  2355. X    fldl -16(%ebp)
  2356. X    
  2357. X    leave
  2358. X    ret
  2359. X
  2360. X    .align 4
  2361. X    .globl quiet_nan
  2362. X
  2363. quiet_nan:
  2364. X    pushl %ebp
  2365. X    movl %esp,%ebp
  2366. X    subl $8, %esp
  2367. X
  2368. X    movl $0x7fffffff, -12(%ebp)
  2369. X    movl $0xffffffff, -16(%ebp)
  2370. X
  2371. X    fldl -16(%ebp)
  2372. X    
  2373. X    leave
  2374. X    ret
  2375. X
  2376. X    .align 4
  2377. X    .globl signaling_nan
  2378. X
  2379. signaling_nan:
  2380. X    pushl %ebp
  2381. X    movl %esp,%ebp
  2382. X    subl $8, %esp
  2383. X
  2384. X    movl $0x7ff00000, -12(%ebp)
  2385. X    movl $0x00000001, -16(%ebp)
  2386. X
  2387. X    fldl -16(%ebp)
  2388. X    
  2389. X    leave
  2390. X    ret
  2391. SHAR_EOF
  2392. chmod 0644 ieee_values.s ||
  2393. echo 'restore of ieee_values.s failed'
  2394. Wc_c="`wc -c < 'ieee_values.s'`"
  2395. test 1295 -eq "$Wc_c" ||
  2396.     echo 'ieee_values.s: original size 1295, current size' "$Wc_c"
  2397. rm -f _shar_wnt_.tmp
  2398. fi
  2399. # ============= acosf.s ==============
  2400. if test -f 'acosf.s' -a X"$1" != X"-c"; then
  2401.     echo 'x - skipping acosf.s (File already exists)'
  2402.     rm -f _shar_wnt_.tmp
  2403. else
  2404. > _shar_wnt_.tmp
  2405. echo 'x - extracting acosf.s (Text)'
  2406. sed 's/^X//' << 'SHAR_EOF' > 'acosf.s' &&
  2407. /*
  2408. ** This file is part of the alternative 80386 math library and is
  2409. ** covered by the GNU General Public license with my modification
  2410. ** as noted in the README file that accompanied this file.
  2411. **
  2412. ** Copyright 1990 G. Geers
  2413. **
  2414. */
  2415. X
  2416. X    .align 4
  2417. .Lhalfpi:
  2418. X    .double 1.57079632679489661923
  2419. X
  2420. X    .align 4
  2421. X    .globl acosf
  2422. acosf:
  2423. X    pushl %ebp
  2424. X    movl %esp,%ebp
  2425. X
  2426. X    flds 8(%ebp)
  2427. X
  2428. X    ftst
  2429. X    fstsw %ax
  2430. X    sahf
  2431. X    jz .Lzero
  2432. X
  2433. X    fst %st(1)
  2434. X    fmuls 8(%ebp)
  2435. X    fld1
  2436. X    fsubp
  2437. X    fsqrt
  2438. X    fdivp
  2439. X    fld1
  2440. X    fpatan
  2441. X    jnc .Ldone
  2442. X
  2443. X    fldpi
  2444. X    faddp
  2445. X    leave
  2446. X    ret
  2447. X
  2448. .Lzero:
  2449. X    flds .Lhalfpi
  2450. X
  2451. .Ldone:
  2452. X    leave
  2453. X    ret
  2454. SHAR_EOF
  2455. chmod 0644 acosf.s ||
  2456. echo 'restore of acosf.s failed'
  2457. Wc_c="`wc -c < 'acosf.s'`"
  2458. test 546 -eq "$Wc_c" ||
  2459.     echo 'acosf.s: original size 546, current size' "$Wc_c"
  2460. rm -f _shar_wnt_.tmp
  2461. fi
  2462. # ============= copysignf.s ==============
  2463. if test -f 'copysignf.s' -a X"$1" != X"-c"; then
  2464.     echo 'x - skipping copysignf.s (File already exists)'
  2465.     rm -f _shar_wnt_.tmp
  2466. else
  2467. > _shar_wnt_.tmp
  2468. echo 'x - extracting copysignf.s (Text)'
  2469. sed 's/^X//' << 'SHAR_EOF' > 'copysignf.s' &&
  2470. /*
  2471. ** This file is part of the alternative 80386 math library and is
  2472. ** covered by the GNU General Public license with my modification
  2473. ** as noted in the README file that accompanied this file.
  2474. **
  2475. ** Copyright 1990 G. Geers
  2476. **
  2477. */
  2478. X
  2479. X    .align 4
  2480. .globl copysignf
  2481. copysignf:
  2482. X    pushl %ebp
  2483. X    movl %esp,%ebp
  2484. X
  2485. X    movl 12(%ebp), %eax
  2486. X    andl $0x80000000, %eax
  2487. X    cmpl $0x80000000, %eax
  2488. X    je .Lneg
  2489. X    andl $0x7fffffff, 8(%ebp)
  2490. X    flds 8(%ebp)        /* Store argument for return */
  2491. X    leave
  2492. X    ret
  2493. .Lneg:
  2494. X    orl $0x80000000, 8(%ebp)
  2495. X    flds 8(%ebp)        /* Store argument for return */
  2496. X    leave
  2497. X    ret
  2498. SHAR_EOF
  2499. chmod 0644 copysignf.s ||
  2500. echo 'restore of copysignf.s failed'
  2501. Wc_c="`wc -c < 'copysignf.s'`"
  2502. test 555 -eq "$Wc_c" ||
  2503.     echo 'copysignf.s: original size 555, current size' "$Wc_c"
  2504. rm -f _shar_wnt_.tmp
  2505. fi
  2506. # ============= fabsf.s ==============
  2507. if test -f 'fabsf.s' -a X"$1" != X"-c"; then
  2508.     echo 'x - skipping fabsf.s (File already exists)'
  2509.     rm -f _shar_wnt_.tmp
  2510. else
  2511. > _shar_wnt_.tmp
  2512. echo 'x - extracting fabsf.s (Text)'
  2513. sed 's/^X//' << 'SHAR_EOF' > 'fabsf.s' &&
  2514. /*
  2515. ** This file is part of the alternative 80386 math library and is
  2516. ** covered by the GNU General Public license with my modification
  2517. ** as noted in the README file that accompanied this file.
  2518. **
  2519. ** Copyright 1990 G. Geers
  2520. **
  2521. */
  2522. X
  2523. X    .align 4
  2524. X    .globl fabsf
  2525. fabsf:
  2526. X    pushl %ebp
  2527. X    movl %esp,%ebp
  2528. X
  2529. X    flds 8(%ebp)
  2530. X    fabs
  2531. X
  2532. X    leave
  2533. X    ret
  2534. SHAR_EOF
  2535. chmod 0644 fabsf.s ||
  2536. echo 'restore of fabsf.s failed'
  2537. Wc_c="`wc -c < 'fabsf.s'`"
  2538. test 324 -eq "$Wc_c" ||
  2539.     echo 'fabsf.s: original size 324, current size' "$Wc_c"
  2540. rm -f _shar_wnt_.tmp
  2541. fi
  2542. # ============= log10f.s ==============
  2543. if test -f 'log10f.s' -a X"$1" != X"-c"; then
  2544.     echo 'x - skipping log10f.s (File already exists)'
  2545.     rm -f _shar_wnt_.tmp
  2546. else
  2547. > _shar_wnt_.tmp
  2548. echo 'x - extracting log10f.s (Text)'
  2549. sed 's/^X//' << 'SHAR_EOF' > 'log10f.s' &&
  2550. /*
  2551. ** This file is part of the alternative 80386 math library and is
  2552. ** covered by the GNU General Public license with my modification
  2553. ** as noted in the README file that accompanied this file.
  2554. **
  2555. ** Copyright 1990 G. Geers
  2556. **
  2557. */
  2558. X
  2559. X    .align 4
  2560. X    .globl log10f
  2561. log10f:
  2562. X    pushl %ebp
  2563. X    movl %esp,%ebp
  2564. X
  2565. X    fldlg2
  2566. X    flds 8(%ebp)
  2567. X    fyl2x
  2568. X
  2569. X    leave
  2570. X    ret
  2571. SHAR_EOF
  2572. chmod 0644 log10f.s ||
  2573. echo 'restore of log10f.s failed'
  2574. Wc_c="`wc -c < 'log10f.s'`"
  2575. test 335 -eq "$Wc_c" ||
  2576.     echo 'log10f.s: original size 335, current size' "$Wc_c"
  2577. rm -f _shar_wnt_.tmp
  2578. fi
  2579. # ============= sinf.s ==============
  2580. if test -f 'sinf.s' -a X"$1" != X"-c"; then
  2581.     echo 'x - skipping sinf.s (File already exists)'
  2582.     rm -f _shar_wnt_.tmp
  2583. else
  2584. > _shar_wnt_.tmp
  2585. echo 'x - extracting sinf.s (Text)'
  2586. sed 's/^X//' << 'SHAR_EOF' > 'sinf.s' &&
  2587. /*
  2588. ** This file is part of the alternative 80386 math library and is
  2589. ** covered by the GNU General Public license with my modification
  2590. ** as noted in the README file that accompanied this file.
  2591. **
  2592. ** Copyright 1990 G. Geers
  2593. **
  2594. */
  2595. X
  2596. X    .align 4
  2597. X    .globl sinf
  2598. sinf:
  2599. X    pushl %ebp
  2600. X    movl %esp,%ebp
  2601. X
  2602. X    flds 8(%ebp)
  2603. X    fsin
  2604. X
  2605. X    leave
  2606. X    ret
  2607. SHAR_EOF
  2608. chmod 0644 sinf.s ||
  2609. echo 'restore of sinf.s failed'
  2610. Wc_c="`wc -c < 'sinf.s'`"
  2611. test 322 -eq "$Wc_c" ||
  2612.     echo 'sinf.s: original size 322, current size' "$Wc_c"
  2613. rm -f _shar_wnt_.tmp
  2614. fi
  2615. # ============= acoshf.s ==============
  2616. if test -f 'acoshf.s' -a X"$1" != X"-c"; then
  2617.     echo 'x - skipping acoshf.s (File already exists)'
  2618.     rm -f _shar_wnt_.tmp
  2619. else
  2620. > _shar_wnt_.tmp
  2621. echo 'x - extracting acoshf.s (Text)'
  2622. sed 's/^X//' << 'SHAR_EOF' > 'acoshf.s' &&
  2623. /*
  2624. ** This file is part of the alternative 80386 math library and is
  2625. ** covered by the GNU General Public license with my modification
  2626. ** as noted in the README file that accompanied this file.
  2627. **
  2628. ** Copyright 1990 G. Geers
  2629. **
  2630. */
  2631. X
  2632. X    .align 4
  2633. X    .globl acoshf
  2634. acoshf:
  2635. X    pushl %ebp
  2636. X    movl %esp,%ebp
  2637. X
  2638. X    flds 8(%ebp)
  2639. X
  2640. X    fmuls 8(%ebp)
  2641. X    fld1
  2642. X    fsubrp
  2643. X    fsqrt
  2644. X    fadds 8(%ebp)
  2645. X    fldln2
  2646. X    fxch %st(1)
  2647. X    fyl2x
  2648. X
  2649. X    leave
  2650. X    ret
  2651. SHAR_EOF
  2652. chmod 0644 acoshf.s ||
  2653. echo 'restore of acoshf.s failed'
  2654. Wc_c="`wc -c < 'acoshf.s'`"
  2655. test 400 -eq "$Wc_c" ||
  2656.     echo 'acoshf.s: original size 400, current size' "$Wc_c"
  2657. rm -f _shar_wnt_.tmp
  2658. fi
  2659. # ============= cosf.s ==============
  2660. if test -f 'cosf.s' -a X"$1" != X"-c"; then
  2661.     echo 'x - skipping cosf.s (File already exists)'
  2662.     rm -f _shar_wnt_.tmp
  2663. else
  2664. > _shar_wnt_.tmp
  2665. echo 'x - extracting cosf.s (Text)'
  2666. sed 's/^X//' << 'SHAR_EOF' > 'cosf.s' &&
  2667. /*
  2668. ** This file is part of the alternative 80386 math library and is
  2669. ** covered by the GNU General Public license with my modification
  2670. ** as noted in the README file that accompanied this file.
  2671. **
  2672. ** Copyright 1990 G. Geers
  2673. **
  2674. */
  2675. X
  2676. X    .align 4
  2677. X    .globl cosf
  2678. cosf:
  2679. X    pushl %ebp
  2680. X    movl %esp,%ebp
  2681. X
  2682. X    flds 8(%ebp)
  2683. X    fcos
  2684. X
  2685. X    leave
  2686. X    ret
  2687. SHAR_EOF
  2688. chmod 0644 cosf.s ||
  2689. echo 'restore of cosf.s failed'
  2690. Wc_c="`wc -c < 'cosf.s'`"
  2691. test 322 -eq "$Wc_c" ||
  2692.     echo 'cosf.s: original size 322, current size' "$Wc_c"
  2693. rm -f _shar_wnt_.tmp
  2694. fi
  2695. # ============= finitef.s ==============
  2696. if test -f 'finitef.s' -a X"$1" != X"-c"; then
  2697.     echo 'x - skipping finitef.s (File already exists)'
  2698.     rm -f _shar_wnt_.tmp
  2699. else
  2700. > _shar_wnt_.tmp
  2701. echo 'x - extracting finitef.s (Text)'
  2702. sed 's/^X//' << 'SHAR_EOF' > 'finitef.s' &&
  2703. /*
  2704. ** This file is part of the alternative 80386 math library and is
  2705. ** covered by the GNU General Public license with my modification
  2706. ** as noted in the README file that accompanied this file.
  2707. **
  2708. ** Copyright 1990 G. Geers
  2709. **
  2710. */
  2711. X
  2712. X    .align 4
  2713. X    .globl finitef
  2714. finitef:
  2715. X    pushl %ebp
  2716. X    movl %esp,%ebp
  2717. X
  2718. X    movl 8(%ebp), %eax
  2719. X    andl $0x7ff00000, %eax
  2720. X    cmpl $0x7ff00000, %eax
  2721. X    je    .Lnotfinite
  2722. X
  2723. X    movl $1, %eax
  2724. X    leave
  2725. X    ret
  2726. X
  2727. .Lnotfinite:
  2728. X    movl $0, %eax
  2729. X    leave
  2730. X    ret
  2731. SHAR_EOF
  2732. chmod 0644 finitef.s ||
  2733. echo 'restore of finitef.s failed'
  2734. Wc_c="`wc -c < 'finitef.s'`"
  2735. test 448 -eq "$Wc_c" ||
  2736.     echo 'finitef.s: original size 448, current size' "$Wc_c"
  2737. rm -f _shar_wnt_.tmp
  2738. fi
  2739. # ============= log1pf.s ==============
  2740. if test -f 'log1pf.s' -a X"$1" != X"-c"; then
  2741.     echo 'x - skipping log1pf.s (File already exists)'
  2742.     rm -f _shar_wnt_.tmp
  2743. else
  2744. > _shar_wnt_.tmp
  2745. echo 'x - extracting log1pf.s (Text)'
  2746. sed 's/^X//' << 'SHAR_EOF' > 'log1pf.s' &&
  2747. /*
  2748. ** This file is part of the alternative 80386 math library and is
  2749. ** covered by the GNU General Public license with my modification
  2750. ** as noted in the README file that accompanied this file.
  2751. **
  2752. ** Copyright 1990 G. Geers
  2753. **
  2754. */
  2755. X
  2756. X    .align 4
  2757. X    .globl log1pf
  2758. log1pf:
  2759. X    pushl %ebp
  2760. X    movl %esp,%ebp
  2761. X
  2762. X    fldln2
  2763. X    flds 8(%ebp)
  2764. X    fld1
  2765. X    faddp
  2766. X    fyl2x
  2767. X
  2768. X    leave
  2769. X    ret
  2770. SHAR_EOF
  2771. chmod 0644 log1pf.s ||
  2772. echo 'restore of log1pf.s failed'
  2773. Wc_c="`wc -c < 'log1pf.s'`"
  2774. test 348 -eq "$Wc_c" ||
  2775.     echo 'log1pf.s: original size 348, current size' "$Wc_c"
  2776. rm -f _shar_wnt_.tmp
  2777. fi
  2778. # ============= sinhf.s ==============
  2779. if test -f 'sinhf.s' -a X"$1" != X"-c"; then
  2780.     echo 'x - skipping sinhf.s (File already exists)'
  2781.     rm -f _shar_wnt_.tmp
  2782. else
  2783. > _shar_wnt_.tmp
  2784. echo 'x - extracting sinhf.s (Text)'
  2785. sed 's/^X//' << 'SHAR_EOF' > 'sinhf.s' &&
  2786. /*
  2787. ** This file is part of the alternative 80386 math library and is
  2788. ** covered by the GNU General Public license with my modification
  2789. ** as noted in the README file that accompanied this file.
  2790. **
  2791. ** Copyright 1990 G. Geers
  2792. **
  2793. ** This file started life as a C program but has been massively hacked.
  2794. **
  2795. */
  2796. X
  2797. .data
  2798. X    .align 4
  2799. p0:
  2800. X    .double 0d-6.30767364049771680000e+05
  2801. X    .align 4
  2802. p1:
  2803. X    .double 0d-8.99127202203950870000e+04
  2804. X    .align 4
  2805. p2:
  2806. X    .double 0d-2.89421135598956380000e+03
  2807. X    .align 4
  2808. p3:
  2809. X    .double 0d-2.63056321339749710000e+01
  2810. X    .align 4
  2811. q0:
  2812. X    .double 0d-6.30767364049771680000e+05
  2813. X    .align 4
  2814. q1:
  2815. X    .double 0d1.52151737879001900000e+04
  2816. X    .align 4
  2817. q2:
  2818. X    .double 0d-1.73678953558233700000e+02
  2819. X
  2820. .text
  2821. X    .align 4
  2822. .LC0:
  2823. X    .double 0d2.10000000000000000000e+01
  2824. X    .align 4
  2825. .LC1:
  2826. X    .double 0d5.00000000000000000000e-01
  2827. X    .align 4
  2828. X
  2829. .globl sinhf
  2830. sinhf:
  2831. X    pushl %ebp
  2832. X    movl %esp,%ebp
  2833. X    subl $88,%esp
  2834. X    movl 8(%ebp),%ecx
  2835. X    movl %ecx,-4(%ebp)
  2836. X    movl $1,%edx
  2837. X    pushl %ecx
  2838. X    flds (%esp) 
  2839. X    addl $4,%esp
  2840. X    ftst
  2841. X    fstp %st(0)
  2842. X    fnstsw %ax
  2843. X    sahf
  2844. X    jae .L2
  2845. X    flds -4(%ebp)
  2846. X    fchs
  2847. X    fstps -4(%ebp)
  2848. X    movl $-1,%edx
  2849. .L2:
  2850. X    flds -4(%ebp)
  2851. X    fldl .LC0
  2852. X    fcompp
  2853. X    fnstsw %ax
  2854. X    sahf
  2855. X    jae .L3
  2856. X    flds 8(%ebp)
  2857. X    fldl2e
  2858. X    fmulp
  2859. X    fstl %st(1)
  2860. X    frndint
  2861. X    fstl %st(2)
  2862. X    fsubrp
  2863. X    f2xm1
  2864. X    fld1
  2865. X    faddp
  2866. X    fscale
  2867. X    fldl .LC1
  2868. X    fmulp
  2869. X    testl %edx,%edx
  2870. X    jg .L7
  2871. X    fchs
  2872. .L7:
  2873. X    leave
  2874. X    ret
  2875. .L3:
  2876. X    flds -4(%ebp)
  2877. X    fldl .LC1
  2878. X    fcompp
  2879. X    fnstsw %ax
  2880. X    sahf
  2881. X    jae .L6
  2882. X    flds -4(%ebp)
  2883. X    fldl2e
  2884. X    fmulp
  2885. X    fstl %st(1)
  2886. X    frndint
  2887. X    fstl %st(2)
  2888. X    fsubrp
  2889. X    f2xm1
  2890. X    fld1
  2891. X    faddp
  2892. X    fscale
  2893. X    fst %st(1)
  2894. X    fld1
  2895. X    fdivp
  2896. X    fsubrp
  2897. X    fldl .LC1
  2898. X    fmulp
  2899. X    leave
  2900. X    ret
  2901. .L6:
  2902. X    flds -4(%ebp)
  2903. X    fmuls -4(%ebp)
  2904. X    fstps -88(%ebp)
  2905. X    flds -88(%ebp)
  2906. X    fstpl -12(%ebp)
  2907. X    fldl -12(%ebp)
  2908. X    fmull p3
  2909. X    faddl p2
  2910. X    fmull -12(%ebp)
  2911. X    faddl p1
  2912. X    fmull -12(%ebp)
  2913. X    faddl p0
  2914. X    flds -4(%ebp)
  2915. X    fstpl -20(%ebp)
  2916. X    fmull -20(%ebp)
  2917. X    fstpl -88(%ebp)
  2918. X    fldl -12(%ebp)
  2919. X    faddl q2
  2920. X    fmull -12(%ebp)
  2921. X    faddl q1
  2922. X    fmull -12(%ebp)
  2923. X    faddl q0
  2924. X    fstpl -60(%ebp)
  2925. X    fldl -88(%ebp)
  2926. X    fdivl -60(%ebp)
  2927. X    pushl %edx
  2928. X    fildl (%esp)
  2929. X    addl $4,%esp
  2930. X    fstps -64(%ebp)
  2931. X    flds -64(%ebp)
  2932. X    fstpl -72(%ebp)
  2933. X    fmull -72(%ebp)
  2934. X    addl $-4,%esp
  2935. X    fstps (%esp)
  2936. X    flds (%esp) 
  2937. X    addl $4,%esp
  2938. X    leave
  2939. X    ret
  2940. SHAR_EOF
  2941. chmod 0644 sinhf.s ||
  2942. echo 'restore of sinhf.s failed'
  2943. Wc_c="`wc -c < 'sinhf.s'`"
  2944. test 2072 -eq "$Wc_c" ||
  2945.     echo 'sinhf.s: original size 2072, current size' "$Wc_c"
  2946. rm -f _shar_wnt_.tmp
  2947. fi
  2948. # ============= asinf.s ==============
  2949. if test -f 'asinf.s' -a X"$1" != X"-c"; then
  2950.     echo 'x - skipping asinf.s (File already exists)'
  2951.     rm -f _shar_wnt_.tmp
  2952. else
  2953. > _shar_wnt_.tmp
  2954. echo 'x - extracting asinf.s (Text)'
  2955. sed 's/^X//' << 'SHAR_EOF' > 'asinf.s' &&
  2956. /*
  2957. SHAR_EOF
  2958. true || echo 'restore of asinf.s failed'
  2959. fi
  2960. echo 'End of mathlib2.0 part 3'
  2961. echo 'File asinf.s is continued in part 4'
  2962. echo 4 > _shar_seq_.tmp
  2963. exit 0
  2964. --
  2965. Glenn Geers                       | "So when it's over, we're back to people.
  2966. Department of Theoretical Physics |  Just to prove that human touch can have
  2967. The University of Sydney          |  no equal."
  2968. Sydney NSW 2006 Australia         |  - Basia Trzetrzelewska, 'Prime Time TV'
  2969.