home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update27.zoo / lib / diffc < prev   
Encoding:
Text File  |  1992-12-28  |  41.0 KB  |  1,699 lines

  1. ===================================================================
  2. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Changelo,v
  3. retrieving revision 1.83
  4. diff -c -r1.83 Changelo
  5. *** 1.83    1992/11/08 00:03:26
  6. --- Changelo    1992/12/28 07:52:43
  7. ***************
  8. *** 3419,3421 ****
  9. --- 3419,3476 ----
  10.       has to be  data addressable ("dmi" constrain should cover).
  11.   
  12.   ---------------------------- Patchlevel 85 ---------------------------
  13. + _divdf3.cpp:: olaf
  14. +    prevent the tie rounding case if dividing is not exact.
  15. +      paranoia now says: "Division appears to round correctly"
  16. +      ** requires _normdf Version 1.6.1 or later
  17. + _divmods.s _mulsi3.s _udivmod.s:: ++jrb
  18. +     add c68 labels
  19. + stdarg.h/varargs.h:: uunet!ms2.maus.de!Bjarne_Pohlers (Bjarne Pohlers)/++jrb
  20. +     bjarne reported a problem with an example in the way we were
  21. +     pull off args from the stack. he had a fix that looked good. i
  22. +     went the gcc-way for the same fix, and used __builtin_next_arg()
  23. +     and let the compiler do the right thing. thanks bjarne.!
  24. + _addsubd.cpp _addsubs.cpp _divsf3.cpp _normsf.cpp: Olaf
  25. +     Problems solved:
  26. +       * tie breaking for single precision division
  27. +       * prevent core dump for single precision overflow  
  28. +     Only one flaw is left for single precision arithmetic!
  29. +     I did a rewrite of the add/sub algorithm; now it is about 10-20% faster.
  30. + falcon.h: Howard
  31. +     bindings for Falcon. Thanks howard.
  32. + fread.c:: Andreas
  33. +     With the BSD-like pipes in MiNT 0.96/PL14 one cannot assume, EOF is
  34. +     reached if read() returns less bytes than requested; it could be a
  35. +     short read from a pipe.
  36. +     There's another `feature' in fread: if a big block is read in text
  37. +     mode (!_IOBIN) and the data actually doesn't contain CR's, fread ends
  38. +     up copying the data block onto itself.
  39. + Synch with mntlib Patchlevel 25: ers
  40. +     ioctl.h:
  41. +         ANYP means "no parity", not "any speed"
  42. +     difftime.c: ++entropy@gnu.ai.mit.edu
  43. +         The parameters were reversed. Ouch.
  44. +     bcmp.c: ++hohmuth@freia.inf.tu-dresden.de
  45. +         Change the ODD macro to return a 16 bit value (for
  46. +         Pure C)
  47. +     Following from andreas:
  48. +         compiler.h: for gcc2, use the builtin sizes
  49. +         gemfast.h: add XCONTROL messages and WF_COLOR defines
  50. +         mintbind.h, osbind.h: add the missing definitions
  51. +         screen.h: fix definitions for TT
  52. +         stdio.h: allow 32 open files as does MiNT
  53. +         wait.h (WSTOPPED): use expected value
  54. + ---------------------------- Patchlevel 86 ---------------------------
  55. ===================================================================
  56. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/PatchLev.h,v
  57. retrieving revision 1.61
  58. diff -c -r1.61 PatchLev.h
  59. *** 1.61    1992/11/08 00:03:31
  60. --- PatchLev.h    1992/12/28 07:52:46
  61. ***************
  62. *** 1,5 ****
  63.   
  64. ! #define    PatchLevel "85"
  65.   
  66.   /*
  67.    *
  68. --- 1,5 ----
  69.   
  70. ! #define    PatchLevel "86"
  71.   
  72.   /*
  73.    *
  74. ===================================================================
  75. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/mincl,v
  76. retrieving revision 1.23
  77. diff -c -r1.23 mincl
  78. *** 1.23    1992/11/08 00:03:36
  79. --- mincl    1992/12/28 07:52:50
  80. ***************
  81. *** 3,9 ****
  82.   GLIB1 = _addsubd.o _addsubs.o _cmpdf2.o _cmpsf2.o _divdf3.o _divmods.o \
  83.       _divsf3.o _extends.o _fixdfsi.o _fxunsd.o _fltsi.o \
  84.       _muldf3.o _mulsf3.o _mulsi3.o _negdf2.o _negsf2.o _normdf.o _normsf.o \
  85. !     _truncdf.o _udivmod.o _umulsi3.o _fixsfsi.o _fltsisf.o
  86.   
  87.   #GLIB2 = gnulib2.o
  88.   GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
  89. --- 3,9 ----
  90.   GLIB1 = _addsubd.o _addsubs.o _cmpdf2.o _cmpsf2.o _divdf3.o _divmods.o \
  91.       _divsf3.o _extends.o _fixdfsi.o _fxunsd.o _fltsi.o \
  92.       _muldf3.o _mulsf3.o _mulsi3.o _negdf2.o _negsf2.o _normdf.o _normsf.o \
  93. !     _truncdf.o _udivmod.o _umulsi3.o _fixsfsi.o _fltsisf.o _isnan.o
  94.   
  95.   #GLIB2 = gnulib2.o
  96.   GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
  97. ===================================================================
  98. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubd.cpp,v
  99. retrieving revision 1.3
  100. diff -c -r1.3 _addsubd.cpp
  101. *** 1.3    1992/11/06 23:02:09
  102. --- _addsubd.cpp    1992/12/28 07:55:59
  103. ***************
  104. *** 6,16 ****
  105.       .even
  106.       .globl    __subdf3, ___subdf3
  107.       .globl    __adddf3, ___adddf3
  108. ! #ifndef    sfp004
  109.   |
  110.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  111.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  112.   | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  113.   | 
  114.   | Revision 1.3.2 olaf 10-92 :
  115.   |  + increased comparson by one again. (Dont understand, but it works)
  116. --- 6,29 ----
  117.       .even
  118.       .globl    __subdf3, ___subdf3
  119.       .globl    __adddf3, ___adddf3
  120. ! # ifndef    sfp004
  121.   |
  122.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  123.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  124.   | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  125. + |
  126. + | Revision 1.3.4 olaf 11-92 :
  127. + |  + added support for NaN and infinities
  128. + |    > floating point is now excellent!
  129. + |
  130. + |  -- still lacks trap handling for exceptions
  131. + |  -- dont know the external representation of quiet and signaling NaN
  132. + |     I decided 0x7fffffff,ffffffff to be a quiet NaN
  133. + |     the rest should be signaling (but isnt)
  134. + |
  135. + | Revision 1.3.3 olaf 11-92 :
  136. + |  + changed to get rid of rounding bits. a sticky register (d3) is
  137. + |    sufficient. 
  138.   | 
  139.   | Revision 1.3.2 olaf 10-92 :
  140.   |  + increased comparson by one again. (Dont understand, but it works)
  141. ***************
  142. *** 60,72 ****
  143.       andw    #0x07ff,d1    | kill sign bit
  144.   
  145.       andl    #0x0fffff,d6    | remove exponent from u.mantissa
  146. !     tstw    d0        | check for zero exponent - no leading "1"
  147.       beq    0f
  148.       orl    #0x100000,d6    | restore implied leading "1"
  149.       bra    1f
  150.   0:    addw    #1,d0        | "normalize" exponent
  151.   1:
  152. -     andl    #0x0fffff,d4    | remove exponent from v.mantissa
  153.       tstw    d1        | check for zero exponent - no leading "1"
  154.       beq    0f
  155.       orl    #0x100000,d4    | restore implied leading "1"
  156. --- 73,149 ----
  157.       andw    #0x07ff,d1    | kill sign bit
  158.   
  159.       andl    #0x0fffff,d6    | remove exponent from u.mantissa
  160. !     andl    #0x0fffff,d4    | remove exponent from v.mantissa
  161. ! |
  162. ! | Now perform testing of NaN And infinities
  163. ! |
  164. !     cmpw    #0x07ff,d0
  165. !     beq    0f
  166. !     cmpw    #0x07ff,d1
  167. !     bne    nospec
  168. !     bra    1f
  169. ! |    first operand is special
  170. ! |
  171. ! 0:    cmpw    d0,d1
  172. !     beq    bothspec
  173. ! |
  174. ! |    u is special
  175. ! | 
  176. !     movel    d7,d0
  177. !     orl    d6,d0
  178. !     bne    retnan        | arith with Nan gives always Nan
  179. !     movel    a0@(8),d0        | copy infinity
  180. !     clrl    d1
  181. !     bra     return
  182. ! |
  183. ! |    v is special
  184. ! |
  185. ! 1:    movel    d5,d0
  186. !     orl    d4,d0
  187. !     bne    retnan
  188. !     movel    a0@,d0
  189. !     clrl    d1
  190. !     bra    return
  191. ! |
  192. ! |    u and v are both special
  193. ! |
  194. ! bothspec:
  195. !     movel    d7,d0
  196. !     orl    d6,d0
  197. !     orl    d5,d0
  198. !     orl    d4,d0
  199. !     beq    bothinf
  200. !     bra    retnan    
  201. ! |
  202. ! | Both are infinities Test if cancellation
  203. ! | 
  204. ! bothinf:
  205. !     tstw    d2
  206. !     bpl    retinf    
  207. ! |
  208. ! | return a quiet NaN
  209. ! |
  210. ! retnan:    movel    #0x7fffffff,d0
  211. !     moveql  #-1,d1
  212. !     bra    return
  213. ! retinf: movel   #0x7ff00000,d0
  214. !     clrl    d1
  215. !     tstl    d2
  216. !     bpl    return
  217. !     bchg    #31,d0
  218. ! return:    moveml    sp@+,d2-d7
  219. !     rts
  220. ! |    
  221. ! | Ok, no inifinty or Nan involved..
  222. ! |
  223. ! nospec:    tstw    d0        | check for zero exponent - no leading "1"
  224.       beq    0f
  225.       orl    #0x100000,d6    | restore implied leading "1"
  226.       bra    1f
  227.   0:    addw    #1,d0        | "normalize" exponent
  228.   1:
  229.       tstw    d1        | check for zero exponent - no leading "1"
  230.       beq    0f
  231.       orl    #0x100000,d4    | restore implied leading "1"
  232. ***************
  233. *** 73,79 ****
  234.       bra    1f
  235.   0:    addw    #1,d1        | "normalize" exponent
  236.   1:
  237. !     clrw    d3        | (put initial zero rounding bits in d3)
  238.       negw    d1        | d1 = u.exp - v.exp
  239.       addw    d0,d1
  240.       beq    5f        | exponents are equal - no shifting neccessary
  241. --- 150,156 ----
  242.       bra    1f
  243.   0:    addw    #1,d1        | "normalize" exponent
  244.   1:
  245. !     clrl    d3        | init sticky register
  246.       negw    d1        | d1 = u.exp - v.exp
  247.       addw    d0,d1
  248.       beq    5f        | exponents are equal - no shifting neccessary
  249. ***************
  250. *** 88,111 ****
  251.   1:
  252.       cmpw    #55,d1        | is u so much bigger that v is not
  253.       bge    7f        | significant ?
  254. !     movew    #10-1,d3    | shift u left up to 10 bits to minimize loss
  255. ! 2:
  256. !     addl    d7,d7
  257.       addxl    d6,d6
  258.       subw    #1,d0        | decrement exponent
  259. !     subw    #1,d1        | done shifting altogether ?
  260. !     dbeq    d3,2b        | loop if still can shift u.mant more
  261. !     clrw    d3
  262. !     clrb    d2              | clear "sticky byte"
  263. ! 3:
  264.       cmpw    #16,d1        | see if fast rotate possible
  265.       blt    4f
  266. !     orb    d5,d3        | set rounding bits
  267. !     orb    d2,d3
  268. !     sne    d2        | "sticky byte"
  269. !     movew    d5,d3
  270. !     lsrw    #8,d3
  271.       movew    d4,d5        | rotate by swapping register halfs
  272.       swap    d5
  273.       clrw    d4
  274. --- 165,189 ----
  275.   1:
  276.       cmpw    #55,d1        | is u so much bigger that v is not
  277.       bge    7f        | significant ?
  278. ! |
  279. ! | shift mantissa left two digits, to allow cancellation of
  280. ! | most significant digit, while gaining an additional digit for
  281. ! | rounding.
  282. ! |
  283. !     moveql  #1,d3    
  284. ! 2:    addl    d7,d7
  285.       addxl    d6,d6
  286.       subw    #1,d0        | decrement exponent
  287. !     subw    #1,d1        | decrement counter
  288. !     dbeq    d3,2b
  289. !     clrl    d3
  290. ! |
  291. ! | now shift other mantissa right as fast as possible (almost).
  292. ! |
  293. ! 3:    
  294.       cmpw    #16,d1        | see if fast rotate possible
  295.       blt    4f
  296. !     orw    d5,d3        | set sticky word
  297.       movew    d4,d5        | rotate by swapping register halfs
  298.       swap    d5
  299.       clrw    d4
  300. ***************
  301. *** 112,132 ****
  302.       swap    d4
  303.       subw    #16,d1
  304.       bra    3b
  305. ! 0:
  306.       lsrl    #1,d4        | shift v.mant right the rest of the way
  307.       roxrl    #1,d5        | to line it up with u.mant
  308. -     orb    d3,d2        | set "sticky byte" if necessary
  309. -     roxrb    #1,d3        | shift into rounding bits
  310.   4:    dbra    d1,0b        | loop
  311. !     andb    #1,d2        | see if "sticky bit" should be set
  312. !     orb    d2,d3
  313.   5:
  314.       tstw    d2        | are the signs equal ?
  315.       bpl    6f        | yes, no negate necessary
  316. !     negb    d3        | negate rounding bits and v.mant
  317. !     negxl    d5
  318.       negxl    d4
  319.   6:
  320.       addl    d5,d7        | u.mant = u.mant + v.mant
  321.       addxl    d4,d6
  322. --- 190,218 ----
  323.       swap    d4
  324.       subw    #16,d1
  325.       bra    3b
  326. ! 0:    moveb   d5,d2        | use d2.b as scratch
  327. !     andb    #1,d2        | test if 1 is shifted out
  328. !     orb    d2,d3        | and put it in sticky 
  329.       lsrl    #1,d4        | shift v.mant right the rest of the way
  330.       roxrl    #1,d5        | to line it up with u.mant
  331.   4:    dbra    d1,0b        | loop
  332. !     
  333.   5:
  334.       tstw    d2        | are the signs equal ?
  335.       bpl    6f        | yes, no negate necessary
  336. ! |
  337. ! | negate secand mantissa. One has to check the sticky word in order
  338. ! | to correct the twos complement.
  339. ! |
  340. !     tstw    d3        | 
  341. !     beq     9f        | No cerrection necessary
  342. !     clrl    d1
  343. !     addql   #1,d5
  344. !     addxl   d1,d4
  345. ! 9:    negl    d5
  346.       negxl    d4
  347. +         
  348.   6:
  349.       addl    d5,d7        | u.mant = u.mant + v.mant
  350.       addxl    d4,d6
  351. ***************
  352. *** 134,148 ****
  353.       tstw    d2        | opposite signs ?
  354.       bpl    7f        | do not need to negate result
  355.   
  356. -     negb    d3        | negate rounding bits and u.mant
  357.       negl    d7
  358.       negxl    d6
  359. !     notl    d2        | switch sign
  360.   7:
  361.       movel    d6,d4        | move result for normalization
  362.       movel    d7,d5
  363. !     moveb    d3,d1        | put rounding bits in d1 for norm_df
  364. !     swap    d2        | put sign into d2 (exponent is in d0)
  365.       jmp    norm_df        | leave registers on stack for norm_df
  366.   #else    sfp004
  367.   | double precision floating point stuff for Atari-gcc using the SFP004
  368. --- 220,236 ----
  369.       tstw    d2        | opposite signs ?
  370.       bpl    7f        | do not need to negate result
  371.   
  372.       negl    d7
  373.       negxl    d6
  374. !     notl    d2        |     switch sign
  375.   7:
  376.       movel    d6,d4        | move result for normalization
  377.       movel    d7,d5
  378. !     clrl    d1
  379. !     tstl    d3
  380. !     beq     8f
  381. !     moveql   #-1,d1
  382. ! 8:    swap    d2        | put sign into d2 (exponent is in d0)
  383.       jmp    norm_df        | leave registers on stack for norm_df
  384.   #else    sfp004
  385.   | double precision floating point stuff for Atari-gcc using the SFP004
  386. ===================================================================
  387. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubs.cpp,v
  388. retrieving revision 1.3
  389. diff -c -r1.3 _addsubs.cpp
  390. *** 1.3    1992/11/06 23:02:09
  391. --- _addsubs.cpp    1992/12/28 07:56:00
  392. ***************
  393. *** 10,17 ****
  394.   |
  395.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  396.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  397. ! | patched by Olaf Flebbe (flebbe@tat.physik.un-tuebingen.de)
  398.   |
  399.   | Revision 1.3.2 olaf 10-92 :
  400.   |  + increased comparson by one again. (Dont understand, but it works)
  401.   |  + corrected negation of rounding bits and mantissa
  402. --- 10,29 ----
  403.   |
  404.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  405.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  406. ! | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  407.   |
  408. + | Revision 1.3.4 olaf 11-92 :
  409. + |  + added support for NaN and infinities
  410. + |    > paranoia now dont complains about unbalanced range any more
  411. + |  -- still lacks trap handling for exceptions
  412. + |  -- dont know the external representation of quiet and signaling NaN
  413. + |     I decided 0x7fffffff to be a quiet NaN
  414. + |     the rest should be signaling (but isnt)
  415. + |
  416. + | Revision 1.3.3 olaf 11-92 :
  417. + |  + changed to get rid of rounding bits. a sticky register (d3) is
  418. + |    sufficient.
  419. + |
  420.   | Revision 1.3.2 olaf 10-92 :
  421.   |  + increased comparson by one again. (Dont understand, but it works)
  422.   |  + corrected negation of rounding bits and mantissa
  423. ***************
  424. *** 63,75 ****
  425.       andw    #0xff,d1    | kill sign bit (exponent is 8 bits)
  426.   
  427.       andl    #0x7fffff,d5    | remove exponent from mantissa
  428. !     tstw    d0        | check for zero exponent - no leading "1"
  429.       beq    0f
  430.       orl    #0x800000,d5    | restore implied leading "1"
  431.       bra    1f
  432.   0:    addw    #1,d0        | "normalize" exponent
  433.   1:
  434. -     andl    #0x7fffff,d4    | remove exponent from mantissa
  435.       tstw    d1        | check for zero exponent - no leading "1"
  436.       beq    0f
  437.       orl    #0x800000,d4    | restore implied leading "1"
  438. --- 75,143 ----
  439.       andw    #0xff,d1    | kill sign bit (exponent is 8 bits)
  440.   
  441.       andl    #0x7fffff,d5    | remove exponent from mantissa
  442. !     andl    #0x7fffff,d4    | remove exponent from mantissa
  443. ! |
  444. ! | Now perform testing of NaN And infinities
  445. ! |
  446. !     cmpb    #0xff,d0
  447. !     beq    0f
  448. !     cmpb    #0xff,d1
  449. !     bne    nospec        
  450. !     bra    1f
  451. ! |    first operand is special
  452. ! |
  453. ! 0:    cmpb    d0,d1
  454. !     beq    bothspec
  455. ! |
  456. ! |    u is special
  457. ! | 
  458. !     tstl    d5
  459. !     bne    retnan        | arith with Nan gives always Nan
  460. !     movel    a0@(4),d0        | copy infinity
  461. !     bra     return
  462. ! |
  463. ! |    v is special
  464. ! |
  465. ! 1:    tstl    d4
  466. !     bne    retnan
  467. !     movel    a0@,d0
  468. !     bra    return
  469. ! |
  470. ! |    u and v are both special
  471. ! |
  472. ! bothspec:
  473. !     movel    d5,d0
  474. !     orl    d4,d0
  475. !     beq    bothinf
  476. !     bra    retnan    
  477. ! |
  478. ! | Both are infinities Test if cancellation
  479. ! | 
  480. ! bothinf:
  481. !     tstw    d2
  482. !     bpl    retinf    
  483. ! |
  484. ! | return a quiet NaN
  485. ! |
  486. ! retnan:    movel    #0x7fffffff,d0
  487. !     bra    return
  488. ! retinf: movel   #0x7f800000,d0
  489. !     tstl    d2
  490. !     bpl    return
  491. !     bchg    #31,d0
  492. ! return:    moveml    sp@+,d2-d5
  493. !     rts
  494. ! |    
  495. ! | Ok, no inifinty or Nan involved..
  496. ! |
  497. ! nospec:    tstw    d0        | check for zero exponent - no leading "1"
  498.       beq    0f
  499.       orl    #0x800000,d5    | restore implied leading "1"
  500.       bra    1f
  501.   0:    addw    #1,d0        | "normalize" exponent
  502.   1:
  503.       tstw    d1        | check for zero exponent - no leading "1"
  504.       beq    0f
  505.       orl    #0x800000,d4    | restore implied leading "1"
  506. ***************
  507. *** 76,82 ****
  508.       bra    1f
  509.   0:    addw    #1,d1        | "normalize" exponent
  510.   1:
  511. !     clrw    d3        | (put initial zero rounding bits in d3)
  512.       negw    d1        | d1 = u.exp - v.exp
  513.       addw    d0,d1
  514.       beq    5f        | exponents are equal - no shifting neccessary
  515. --- 144,150 ----
  516.       bra    1f
  517.   0:    addw    #1,d1        | "normalize" exponent
  518.   1:
  519. !     clrl    d3        | (put initial zero rounding bits in d3)
  520.       negw    d1        | d1 = u.exp - v.exp
  521.       addw    d0,d1
  522.       beq    5f        | exponents are equal - no shifting neccessary
  523. ***************
  524. *** 90,129 ****
  525.   1:
  526.       cmpw    #26,d1        | is u so much bigger that v is not
  527.       bge    7f        | significant ?
  528. !     movew    #7-1,d3        | shift u left up to 7 bits to minimize loss
  529. ! 2:
  530. !     addl    d5,d5
  531.       subw    #1,d0        | decrement exponent
  532.       subw    #1,d1        | done shifting altogether ?
  533.       dbeq    d3,2b        | loop if still can shift u.mant more
  534. !     clrw    d3
  535. !     clrb    d2
  536.   
  537.       cmpw    #16,d1        | see if fast rotate possible
  538.       blt    4f
  539. !     orb    d4,d3        | set rounding bits
  540. !     orb    d2,d3
  541. !     sne    d2        | "sticky byte"
  542. !     movew    d4,d3
  543. !     lsrw    #8,d3
  544. !     clrw    d4        | rotate by swapping register halfs
  545.       swap    d4
  546.       subw    #16,d1
  547.           bra     4f
  548. ! 0:
  549.       lsrl    #1,d4        | shift v.mant right the rest of the way
  550. -     orb    d3,d2        | set "sticky byte" if necessary
  551. -     roxrb    #1,d3        | shift into rounding bits
  552.   4:    dbra    d1,0b        | loop
  553. !     andb    #1,d2        | see if "sticky bit" should be set
  554. !     orb    d2,d3
  555.   5:
  556.       tstw    d2        | are the signs equal ?
  557.       bpl    6f        | yes, no negate necessary
  558.   
  559. !     negb    d3        | negate rounding bits and v.mant
  560. !     negxl    d4
  561.   6:
  562.       addl    d4,d5        | u.mant = u.mant + v.mant
  563.       bcs    7f        | needn not negate
  564. --- 158,199 ----
  565.   1:
  566.       cmpw    #26,d1        | is u so much bigger that v is not
  567.       bge    7f        | significant ?
  568. ! |
  569. ! | shift mantissa left two digits, to allow cancellation of
  570. ! | most significant digit, while gaining an additional digit for
  571. ! | rounding.
  572. ! |
  573. !     moveql    #1,d3    
  574. ! 2:    addl    d5,d5
  575.       subw    #1,d0        | decrement exponent
  576.       subw    #1,d1        | done shifting altogether ?
  577.       dbeq    d3,2b        | loop if still can shift u.mant more
  578. !     clrl    d3
  579.   
  580.       cmpw    #16,d1        | see if fast rotate possible
  581.       blt    4f
  582. !     orw    d4,d3        | set rounding bits
  583. !     clrw    d4
  584.       swap    d4
  585.       subw    #16,d1
  586.           bra     4f
  587. ! 0:    moveb   d4,d2
  588. !     andb    #1,d2
  589. !     orb    d2,d3
  590.       lsrl    #1,d4        | shift v.mant right the rest of the way
  591.   4:    dbra    d1,0b        | loop
  592.   5:
  593.       tstw    d2        | are the signs equal ?
  594.       bpl    6f        | yes, no negate necessary
  595.   
  596. !     tstw    d3        | negate rounding bits and v.mant
  597. !     beq    9f
  598. !     addql    #1,d4
  599. ! 9:    negl    d4
  600.   6:
  601.       addl    d4,d5        | u.mant = u.mant + v.mant
  602.       bcs    7f        | needn not negate
  603. ***************
  604. *** 130,142 ****
  605.       tstw    d2        | opposite signs ?
  606.       bpl    7f        | do not need to negate result
  607.   
  608. !     negb    d3        | negate rounding bits and u.mant
  609. !     negxl    d5
  610.       notl    d2        | switch sign
  611.   7:
  612.       movel    d5,d4        | move result for normalization
  613. !     moveb    d3,d1        | put rounding bits in d1 for norm_sf
  614. !     swap    d2        | put sign into d2 (exponent is in d0)
  615.       jmp    norm_sf        | leave registers on stack for norm_sf
  616.   
  617.   # else    sfp004
  618. --- 200,214 ----
  619.       tstw    d2        | opposite signs ?
  620.       bpl    7f        | do not need to negate result
  621.   
  622. !     negl    d5
  623.       notl    d2        | switch sign
  624.   7:
  625.       movel    d5,d4        | move result for normalization
  626. !     clrl    d1
  627. !     tstl    d3
  628. !     beq    8f
  629. !     moveql    #-1,d1
  630. ! 8:    swap    d2        | put sign into d2 (exponent is in d0)
  631.       jmp    norm_sf        | leave registers on stack for norm_sf
  632.   
  633.   # else    sfp004
  634. ===================================================================
  635. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_cmpdf2.s,v
  636. retrieving revision 1.3
  637. diff -c -r1.3 _cmpdf2.s
  638. *** 1.3    1992/10/09 20:35:29
  639. --- _cmpdf2.s    1992/12/28 07:56:02
  640. ***************
  641. *** 1,37 ****
  642.   | double floating point compare routine
  643.   |
  644. ! | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  645. ! | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  646.   |
  647. - |
  648. - | Revision 1.1, kub 12-89 :
  649. - | Ported over to 68k assembler
  650. - |
  651. - | Revision 1.0:
  652. - | original 8088 code from P.S.Housel
  653.   
  654.       .text
  655.       .even
  656.       .globl    __cmpdf2, ___cmpdf2
  657. !     | additional entry points for gcc2
  658. !     .globl    ___eqdf2, ___nedf2, ___gtdf2, ___gedf2, ___ltdf2, ___ledf2
  659.   __cmpdf2:
  660.   ___cmpdf2:
  661.   ___eqdf2:
  662.   ___nedf2:
  663.   ___gtdf2:
  664. ! ___gedf2:
  665. ! ___ltdf2:
  666.   ___ledf2:
  667. !     moveml    sp@(4),d0-d1/a0-a1 | get u and v
  668.       tstl    d0        | check sign bit
  669.       bpl    1f
  670.       negl    d1        | negate
  671.       negxl    d0
  672.       bchg    #31,d0        | toggle sign bit
  673. ! 1:
  674. !     exg    a0,d0
  675.       exg    a1,d1
  676.       tstl    d0        | check sign bit
  677.       bpl    2f
  678. --- 1,97 ----
  679.   | double floating point compare routine
  680.   |
  681. ! | written by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  682. ! | Based on a 68k floating point packet from Kai-Uwe Bloem, itself based
  683. ! | on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  684. ! | 
  685. ! | Revision 2.0: olaf 12-92.
  686.   |
  687.   
  688.       .text
  689.       .even
  690. +     .globl    ___eqdf2, ___nedf2
  691. +     .globl    ___gtdf2, ___ledf2
  692. +     .globl    ___gedf2, ___ltdf2
  693.       .globl    __cmpdf2, ___cmpdf2
  694. !     
  695.   __cmpdf2:
  696.   ___cmpdf2:
  697.   ___eqdf2:
  698.   ___nedf2:
  699. +     moveml    sp@(4),d0-d1/a0-a1        | get numbers to compare with
  700. +     tstl    d0        | check sign bit
  701. +     bpl    1f
  702. +     negl    d1        | negate
  703. +     negxl    d0
  704. +     bchg    #31,d0        | toggle sign bit
  705. + 1:    exg    a0,d0
  706. +     exg    a1,d1
  707. +     tstl    d0        | check sign bit
  708. +     bpl    2f
  709. +     negl    d1        | negate
  710. +     negxl    d0
  711. +     bchg    #31,d0        | toggle sign bit
  712. + 2:    cmpl    d1,a1
  713. +     bne    4f
  714. +     cmpl    d0,a0
  715. +     bne    4f
  716. +     bclr    #31,d0
  717. +     cmpl    #0x7ff00000,d0        | NaN is not equal NaN !
  718. +     bgt    4f
  719. +     blt    3f
  720. +     tstl    d1
  721. +     bne    4f
  722. + 3:    clrl    d0
  723. +     rts
  724. + 4:    moveql    #1,d0
  725. +     rts
  726.   ___gtdf2:
  727. !     moveml    sp@(4),d0-d1/a0-a1        | get numbers to compare with
  728. !     tstl    d0        | check sign bit
  729. !     bpl    1f
  730. !     negl    d1        | negate
  731. !     negxl    d0
  732. !     bchg    #31,d0        | toggle sign bit
  733. ! 1:    exg    a0,d0
  734. !     exg    a1,d1
  735. !     tstl    d0        | check sign bit
  736. !     bpl    2f
  737. !     negl    d1        | negate
  738. !     negxl    d0
  739. !     bchg    #31,d0        | toggle sign bit
  740. ! 2:    exg    a0,d0
  741. !     exg    a1,d1
  742. !     cmpl    a0,d0
  743. !     bgt    4f        | d0 > a0 Test if NaN (should be false!)
  744. !     blt    3f        | 
  745. !     cmpl    a1,d1
  746. !     bhi    4f
  747. ! 3:    clrl    d0        | Test is false.
  748. !     rts
  749. ! 4:    bclr    #31,d0        
  750. !     cmpl    #0x7ff00000,d0    | First operand == NaN =?
  751. !     bgt    3b
  752. !     blt    5f        | It is finite!
  753. !     tstl    d1
  754. !     bne    3b        | It *is* a NaN
  755. ! 5:    moveql    #1,d0        | Test True
  756. !     rts
  757.   ___ledf2:
  758. !     moveml    sp@(4),d0-d1/a0-a1        | get numbers to compare with
  759.       tstl    d0        | check sign bit
  760.       bpl    1f
  761.       negl    d1        | negate
  762.       negxl    d0
  763.       bchg    #31,d0        | toggle sign bit
  764. ! 1:    exg    a0,d0
  765.       exg    a1,d1
  766.       tstl    d0        | check sign bit
  767.       bpl    2f
  768. ***************
  769. *** 38,56 ****
  770.       negl    d1        | negate
  771.       negxl    d0
  772.       bchg    #31,d0        | toggle sign bit
  773. ! 2:
  774. !     cmpl    d0,a0
  775. !     blt    lt
  776. !     bgt    gt
  777.       cmpl    d1,a1
  778. !     bhi    gt
  779. !     beq    eq
  780. ! lt:
  781. !     moveq    #-1,d0
  782.       rts
  783. ! eq:
  784. !     clrl    d0
  785.       rts
  786. ! gt:
  787. !     moveq    #1,d0
  788.       rts
  789. --- 98,184 ----
  790.       negl    d1        | negate
  791.       negxl    d0
  792.       bchg    #31,d0        | toggle sign bit
  793. ! 2:    cmpl    d0,a0
  794. !     blt    4f
  795. !     bgt    3f
  796.       cmpl    d1,a1
  797. !     bls    4f            | <= !
  798. ! 3:    moveql    #1,d0        | Test is false
  799. !     rts
  800. ! 4:    bclr    #31,d0        
  801. !     cmpl    #0x7ff00000,d0    | First operand == NaN =?
  802. !     bgt    3b
  803. !     blt    5f        | It is finite!
  804. !     tstl    d1
  805. !     bne    3b        | It *is* a NaN
  806. ! 5:    clrl    d0        | Test true
  807. !     rts
  808. ! ___gedf2:
  809. !     moveml    sp@(4),d0-d1/a0-a1        | get numbers to compare with
  810. !     tstl    d0        | check sign bit
  811. !     bpl    1f
  812. !     negl    d1        | negate
  813. !     negxl    d0
  814. !     bchg    #31,d0        | toggle sign bit
  815. ! 1:    exg    a0,d0
  816. !     exg    a1,d1
  817. !     tstl    d0        | check sign bit
  818. !     bpl    2f
  819. !     negl    d1        | negate
  820. !     negxl    d0
  821. !     bchg    #31,d0        | toggle sign bit
  822. ! 2:    exg    a0,d0
  823. !     exg    a1,d1
  824. !     cmpl    a0,d0
  825. !     bgt    4f
  826. !     blt    3f
  827. !     cmpl    a1,d1
  828. !     beq    4f        | >= !
  829. !     bhi    4f
  830. ! 3:    moveql    #-1,d0        | False
  831. !     rts
  832. ! 4:    bclr    #31,d0        
  833. !     cmpl    #0x7ff00000,d0    | First operand == NaN =?
  834. !     bgt    3b
  835. !     blt    5f        | It is finite!
  836. !     tstl    d1
  837. !     bne    3b        | It *is* a NaN
  838. ! 5:    clrl    d0        | Test True
  839.       rts
  840. ! ___ltdf2:
  841. !     moveml    sp@(4),d0-d1/a0-a1        | get numbers to compare with
  842. !     tstl    d0        | check sign bit
  843. !     bpl    1f
  844. !     negl    d1        | negate
  845. !     negxl    d0
  846. !     bchg    #31,d0        | toggle sign bit
  847. ! 1:    exg    a0,d0
  848. !     exg    a1,d1
  849. !     tstl    d0        | check sign bit
  850. !     bpl    2f
  851. !     negl    d1        | negate
  852. !     negxl    d0
  853. !     bchg    #31,d0        | toggle sign bit
  854. ! 2:    cmpl    d0,a0
  855. !     blt    4f
  856. !     bgt    3f
  857. !     cmpl    d1,a1
  858. !     beq    3f
  859. !     bls    4f
  860. ! 3:    clrl    d0
  861.       rts
  862. ! 4:    bclr    #31,d0        
  863. !     cmpl    #0x7ff00000,d0    | First operand == NaN =?
  864. !     bgt    3b
  865. !     blt    5f        | It is finite!
  866. !     tstl    d1
  867. !     bne    3b        | It *is* a NaN
  868. ! 5:    moveql    #-1,d0        | Test True
  869.       rts
  870. ===================================================================
  871. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divdf3.cpp,v
  872. retrieving revision 1.2
  873. diff -c -r1.2 _divdf3.cpp
  874. *** 1.2    1992/10/09 20:35:29
  875. --- _divdf3.cpp    1992/12/28 07:56:03
  876. ***************
  877. *** 44,49 ****
  878. --- 44,60 ----
  879.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  880.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  881.   |
  882. + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  883. + |
  884. + | Revision 1.2.2 olaf 12-92
  885. + |   + added support for NaN and Infinites
  886. + |   + added support for -0
  887. + |
  888. + | Revision 1.2.1 olaf 11-92
  889. + |   + prevent the tie rounding case if dividing is not exact.
  890. + |      > paranoia now says: "Division appears to round correctly"
  891. + |      ** requires _normdf Version 1.6.1 or later
  892. + |
  893.   | Revision 1.2, kub 01-90 :
  894.   | added support for denormalized numbers
  895.   |
  896. ***************
  897. *** 72,100 ****
  898.       andw    #0x07ff,d1    | kill sign bit
  899.   
  900.       andl    #0x0fffff,d4    | remove exponent from u.mantissa
  901. !     tstw    d0        | check for zero exponent - no leading "1"
  902.       beq    0f
  903.       orl    #0x100000,d4    | restore implied leading "1"
  904.       bra    1f
  905.   0:    addw    #1,d0        | "normalize" exponent
  906. - 1:    movel    d4,d3
  907. -     orl    d5,d3
  908. -     beq    retz        | dividing zero
  909.   
  910. !     andl    #0x0fffff,d6    | remove exponent from v.mantissa
  911. !     tstw    d1        | check for zero exponent - no leading "1"
  912.       beq    0f
  913.       orl    #0x100000,d6    | restore implied leading "1"
  914.       bra    1f
  915.   0:    addw    #1,d1        | "normalize" exponent
  916. - 1:    movel    d6,d3
  917. -     orl    d7,d3
  918. - #ifndef    ERROR_CHECK
  919. -     beq    divz        | divide by zero
  920. - #endif    ERROR_CHECK
  921.   
  922. !     movew    d2,a0        | save sign
  923.   
  924.       subw    d1,d0        | subtract exponents,
  925.       addw    #BIAS8-11+1,d0    |  add bias back in, account for shift
  926. --- 83,168 ----
  927.       andw    #0x07ff,d1    | kill sign bit
  928.   
  929.       andl    #0x0fffff,d4    | remove exponent from u.mantissa
  930. !     andl    #0x0fffff,d6    | remove exponent from v.mantissa
  931. ! |
  932. ! |
  933. ! |
  934. !     cmpw    #0x7ff,d0
  935. !     beq    0f        |u == NaN || u== Inf
  936. !     cmpw    #0x7ff,d1
  937. !     beq    1f        | v == NaN || v == Inf
  938. !     tstw    d0
  939. !     bne    3f        | u not zero nor denorm
  940. !     movel    d5,d3
  941. !     orl    d4,d3
  942. !     beq    2f        | 0/ ?
  943. ! 3:    tstw    d1
  944. !     bne    nospec
  945. !     movel    d7,d3
  946. !     orl    d6,d3
  947. !     bne    nospec
  948. !     bra    retinf        | x/0 -> +/- Inf
  949. !     
  950. ! 0:    orl    d5,d4        | u == NaN ?
  951. !     bne    retnan        | NaN/ x
  952. !     cmpw    #0x7ff,d1    
  953. !     beq    retnan        | Inf/Inf or Inf/NaN 
  954. !     bra    retinf        | Inf/x | x != Inf && x != NaN
  955. ! 1:    orl    d7,d6
  956. !     bne    retnan        | x/NaN
  957. !     bra    retzero        | x/Inf -> +/- 0
  958. ! 2:    tstw    d1
  959. !     bne    retzero        | 0/x ->+/- 0
  960. !     orl    d5,d4
  961. !     bne    retzero        | 0/x 
  962. !     bra    retnan        | 0/0
  963. ! |
  964. ! |    Return Infinity with correct sign
  965. ! |    
  966. ! retinf:    clrl    d1
  967. !     tstl    d2
  968. !     bpl    0f
  969. !     movel    #0xfff00000,d0
  970. ! return:    moveml    sp@+,d2-d7
  971. !     rts
  972. ! 0:    movel    #0x7ff00000,d0
  973. !     bra    return    
  974. ! |
  975. ! |    Return NaN
  976. ! |
  977. ! retnan: movel    #0x7fffffff,d0
  978. !     moveql    #-1,d1
  979. !     bra    return
  980. ! |
  981. ! |    Return correct signed zero
  982. ! |
  983. ! retzero:clrl    d0        | zero destination
  984. !     clrl    d1
  985. !     tstl    d2
  986. !     bmi    return
  987. !     bset    #31,d0
  988. !     bra    return
  989. ! |
  990. ! |    End of special handling
  991. ! |    
  992. ! nospec:    tstw    d0        | check for zero exponent - no leading "1"
  993.       beq    0f
  994.       orl    #0x100000,d4    | restore implied leading "1"
  995.       bra    1f
  996.   0:    addw    #1,d0        | "normalize" exponent
  997.   
  998. ! 1:    tstw    d1        | check for zero exponent - no leading "1"
  999.       beq    0f
  1000.       orl    #0x100000,d6    | restore implied leading "1"
  1001.       bra    1f
  1002.   0:    addw    #1,d1        | "normalize" exponent
  1003.   
  1004. ! 1:    movew    d2,a0        | save sign
  1005.   
  1006.       subw    d1,d0        | subtract exponents,
  1007.       addw    #BIAS8-11+1,d0    |  add bias back in, account for shift
  1008. ***************
  1009. *** 129,159 ****
  1010.       notl    d2        | invert quotient to get it right
  1011.       notl    d3
  1012.   
  1013. !     movel    d2,d4        | save quotient mantissa
  1014.       movel    d3,d5
  1015.       movew    a0,d2        | get sign back
  1016. -     clrw    d1        | zero rounding bits
  1017.       jmp    norm_df        | (registers on stack removed by norm_df)
  1018. - retz:    clrl    d0        | zero destination
  1019. -     clrl    d1
  1020. -     moveml    sp@+,d2-d7
  1021. -     rts            | no normalization needed
  1022. - #ifndef    ERROR_CHECK
  1023. - | NOTE: __infinitydf is in the text segment
  1024. - divz: moveml  __infinitydf,d0-d1 | return infinity value
  1025. -     moveml    sp@+,d2-d7    | should really cause trap ?!?
  1026. -     btst    #31,a7@(4)        | transfer sign of dividend
  1027. -     beq    clear            | (mjr++)
  1028. -     bset    #31,d0            |
  1029. -     rts                |
  1030. - clear:                    |
  1031. -     bclr    #31,d0            |
  1032. -     rts
  1033. - #endif    ERROR_CHECK
  1034.   
  1035.   #else
  1036.   
  1037. --- 197,210 ----
  1038.       notl    d2        | invert quotient to get it right
  1039.       notl    d3
  1040.   
  1041. !     movel   d5,d1
  1042. !     orl     d4,d1           | check for exact result
  1043. !     beq     1f              
  1044. !     moveql  #-1,d1          | Set rounding bits for tie case
  1045. ! 1:    movel    d2,d4        | save quotient mantissa
  1046.       movel    d3,d5
  1047.       movew    a0,d2        | get sign back
  1048.       jmp    norm_df        | (registers on stack removed by norm_df)
  1049.   
  1050.   #else
  1051.   
  1052. ===================================================================
  1053. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divmods.s,v
  1054. retrieving revision 1.2
  1055. diff -c -r1.2 _divmods.s
  1056. *** 1.2    1990/04/01 04:41:12
  1057. --- _divmods.s    1992/11/24 04:14:46
  1058. ***************
  1059. *** 14,22 ****
  1060.   
  1061.       .text
  1062.       .even
  1063. !     .globl    __divsi3, ___divsi3
  1064. !     .globl    __modsi3, ___modsi3
  1065.   
  1066.   __divsi3:
  1067.   ___divsi3:
  1068.       movel    d2,a0        | save registers
  1069. --- 14,23 ----
  1070.   
  1071.       .text
  1072.       .even
  1073. !     .globl    __divsi3, ___divsi3, .ldiv
  1074. !     .globl    __modsi3, ___modsi3, .lrem
  1075.   
  1076. + .ldiv:
  1077.   __divsi3:
  1078.   ___divsi3:
  1079.       movel    d2,a0        | save registers
  1080. ***************
  1081. *** 83,88 ****
  1082. --- 84,90 ----
  1083.       bra    8b        | back to user
  1084.   
  1085.   
  1086. + .lrem:
  1087.   __modsi3:
  1088.   ___modsi3:
  1089.       movel    sp@(8),sp@-    | push divisor
  1090. ===================================================================
  1091. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divsf3.cpp,v
  1092. retrieving revision 1.2
  1093. diff -c -r1.2 _divsf3.cpp
  1094. *** 1.2    1992/10/09 20:35:29
  1095. --- _divsf3.cpp    1992/12/18 16:35:40
  1096. ***************
  1097. *** 43,49 ****
  1098. --- 43,55 ----
  1099.   |
  1100.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  1101.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1102. + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  1103.   |
  1104. + | Revision 1.2.1 olaf 11-92
  1105. + |   + prevent the tie rounding case if dividing is not exact.
  1106. + |      > paranoia now says: "Division appears to round correctly"
  1107. + |      ** requires _normsf Version 1.4.2 or later
  1108. + |
  1109.   | Revision 1.2, kub 01-90 :
  1110.   | added support for denormalized numbers
  1111.   |
  1112. ***************
  1113. *** 117,124 ****
  1114.   5:    subw    #2,d0        | remove rounding offset for denormalized nums
  1115.       notl    d3        | invert quotient to get it right
  1116.   
  1117. !     movel    d3,d4        | save quotient mantissa
  1118. !     clrw    d1        | zero rounding bits
  1119.       jmp    norm_sf        | (registers on stack removed by norm_sf)
  1120.   
  1121.   # ifndef ERROR_CHECK
  1122. --- 123,133 ----
  1123.   5:    subw    #2,d0        | remove rounding offset for denormalized nums
  1124.       notl    d3        | invert quotient to get it right
  1125.   
  1126. !     clrl    d1        | zero rounding bits
  1127. !     tstl     d4        | check for exact result
  1128. !     beq    1f
  1129. !     moveql    #-1,d1        | prevent tie case
  1130. ! 1:    movel    d3,d4        | save quotient mantissa
  1131.       jmp    norm_sf        | (registers on stack removed by norm_sf)
  1132.   
  1133.   # ifndef ERROR_CHECK
  1134. ===================================================================
  1135. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_muldf3.cpp,v
  1136. retrieving revision 1.2
  1137. diff -c -r1.2 _muldf3.cpp
  1138. *** 1.2    1992/10/09 20:35:29
  1139. --- _muldf3.cpp    1992/12/28 07:56:04
  1140. ***************
  1141. *** 58,64 ****
  1142. --- 58,68 ----
  1143.   |
  1144.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  1145.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1146. + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  1147.   |
  1148. + | Revision 1.2.1 olaf 12-92:
  1149. + |   + added support for NaN and Infinites
  1150. + |   + added support for -0
  1151.   |
  1152.   | Revision 1.2, kub 01-90 :
  1153.   | added support for denormalized numbers
  1154. ***************
  1155. *** 74,80 ****
  1156.       lea    sp@(4),a0
  1157.       moveml    d2-d7,sp@-
  1158.       moveml    a0@,d4-d5/d6-d7 | d4-d5 = v, d6-d7 = u
  1159. -     subw    #16,sp        | multiplication accumulator
  1160.   
  1161.       movel    d6,d0        | d0 = u.exp
  1162.       swap    d0
  1163. --- 78,83 ----
  1164. ***************
  1165. *** 89,94 ****
  1166. --- 92,145 ----
  1167.       andw    #0x07ff,d1    | kill sign bit
  1168.   
  1169.       andl    #0x0fffff,d6    | remove exponent from u.mantissa
  1170. +     andl    #0x0fffff,d4    | remove exponent from v.mantissa
  1171. + |
  1172. + | Testing for NaN and Infinities
  1173. + |
  1174. +     cmpw    #0x7ff,d0
  1175. +     beq    0f
  1176. +     cmpw    #0x7ff,d1
  1177. +     bne    nospec
  1178. +     bra    1f
  1179. + |    first operand is special
  1180. + |    Nan?
  1181. + 0:    orl    d7,d6
  1182. +     bne    retnan
  1183. + |    Test v==0.
  1184. +     tstw    d1
  1185. +     bne    retinf  |  Inf  * x == Inf
  1186. +     orl    d5,d4
  1187. +     beq    retnan  | Inf * 0 == NaN
  1188. + retinf:    
  1189. +     clrl    d1
  1190. +     tstl    d2
  1191. +     bpl    0f
  1192. +     movel    #0xfff00000,d0
  1193. + return:    moveml    sp@+,d2-d7
  1194. +     rts
  1195. + 0:    movel    #0x7ff00000,d0
  1196. +     bra    return    
  1197. + retnan: movel    #0x7fffffff,d0
  1198. +     moveql    #-1,d1
  1199. +     bra    return
  1200. + |
  1201. + | v is special
  1202. + |
  1203. + 1:    orl    d5,d4
  1204. +     bne    retnan
  1205. +     tstw    d0
  1206. +     bne    retinf
  1207. +     orl    d7,d6
  1208. +     beq    retnan
  1209. +     bra    retinf
  1210. + |
  1211. + | end of NaN and Inf.
  1212. + |    
  1213. + nospec:    subw    #16,sp        | multiplication accumulator
  1214.       tstw    d0        | check for zero exponent - no leading "1"
  1215.       beq    0f
  1216.       orl    #0x100000,d6    | restore implied leading "1"
  1217. ***************
  1218. *** 98,104 ****
  1219.       orl    d7,d3
  1220.       beq    retz        | multiplying by zero
  1221.   
  1222. -     andl    #0x0fffff,d4    | remove exponent from v.mantissa
  1223.       tstw    d1        | check for zero exponent - no leading "1"
  1224.       beq    0f
  1225.       orl    #0x100000,d4    | restore implied leading "1"
  1226. --- 149,154 ----
  1227. ===================================================================
  1228. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_mulsi3.s,v
  1229. retrieving revision 1.1
  1230. diff -c -r1.1 _mulsi3.s
  1231. *** 1.1    1990/03/26 17:37:16
  1232. --- _mulsi3.s    1992/11/24 04:14:47
  1233. ***************
  1234. *** 11,18 ****
  1235.   
  1236.       .text
  1237.       .even
  1238. !     .globl    __mulsi3, ___mulsi3
  1239.   
  1240.   __mulsi3:
  1241.   ___mulsi3:
  1242.       movel    d2,a0        | save registers
  1243. --- 11,20 ----
  1244.   
  1245.       .text
  1246.       .even
  1247. !     .globl    __mulsi3, ___mulsi3, .lmul, .ulmul
  1248.   
  1249. + .lmul:
  1250. + .ulmul:
  1251.   __mulsi3:
  1252.   ___mulsi3:
  1253.       movel    d2,a0        | save registers
  1254. ===================================================================
  1255. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_negdf2.s,v
  1256. retrieving revision 1.2
  1257. diff -c -r1.2 _negdf2.s
  1258. *** 1.2    1992/10/09 20:35:29
  1259. --- _negdf2.s    1992/12/28 07:56:05
  1260. ***************
  1261. *** 2,8 ****
  1262. --- 2,12 ----
  1263.   |
  1264.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  1265.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1266. + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  1267.   |
  1268. + | revision 1.1.1, olaf 12-92
  1269. + |  + Since sign of NaN is ignored, we can flip it.
  1270. + |  + -0. is different from 0., but compares equal!
  1271.   |
  1272.   | Revision 1.1, kub 12-89 :
  1273.   | Ported over to 68k assembler
  1274. ***************
  1275. *** 16,24 ****
  1276.   
  1277.   __negdf2:            | floating point negate
  1278.   ___negdf2:
  1279. !     movel    sp@(4),d0    | do not negate if operand is 0.0
  1280. !     orl    sp@(8),d0
  1281. !     moveml    sp@(4),d0-d1    | get number
  1282. !     beq    0f
  1283.       bchg    #31,d0        | flip sign bit
  1284. ! 0:    rts
  1285. --- 20,25 ----
  1286.   
  1287.   __negdf2:            | floating point negate
  1288.   ___negdf2:
  1289. !     moveml    sp@(4),d0-d1
  1290.       bchg    #31,d0        | flip sign bit
  1291. !     rts
  1292. ===================================================================
  1293. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_normdf.cpp,v
  1294. retrieving revision 1.6
  1295. diff -c -r1.6 _normdf.cpp
  1296. *** 1.6    1992/11/06 23:02:09
  1297. --- _normdf.cpp    1992/12/28 07:56:08
  1298. ***************
  1299. *** 9,14 ****
  1300. --- 9,17 ----
  1301.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1302.   | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  1303.   |
  1304. + | Revision 1.6.2 olaf 12-92:
  1305. + |  + added support for -0.
  1306. + |
  1307.   | Revision 1.6.1 olaf 10-92:
  1308.   |  + corrected rounding in tie case: round up, not down.
  1309.   |    (needed for enquire 4.3)
  1310. ***************
  1311. *** 173,182 ****
  1312.   
  1313.   retz:
  1314.       moveq    #ERANGE,d0
  1315. !     Emove    d0,Errno
  1316.       clrl    d0        | return zero value
  1317.       clrl    d1
  1318. !     moveml    sp@+,d2-d7
  1319.       rts
  1320.   
  1321.   oflow:
  1322. --- 176,188 ----
  1323.   
  1324.   retz:
  1325.       moveq    #ERANGE,d0
  1326. !     Emove   d0,Errno
  1327.       clrl    d0        | return zero value
  1328.       clrl    d1
  1329. !     tstw    d2
  1330. !     bpl    0f        | -0
  1331. !     bset    #31,d0
  1332. ! 0:    moveml    sp@+,d2-d7
  1333.       rts
  1334.   
  1335.   oflow:
  1336. ***************
  1337. *** 189,195 ****
  1338.       Emove    d0,Errno
  1339.   #endif    ERROR_CHECK
  1340.   
  1341. !     moveml    pc@(__infinitydf),d0-d1 | return infinity value
  1342.       andw    #0x8000,d2    | get sign bit of argument
  1343.       swap    d2
  1344.       clrw    d2
  1345. --- 195,202 ----
  1346.       Emove    d0,Errno
  1347.   #endif    ERROR_CHECK
  1348.   
  1349. ! |    moveml    pc@(__infinitydf),d0-d1 | return infinity value
  1350. !     moveml    __infinitydf,d0-d1 | return infinty value
  1351.       andw    #0x8000,d2    | get sign bit of argument
  1352.       swap    d2
  1353.       clrw    d2
  1354. ===================================================================
  1355. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_normsf.cpp,v
  1356. retrieving revision 1.3
  1357. diff -c -r1.3 _normsf.cpp
  1358. *** 1.3    1992/11/06 23:02:09
  1359. --- _normsf.cpp    1992/12/18 16:35:41
  1360. ***************
  1361. *** 9,14 ****
  1362. --- 9,17 ----
  1363.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1364.   | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  1365.   |
  1366. + | Revision 1.4.2 olaf 11-92
  1367. + |  + correct stack after overflow.
  1368. + |
  1369.   | Revision 1.4.1 olaf 10-92:
  1370.   |  + corrected rounding in tie case: round up, not down.
  1371.   |    (needed for enquire 4.3)
  1372. ***************
  1373. *** 141,151 ****
  1374.       movel    a7@+,d1
  1375.   #endif    ERROR_CHECK
  1376.   
  1377. !     movel    pc@(__infinitysf),d0    | return infinity value
  1378.   
  1379.       btst    #15,d2        | transfer sign
  1380.       beq    ofl_clear    | (mjr++)
  1381.       bset    #31,d0        |
  1382.       rts
  1383.   ofl_clear:
  1384.       moveml    sp@+,d2-d5    | should really cause trap ?!?
  1385. --- 144,156 ----
  1386.       movel    a7@+,d1
  1387.   #endif    ERROR_CHECK
  1388.   
  1389. ! |    movel    pc@(__infinitysf),d0    | return infinity value
  1390. !     movel   __infinitysf,d0
  1391.   
  1392.       btst    #15,d2        | transfer sign
  1393.       beq    ofl_clear    | (mjr++)
  1394.       bset    #31,d0        |
  1395. +     moveml  sp@+,d2-d5
  1396.       rts
  1397.   ofl_clear:
  1398.       moveml    sp@+,d2-d5    | should really cause trap ?!?
  1399. ===================================================================
  1400. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_truncdf.cpp,v
  1401. retrieving revision 1.2
  1402. diff -c -r1.2 _truncdf.cpp
  1403. *** 1.2    1992/10/09 20:35:29
  1404. --- _truncdf.cpp    1992/12/28 07:56:10
  1405. ***************
  1406. *** 48,54 ****
  1407. --- 48,57 ----
  1408.   |
  1409.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  1410.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1411. + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  1412.   |
  1413. + | Revision 1.2.1 olaf 12-92 :
  1414. + |  + added support for Inf and NaN.
  1415.   |
  1416.   | Revision 1.2, kub 01-90 :
  1417.   | added support for denormalized numbers
  1418. ***************
  1419. *** 70,77 ****
  1420.       movew    d0,d2        | extract sign
  1421.       lsrw    #4,d0
  1422.       andw    #0x7ff,d0    | kill sign bit
  1423.       andl    #0x0fffff,d4    | remove exponent from mantissa
  1424.       tstw    d0        | check for zero exponent - no leading "1"
  1425.       beq    0f        | for denormalized numbers
  1426.       orl    #0x100000,d4    | restore implied leading "1"
  1427. --- 73,96 ----
  1428.       movew    d0,d2        | extract sign
  1429.       lsrw    #4,d0
  1430.       andw    #0x7ff,d0    | kill sign bit
  1431.       andl    #0x0fffff,d4    | remove exponent from mantissa
  1432. + |
  1433. + |
  1434. + |
  1435. +     cmpw    #0x7ff,d0
  1436. +     bne    nospec
  1437. +     orl    d4,d5
  1438. +     bne    retnan
  1439. +     movel   #0x7f800000,d0
  1440. +     tstl    d4
  1441. +     bpl    return
  1442. +     bset    #31,d0
  1443. + return:    moveml    sp@+,d2-d5
  1444. +     rts
  1445. + retnan:    movel    #0x7fffffff,d0
  1446. +     bra    return
  1447. + nospec:    
  1448.       tstw    d0        | check for zero exponent - no leading "1"
  1449.       beq    0f        | for denormalized numbers
  1450.       orl    #0x100000,d4    | restore implied leading "1"
  1451. ===================================================================
  1452. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_udivmod.s,v
  1453. retrieving revision 1.2
  1454. diff -c -r1.2 _udivmod.s
  1455. *** 1.2    1990/04/01 04:41:34
  1456. --- _udivmod.s    1992/11/24 04:14:48
  1457. ***************
  1458. *** 13,21 ****
  1459.   
  1460.       .text
  1461.       .even
  1462. !     .globl    __udivsi3, ___udivsi3
  1463. !     .globl    __umodsi3, ___umodsi3
  1464.   
  1465.   __udivsi3:
  1466.   ___udivsi3:
  1467.       movel    d2,a0        | save registers
  1468. --- 13,22 ----
  1469.   
  1470.       .text
  1471.       .even
  1472. !     .globl    __udivsi3, ___udivsi3, .uldiv
  1473. !     .globl    __umodsi3, ___umodsi3, .ulrem
  1474.   
  1475. + .uldiv:
  1476.   __udivsi3:
  1477.   ___udivsi3:
  1478.       movel    d2,a0        | save registers
  1479. ***************
  1480. *** 65,70 ****
  1481. --- 66,72 ----
  1482.       bra    8b        | back to user
  1483.   
  1484.   
  1485. + .ulrem:
  1486.   __umodsi3:
  1487.   ___umodsi3:
  1488.       movel    sp@(8),sp@-    | push divisor
  1489. ===================================================================
  1490. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bcmp.c,v
  1491. retrieving revision 1.12
  1492. diff -c -r1.12 bcmp.c
  1493. *** 1.12    1992/09/14 14:56:40
  1494. --- bcmp.c    1992/12/18 16:35:43
  1495. ***************
  1496. *** 3,9 ****
  1497.   #include <assert.h>
  1498.   
  1499.   #undef ODD
  1500. ! #define ODD(x) (((long)(x)) & 1L)
  1501.   
  1502.   /*
  1503.    * compare n bytes efficientlty
  1504. --- 3,9 ----
  1505.   #include <assert.h>
  1506.   
  1507.   #undef ODD
  1508. ! #define ODD(x) ((int)((long)(x) & 1L))
  1509.   
  1510.   /*
  1511.    * compare n bytes efficientlty
  1512. ===================================================================
  1513. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/flonum.h,v
  1514. retrieving revision 1.6
  1515. diff -c -r1.6 flonum.h
  1516. *** 1.6    1992/09/14 14:56:40
  1517. --- flonum.h    1992/12/18 16:35:46
  1518. ***************
  1519. *** 33,42 ****
  1520.   };
  1521.   #endif
  1522.   
  1523.   union double_di {
  1524. !         double d;
  1525. !     long   i[2];
  1526.   };
  1527.   
  1528.   union flt_or_int {
  1529.           long  i;
  1530. --- 33,60 ----
  1531.   };
  1532.   #endif
  1533.   
  1534. + #ifdef __TURBOC__
  1535. + # define __IEEE_DOUBLE_EXTENDED__
  1536. + /* IEEE double extended: 80 bits (1 sign + 15 exp + 64 mant) */
  1537. + #else
  1538. + # define __IEEE_DOUBLE_REAL__
  1539. + /* IEEE double real: 64 bits (1 sign + 11 exp + 52 mant) */
  1540. + #endif
  1541. + #ifdef __IEEE_DOUBLE_EXTENDED__
  1542.   union double_di {
  1543. !     double d;
  1544. !     short j[5];  /* a double has 80 bits */
  1545. !     long i[2]; /* for accessing the first 64 bits as long words */
  1546.   };
  1547. + #endif
  1548. + #ifdef __IEEE_DOUBLE_REAL__
  1549. + union double_di {
  1550. +     double d;
  1551. +     long   i[2]; /* a double has 64 bits */
  1552. + };
  1553. + #endif
  1554.   
  1555.   union flt_or_int {
  1556.           long  i;
  1557. ===================================================================
  1558. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fread.c,v
  1559. retrieving revision 1.14
  1560. diff -c -r1.14 fread.c
  1561. *** 1.14    1992/09/14 14:56:40
  1562. --- fread.c    1992/12/18 16:35:48
  1563. ***************
  1564. *** 66,78 ****
  1565.           goto again;
  1566.           }
  1567.           else
  1568.           { /* read in n bytes into data */
  1569. !         if((cnt = _read(fp->_file, data, (unsigned long)n)) != n)
  1570.           {   /* EOF or error */
  1571. !             fp->_flag |= ((cnt >= 0) ? _IOEOF : _IOERR);
  1572.           }
  1573. !         if( cnt>0 )
  1574. !             l += cnt;
  1575.           }
  1576.       }
  1577.       } else {
  1578. --- 66,81 ----
  1579.           goto again;
  1580.           }
  1581.           else
  1582. +         while (n > 0)
  1583.           { /* read in n bytes into data */
  1584. !         if((cnt = _read(fp->_file, data, (unsigned long)n)) <= 0)
  1585.           {   /* EOF or error */
  1586. !             fp->_flag |= ((cnt == 0) ? _IOEOF : _IOERR);
  1587. !             goto ret;
  1588.           }
  1589. !         l += cnt;
  1590. !         data = data + cnt;
  1591. !         n -= cnt;
  1592.           }
  1593.       }
  1594.       } else {
  1595. ***************
  1596. *** 106,118 ****
  1597.           fp->_cnt = cnt;
  1598.           } else {
  1599.           /* read in n bytes into data */
  1600. !         if((cnt = _read(fp->_file, data, (unsigned long)n)) != n)
  1601.           {   /* EOF or error */
  1602. !             fp->_flag |= ((cnt >= 0) ? _IOEOF : _IOERR);
  1603. !             /* if EOF but read bytes still convert CRLF */
  1604. !             if( cnt<=0 ) goto ret;
  1605.           }
  1606. !         ptr=data;
  1607.           while( cnt>0 ) {
  1608.               if( *ptr!='\r' ) {
  1609.               *data++=*ptr++;
  1610. --- 109,126 ----
  1611.           fp->_cnt = cnt;
  1612.           } else {
  1613.           /* read in n bytes into data */
  1614. !         if((cnt = _read(fp->_file, data, (unsigned long)n)) <= 0)
  1615.           {   /* EOF or error */
  1616. !             fp->_flag |= ((cnt == 0) ? _IOEOF : _IOERR);
  1617. !             goto ret;
  1618.           }
  1619. !         /* Quickly move to first CR */
  1620. !         ptr = memchr (data, '\r', cnt);
  1621. !         if (ptr == NULL)
  1622. !           ptr = data + cnt;
  1623. !         cnt -= ptr - data;
  1624. !         n -= ptr - data;
  1625. !         data = ptr;
  1626.           while( cnt>0 ) {
  1627.               if( *ptr!='\r' ) {
  1628.               *data++=*ptr++;
  1629. ***************
  1630. *** 124,131 ****
  1631.               cnt--;
  1632.               }
  1633.           }
  1634. -         if( fp->_flag&_IOEOF )
  1635. -             goto ret;
  1636.           }
  1637.       }
  1638.       }
  1639. --- 132,137 ----
  1640.