home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-28 | 41.0 KB | 1,699 lines |
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Changelo,v
- retrieving revision 1.83
- diff -c -r1.83 Changelo
- *** 1.83 1992/11/08 00:03:26
- --- Changelo 1992/12/28 07:52:43
- ***************
- *** 3419,3421 ****
- --- 3419,3476 ----
- has to be data addressable ("dmi" constrain should cover).
-
- ---------------------------- Patchlevel 85 ---------------------------
- +
- + _divdf3.cpp:: olaf
- + prevent the tie rounding case if dividing is not exact.
- + paranoia now says: "Division appears to round correctly"
- + ** requires _normdf Version 1.6.1 or later
- +
- + _divmods.s _mulsi3.s _udivmod.s:: ++jrb
- + add c68 labels
- +
- + stdarg.h/varargs.h:: uunet!ms2.maus.de!Bjarne_Pohlers (Bjarne Pohlers)/++jrb
- + bjarne reported a problem with an example in the way we were
- + pull off args from the stack. he had a fix that looked good. i
- + went the gcc-way for the same fix, and used __builtin_next_arg()
- + and let the compiler do the right thing. thanks bjarne.!
- +
- + _addsubd.cpp _addsubs.cpp _divsf3.cpp _normsf.cpp: Olaf
- + Problems solved:
- + * tie breaking for single precision division
- + * prevent core dump for single precision overflow
- +
- + Only one flaw is left for single precision arithmetic!
- +
- + I did a rewrite of the add/sub algorithm; now it is about 10-20% faster.
- +
- + falcon.h: Howard
- + bindings for Falcon. Thanks howard.
- +
- + fread.c:: Andreas
- + With the BSD-like pipes in MiNT 0.96/PL14 one cannot assume, EOF is
- + reached if read() returns less bytes than requested; it could be a
- + short read from a pipe.
- +
- + There's another `feature' in fread: if a big block is read in text
- + mode (!_IOBIN) and the data actually doesn't contain CR's, fread ends
- + up copying the data block onto itself.
- +
- + Synch with mntlib Patchlevel 25: ers
- + ioctl.h:
- + ANYP means "no parity", not "any speed"
- +
- + difftime.c: ++entropy@gnu.ai.mit.edu
- + The parameters were reversed. Ouch.
- + bcmp.c: ++hohmuth@freia.inf.tu-dresden.de
- + Change the ODD macro to return a 16 bit value (for
- + Pure C)
- +
- + Following from andreas:
- + compiler.h: for gcc2, use the builtin sizes
- + gemfast.h: add XCONTROL messages and WF_COLOR defines
- + mintbind.h, osbind.h: add the missing definitions
- + screen.h: fix definitions for TT
- + stdio.h: allow 32 open files as does MiNT
- + wait.h (WSTOPPED): use expected value
- +
- + ---------------------------- Patchlevel 86 ---------------------------
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/PatchLev.h,v
- retrieving revision 1.61
- diff -c -r1.61 PatchLev.h
- *** 1.61 1992/11/08 00:03:31
- --- PatchLev.h 1992/12/28 07:52:46
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "85"
-
- /*
- *
- --- 1,5 ----
-
- ! #define PatchLevel "86"
-
- /*
- *
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/mincl,v
- retrieving revision 1.23
- diff -c -r1.23 mincl
- *** 1.23 1992/11/08 00:03:36
- --- mincl 1992/12/28 07:52:50
- ***************
- *** 3,9 ****
- GLIB1 = _addsubd.o _addsubs.o _cmpdf2.o _cmpsf2.o _divdf3.o _divmods.o \
- _divsf3.o _extends.o _fixdfsi.o _fxunsd.o _fltsi.o \
- _muldf3.o _mulsf3.o _mulsi3.o _negdf2.o _negsf2.o _normdf.o _normsf.o \
- ! _truncdf.o _udivmod.o _umulsi3.o _fixsfsi.o _fltsisf.o
-
- #GLIB2 = gnulib2.o
- GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
- --- 3,9 ----
- GLIB1 = _addsubd.o _addsubs.o _cmpdf2.o _cmpsf2.o _divdf3.o _divmods.o \
- _divsf3.o _extends.o _fixdfsi.o _fxunsd.o _fltsi.o \
- _muldf3.o _mulsf3.o _mulsi3.o _negdf2.o _negsf2.o _normdf.o _normsf.o \
- ! _truncdf.o _udivmod.o _umulsi3.o _fixsfsi.o _fltsisf.o _isnan.o
-
- #GLIB2 = gnulib2.o
- GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubd.cpp,v
- retrieving revision 1.3
- diff -c -r1.3 _addsubd.cpp
- *** 1.3 1992/11/06 23:02:09
- --- _addsubd.cpp 1992/12/28 07:55:59
- ***************
- *** 6,16 ****
- .even
- .globl __subdf3, ___subdf3
- .globl __adddf3, ___adddf3
- ! #ifndef sfp004
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- | Revision 1.3.2 olaf 10-92 :
- | + increased comparson by one again. (Dont understand, but it works)
- --- 6,29 ----
- .even
- .globl __subdf3, ___subdf3
- .globl __adddf3, ___adddf3
- ! # ifndef sfp004
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- + |
- + | Revision 1.3.4 olaf 11-92 :
- + | + added support for NaN and infinities
- + | > floating point is now excellent!
- + |
- + | -- still lacks trap handling for exceptions
- + | -- dont know the external representation of quiet and signaling NaN
- + | I decided 0x7fffffff,ffffffff to be a quiet NaN
- + | the rest should be signaling (but isnt)
- + |
- + | Revision 1.3.3 olaf 11-92 :
- + | + changed to get rid of rounding bits. a sticky register (d3) is
- + | sufficient.
- |
- | Revision 1.3.2 olaf 10-92 :
- | + increased comparson by one again. (Dont understand, but it works)
- ***************
- *** 60,72 ****
- andw #0x07ff,d1 | kill sign bit
-
- andl #0x0fffff,d6 | remove exponent from u.mantissa
- ! tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d6 | restore implied leading "1"
- bra 1f
- 0: addw #1,d0 | "normalize" exponent
- 1:
- - andl #0x0fffff,d4 | remove exponent from v.mantissa
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d4 | restore implied leading "1"
- --- 73,149 ----
- andw #0x07ff,d1 | kill sign bit
-
- andl #0x0fffff,d6 | remove exponent from u.mantissa
- ! andl #0x0fffff,d4 | remove exponent from v.mantissa
- ! |
- ! | Now perform testing of NaN And infinities
- ! |
- ! cmpw #0x07ff,d0
- ! beq 0f
- ! cmpw #0x07ff,d1
- ! bne nospec
- ! bra 1f
- ! | first operand is special
- ! |
- ! 0: cmpw d0,d1
- ! beq bothspec
- ! |
- ! | u is special
- ! |
- ! movel d7,d0
- ! orl d6,d0
- ! bne retnan | arith with Nan gives always Nan
- !
- ! movel a0@(8),d0 | copy infinity
- ! clrl d1
- ! bra return
- ! |
- ! | v is special
- ! |
- ! 1: movel d5,d0
- ! orl d4,d0
- ! bne retnan
- ! movel a0@,d0
- ! clrl d1
- ! bra return
- ! |
- ! | u and v are both special
- ! |
- ! bothspec:
- ! movel d7,d0
- ! orl d6,d0
- ! orl d5,d0
- ! orl d4,d0
- ! beq bothinf
- ! bra retnan
- ! |
- ! | Both are infinities Test if cancellation
- ! |
- ! bothinf:
- ! tstw d2
- ! bpl retinf
- ! |
- ! | return a quiet NaN
- ! |
- ! retnan: movel #0x7fffffff,d0
- ! moveql #-1,d1
- ! bra return
- !
- ! retinf: movel #0x7ff00000,d0
- ! clrl d1
- ! tstl d2
- ! bpl return
- ! bchg #31,d0
- ! return: moveml sp@+,d2-d7
- ! rts
- ! |
- ! | Ok, no inifinty or Nan involved..
- ! |
- ! nospec: tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d6 | restore implied leading "1"
- bra 1f
- 0: addw #1,d0 | "normalize" exponent
- 1:
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d4 | restore implied leading "1"
- ***************
- *** 73,79 ****
- bra 1f
- 0: addw #1,d1 | "normalize" exponent
- 1:
- ! clrw d3 | (put initial zero rounding bits in d3)
- negw d1 | d1 = u.exp - v.exp
- addw d0,d1
- beq 5f | exponents are equal - no shifting neccessary
- --- 150,156 ----
- bra 1f
- 0: addw #1,d1 | "normalize" exponent
- 1:
- ! clrl d3 | init sticky register
- negw d1 | d1 = u.exp - v.exp
- addw d0,d1
- beq 5f | exponents are equal - no shifting neccessary
- ***************
- *** 88,111 ****
- 1:
- cmpw #55,d1 | is u so much bigger that v is not
- bge 7f | significant ?
- !
- ! movew #10-1,d3 | shift u left up to 10 bits to minimize loss
- ! 2:
- ! addl d7,d7
- addxl d6,d6
- subw #1,d0 | decrement exponent
- ! subw #1,d1 | done shifting altogether ?
- ! dbeq d3,2b | loop if still can shift u.mant more
- ! clrw d3
- ! clrb d2 | clear "sticky byte"
- ! 3:
- cmpw #16,d1 | see if fast rotate possible
- blt 4f
- ! orb d5,d3 | set rounding bits
- ! orb d2,d3
- ! sne d2 | "sticky byte"
- ! movew d5,d3
- ! lsrw #8,d3
- movew d4,d5 | rotate by swapping register halfs
- swap d5
- clrw d4
- --- 165,189 ----
- 1:
- cmpw #55,d1 | is u so much bigger that v is not
- bge 7f | significant ?
- ! |
- ! | shift mantissa left two digits, to allow cancellation of
- ! | most significant digit, while gaining an additional digit for
- ! | rounding.
- ! |
- ! moveql #1,d3
- ! 2: addl d7,d7
- addxl d6,d6
- subw #1,d0 | decrement exponent
- ! subw #1,d1 | decrement counter
- ! dbeq d3,2b
- ! clrl d3
- ! |
- ! | now shift other mantissa right as fast as possible (almost).
- ! |
- ! 3:
- cmpw #16,d1 | see if fast rotate possible
- blt 4f
- ! orw d5,d3 | set sticky word
- movew d4,d5 | rotate by swapping register halfs
- swap d5
- clrw d4
- ***************
- *** 112,132 ****
- swap d4
- subw #16,d1
- bra 3b
- ! 0:
- lsrl #1,d4 | shift v.mant right the rest of the way
- roxrl #1,d5 | to line it up with u.mant
- - orb d3,d2 | set "sticky byte" if necessary
- - roxrb #1,d3 | shift into rounding bits
- 4: dbra d1,0b | loop
- ! andb #1,d2 | see if "sticky bit" should be set
- ! orb d2,d3
- 5:
- tstw d2 | are the signs equal ?
- bpl 6f | yes, no negate necessary
- !
- ! negb d3 | negate rounding bits and v.mant
- ! negxl d5
- negxl d4
- 6:
- addl d5,d7 | u.mant = u.mant + v.mant
- addxl d4,d6
- --- 190,218 ----
- swap d4
- subw #16,d1
- bra 3b
- !
- ! 0: moveb d5,d2 | use d2.b as scratch
- ! andb #1,d2 | test if 1 is shifted out
- ! orb d2,d3 | and put it in sticky
- lsrl #1,d4 | shift v.mant right the rest of the way
- roxrl #1,d5 | to line it up with u.mant
- 4: dbra d1,0b | loop
- !
- 5:
- tstw d2 | are the signs equal ?
- bpl 6f | yes, no negate necessary
- ! |
- ! | negate secand mantissa. One has to check the sticky word in order
- ! | to correct the twos complement.
- ! |
- ! tstw d3 |
- ! beq 9f | No cerrection necessary
- ! clrl d1
- ! addql #1,d5
- ! addxl d1,d4
- ! 9: negl d5
- negxl d4
- +
- 6:
- addl d5,d7 | u.mant = u.mant + v.mant
- addxl d4,d6
- ***************
- *** 134,148 ****
- tstw d2 | opposite signs ?
- bpl 7f | do not need to negate result
-
- - negb d3 | negate rounding bits and u.mant
- negl d7
- negxl d6
- ! notl d2 | switch sign
- 7:
- movel d6,d4 | move result for normalization
- movel d7,d5
- ! moveb d3,d1 | put rounding bits in d1 for norm_df
- ! swap d2 | put sign into d2 (exponent is in d0)
- jmp norm_df | leave registers on stack for norm_df
- #else sfp004
- | double precision floating point stuff for Atari-gcc using the SFP004
- --- 220,236 ----
- tstw d2 | opposite signs ?
- bpl 7f | do not need to negate result
-
- negl d7
- negxl d6
- ! notl d2 | switch sign
- 7:
- movel d6,d4 | move result for normalization
- movel d7,d5
- ! clrl d1
- ! tstl d3
- ! beq 8f
- ! moveql #-1,d1
- ! 8: swap d2 | put sign into d2 (exponent is in d0)
- jmp norm_df | leave registers on stack for norm_df
- #else sfp004
- | double precision floating point stuff for Atari-gcc using the SFP004
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubs.cpp,v
- retrieving revision 1.3
- diff -c -r1.3 _addsubs.cpp
- *** 1.3 1992/11/06 23:02:09
- --- _addsubs.cpp 1992/12/28 07:56:00
- ***************
- *** 10,17 ****
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- ! | patched by Olaf Flebbe (flebbe@tat.physik.un-tuebingen.de)
- |
- | Revision 1.3.2 olaf 10-92 :
- | + increased comparson by one again. (Dont understand, but it works)
- | + corrected negation of rounding bits and mantissa
- --- 10,29 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- ! | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.3.4 olaf 11-92 :
- + | + added support for NaN and infinities
- + | > paranoia now dont complains about unbalanced range any more
- + | -- still lacks trap handling for exceptions
- + | -- dont know the external representation of quiet and signaling NaN
- + | I decided 0x7fffffff to be a quiet NaN
- + | the rest should be signaling (but isnt)
- + |
- + | Revision 1.3.3 olaf 11-92 :
- + | + changed to get rid of rounding bits. a sticky register (d3) is
- + | sufficient.
- + |
- | Revision 1.3.2 olaf 10-92 :
- | + increased comparson by one again. (Dont understand, but it works)
- | + corrected negation of rounding bits and mantissa
- ***************
- *** 63,75 ****
- andw #0xff,d1 | kill sign bit (exponent is 8 bits)
-
- andl #0x7fffff,d5 | remove exponent from mantissa
- ! tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d5 | restore implied leading "1"
- bra 1f
- 0: addw #1,d0 | "normalize" exponent
- 1:
- - andl #0x7fffff,d4 | remove exponent from mantissa
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d4 | restore implied leading "1"
- --- 75,143 ----
- andw #0xff,d1 | kill sign bit (exponent is 8 bits)
-
- andl #0x7fffff,d5 | remove exponent from mantissa
- ! andl #0x7fffff,d4 | remove exponent from mantissa
- ! |
- ! | Now perform testing of NaN And infinities
- ! |
- ! cmpb #0xff,d0
- ! beq 0f
- ! cmpb #0xff,d1
- ! bne nospec
- ! bra 1f
- ! | first operand is special
- ! |
- ! 0: cmpb d0,d1
- ! beq bothspec
- ! |
- ! | u is special
- ! |
- ! tstl d5
- ! bne retnan | arith with Nan gives always Nan
- !
- ! movel a0@(4),d0 | copy infinity
- ! bra return
- ! |
- ! | v is special
- ! |
- ! 1: tstl d4
- ! bne retnan
- ! movel a0@,d0
- ! bra return
- ! |
- ! | u and v are both special
- ! |
- ! bothspec:
- ! movel d5,d0
- ! orl d4,d0
- ! beq bothinf
- ! bra retnan
- ! |
- ! | Both are infinities Test if cancellation
- ! |
- ! bothinf:
- ! tstw d2
- ! bpl retinf
- ! |
- ! | return a quiet NaN
- ! |
- ! retnan: movel #0x7fffffff,d0
- ! bra return
- !
- ! retinf: movel #0x7f800000,d0
- ! tstl d2
- ! bpl return
- ! bchg #31,d0
- ! return: moveml sp@+,d2-d5
- ! rts
- ! |
- ! | Ok, no inifinty or Nan involved..
- ! |
- ! nospec: tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d5 | restore implied leading "1"
- bra 1f
- 0: addw #1,d0 | "normalize" exponent
- 1:
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d4 | restore implied leading "1"
- ***************
- *** 76,82 ****
- bra 1f
- 0: addw #1,d1 | "normalize" exponent
- 1:
- ! clrw d3 | (put initial zero rounding bits in d3)
- negw d1 | d1 = u.exp - v.exp
- addw d0,d1
- beq 5f | exponents are equal - no shifting neccessary
- --- 144,150 ----
- bra 1f
- 0: addw #1,d1 | "normalize" exponent
- 1:
- ! clrl d3 | (put initial zero rounding bits in d3)
- negw d1 | d1 = u.exp - v.exp
- addw d0,d1
- beq 5f | exponents are equal - no shifting neccessary
- ***************
- *** 90,129 ****
- 1:
- cmpw #26,d1 | is u so much bigger that v is not
- bge 7f | significant ?
- !
- ! movew #7-1,d3 | shift u left up to 7 bits to minimize loss
- ! 2:
- ! addl d5,d5
- subw #1,d0 | decrement exponent
- subw #1,d1 | done shifting altogether ?
- dbeq d3,2b | loop if still can shift u.mant more
- ! clrw d3
- ! clrb d2
-
- cmpw #16,d1 | see if fast rotate possible
- blt 4f
- ! orb d4,d3 | set rounding bits
- ! orb d2,d3
- ! sne d2 | "sticky byte"
- ! movew d4,d3
- ! lsrw #8,d3
- ! clrw d4 | rotate by swapping register halfs
- swap d4
- subw #16,d1
- bra 4f
- ! 0:
- lsrl #1,d4 | shift v.mant right the rest of the way
- - orb d3,d2 | set "sticky byte" if necessary
- - roxrb #1,d3 | shift into rounding bits
- 4: dbra d1,0b | loop
- ! andb #1,d2 | see if "sticky bit" should be set
- ! orb d2,d3
- 5:
- tstw d2 | are the signs equal ?
- bpl 6f | yes, no negate necessary
-
- ! negb d3 | negate rounding bits and v.mant
- ! negxl d4
- 6:
- addl d4,d5 | u.mant = u.mant + v.mant
- bcs 7f | needn not negate
- --- 158,199 ----
- 1:
- cmpw #26,d1 | is u so much bigger that v is not
- bge 7f | significant ?
- ! |
- ! | shift mantissa left two digits, to allow cancellation of
- ! | most significant digit, while gaining an additional digit for
- ! | rounding.
- ! |
- ! moveql #1,d3
- ! 2: addl d5,d5
- subw #1,d0 | decrement exponent
- subw #1,d1 | done shifting altogether ?
- dbeq d3,2b | loop if still can shift u.mant more
- ! clrl d3
-
- cmpw #16,d1 | see if fast rotate possible
- blt 4f
- ! orw d4,d3 | set rounding bits
- ! clrw d4
- swap d4
- subw #16,d1
- bra 4f
- !
- ! 0: moveb d4,d2
- ! andb #1,d2
- ! orb d2,d3
- lsrl #1,d4 | shift v.mant right the rest of the way
- 4: dbra d1,0b | loop
- !
- 5:
- tstw d2 | are the signs equal ?
- bpl 6f | yes, no negate necessary
-
- !
- ! tstw d3 | negate rounding bits and v.mant
- ! beq 9f
- ! addql #1,d4
- ! 9: negl d4
- !
- 6:
- addl d4,d5 | u.mant = u.mant + v.mant
- bcs 7f | needn not negate
- ***************
- *** 130,142 ****
- tstw d2 | opposite signs ?
- bpl 7f | do not need to negate result
-
- ! negb d3 | negate rounding bits and u.mant
- ! negxl d5
- notl d2 | switch sign
- 7:
- movel d5,d4 | move result for normalization
- ! moveb d3,d1 | put rounding bits in d1 for norm_sf
- ! swap d2 | put sign into d2 (exponent is in d0)
- jmp norm_sf | leave registers on stack for norm_sf
-
- # else sfp004
- --- 200,214 ----
- tstw d2 | opposite signs ?
- bpl 7f | do not need to negate result
-
- ! negl d5
- notl d2 | switch sign
- 7:
- movel d5,d4 | move result for normalization
- ! clrl d1
- ! tstl d3
- ! beq 8f
- ! moveql #-1,d1
- ! 8: swap d2 | put sign into d2 (exponent is in d0)
- jmp norm_sf | leave registers on stack for norm_sf
-
- # else sfp004
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_cmpdf2.s,v
- retrieving revision 1.3
- diff -c -r1.3 _cmpdf2.s
- *** 1.3 1992/10/09 20:35:29
- --- _cmpdf2.s 1992/12/28 07:56:02
- ***************
- *** 1,37 ****
- | double floating point compare routine
- |
- ! | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- ! | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- |
- - |
- - | Revision 1.1, kub 12-89 :
- - | Ported over to 68k assembler
- - |
- - | Revision 1.0:
- - | original 8088 code from P.S.Housel
-
- .text
- .even
- .globl __cmpdf2, ___cmpdf2
- ! | additional entry points for gcc2
- ! .globl ___eqdf2, ___nedf2, ___gtdf2, ___gedf2, ___ltdf2, ___ledf2
- !
- __cmpdf2:
- ___cmpdf2:
- ___eqdf2:
- ___nedf2:
- ___gtdf2:
- ! ___gedf2:
- ! ___ltdf2:
- ___ledf2:
- ! moveml sp@(4),d0-d1/a0-a1 | get u and v
- tstl d0 | check sign bit
- bpl 1f
- negl d1 | negate
- negxl d0
- bchg #31,d0 | toggle sign bit
- ! 1:
- ! exg a0,d0
- exg a1,d1
- tstl d0 | check sign bit
- bpl 2f
- --- 1,97 ----
- | double floating point compare routine
- |
- ! | written by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- ! | Based on a 68k floating point packet from Kai-Uwe Bloem, itself based
- ! | on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- ! |
- ! | Revision 2.0: olaf 12-92.
- |
-
- .text
- .even
- + .globl ___eqdf2, ___nedf2
- + .globl ___gtdf2, ___ledf2
- + .globl ___gedf2, ___ltdf2
- .globl __cmpdf2, ___cmpdf2
- !
- __cmpdf2:
- ___cmpdf2:
- ___eqdf2:
- ___nedf2:
- + moveml sp@(4),d0-d1/a0-a1 | get numbers to compare with
- + tstl d0 | check sign bit
- + bpl 1f
- + negl d1 | negate
- + negxl d0
- + bchg #31,d0 | toggle sign bit
- +
- + 1: exg a0,d0
- + exg a1,d1
- + tstl d0 | check sign bit
- + bpl 2f
- + negl d1 | negate
- + negxl d0
- + bchg #31,d0 | toggle sign bit
- +
- + 2: cmpl d1,a1
- + bne 4f
- + cmpl d0,a0
- + bne 4f
- + bclr #31,d0
- + cmpl #0x7ff00000,d0 | NaN is not equal NaN !
- + bgt 4f
- + blt 3f
- + tstl d1
- + bne 4f
- + 3: clrl d0
- + rts
- +
- + 4: moveql #1,d0
- + rts
- +
- ___gtdf2:
- ! moveml sp@(4),d0-d1/a0-a1 | get numbers to compare with
- ! tstl d0 | check sign bit
- ! bpl 1f
- ! negl d1 | negate
- ! negxl d0
- ! bchg #31,d0 | toggle sign bit
- !
- ! 1: exg a0,d0
- ! exg a1,d1
- ! tstl d0 | check sign bit
- ! bpl 2f
- ! negl d1 | negate
- ! negxl d0
- ! bchg #31,d0 | toggle sign bit
- !
- ! 2: exg a0,d0
- ! exg a1,d1
- ! cmpl a0,d0
- ! bgt 4f | d0 > a0 Test if NaN (should be false!)
- ! blt 3f |
- ! cmpl a1,d1
- ! bhi 4f
- ! 3: clrl d0 | Test is false.
- ! rts
- ! 4: bclr #31,d0
- ! cmpl #0x7ff00000,d0 | First operand == NaN =?
- ! bgt 3b
- ! blt 5f | It is finite!
- ! tstl d1
- ! bne 3b | It *is* a NaN
- ! 5: moveql #1,d0 | Test True
- ! rts
- !
- ___ledf2:
- ! moveml sp@(4),d0-d1/a0-a1 | get numbers to compare with
- tstl d0 | check sign bit
- bpl 1f
- negl d1 | negate
- negxl d0
- bchg #31,d0 | toggle sign bit
- !
- ! 1: exg a0,d0
- exg a1,d1
- tstl d0 | check sign bit
- bpl 2f
- ***************
- *** 38,56 ****
- negl d1 | negate
- negxl d0
- bchg #31,d0 | toggle sign bit
- ! 2:
- ! cmpl d0,a0
- ! blt lt
- ! bgt gt
- cmpl d1,a1
- ! bhi gt
- ! beq eq
- ! lt:
- ! moveq #-1,d0
- rts
- ! eq:
- ! clrl d0
- rts
- ! gt:
- ! moveq #1,d0
- rts
- --- 98,184 ----
- negl d1 | negate
- negxl d0
- bchg #31,d0 | toggle sign bit
- !
- ! 2: cmpl d0,a0
- ! blt 4f
- ! bgt 3f
- cmpl d1,a1
- ! bls 4f | <= !
- ! 3: moveql #1,d0 | Test is false
- ! rts
- ! 4: bclr #31,d0
- ! cmpl #0x7ff00000,d0 | First operand == NaN =?
- ! bgt 3b
- ! blt 5f | It is finite!
- ! tstl d1
- ! bne 3b | It *is* a NaN
- ! 5: clrl d0 | Test true
- ! rts
- !
- ! ___gedf2:
- ! moveml sp@(4),d0-d1/a0-a1 | get numbers to compare with
- ! tstl d0 | check sign bit
- ! bpl 1f
- ! negl d1 | negate
- ! negxl d0
- ! bchg #31,d0 | toggle sign bit
- !
- ! 1: exg a0,d0
- ! exg a1,d1
- ! tstl d0 | check sign bit
- ! bpl 2f
- ! negl d1 | negate
- ! negxl d0
- ! bchg #31,d0 | toggle sign bit
- !
- ! 2: exg a0,d0
- ! exg a1,d1
- ! cmpl a0,d0
- ! bgt 4f
- ! blt 3f
- ! cmpl a1,d1
- ! beq 4f | >= !
- ! bhi 4f
- ! 3: moveql #-1,d0 | False
- ! rts
- ! 4: bclr #31,d0
- ! cmpl #0x7ff00000,d0 | First operand == NaN =?
- ! bgt 3b
- ! blt 5f | It is finite!
- ! tstl d1
- ! bne 3b | It *is* a NaN
- ! 5: clrl d0 | Test True
- rts
- !
- ! ___ltdf2:
- ! moveml sp@(4),d0-d1/a0-a1 | get numbers to compare with
- ! tstl d0 | check sign bit
- ! bpl 1f
- ! negl d1 | negate
- ! negxl d0
- ! bchg #31,d0 | toggle sign bit
- !
- ! 1: exg a0,d0
- ! exg a1,d1
- ! tstl d0 | check sign bit
- ! bpl 2f
- ! negl d1 | negate
- ! negxl d0
- ! bchg #31,d0 | toggle sign bit
- !
- ! 2: cmpl d0,a0
- ! blt 4f
- ! bgt 3f
- ! cmpl d1,a1
- ! beq 3f
- ! bls 4f
- ! 3: clrl d0
- rts
- ! 4: bclr #31,d0
- ! cmpl #0x7ff00000,d0 | First operand == NaN =?
- ! bgt 3b
- ! blt 5f | It is finite!
- ! tstl d1
- ! bne 3b | It *is* a NaN
- ! 5: moveql #-1,d0 | Test True
- rts
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divdf3.cpp,v
- retrieving revision 1.2
- diff -c -r1.2 _divdf3.cpp
- *** 1.2 1992/10/09 20:35:29
- --- _divdf3.cpp 1992/12/28 07:56:03
- ***************
- *** 44,49 ****
- --- 44,60 ----
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- |
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- + |
- + | Revision 1.2.2 olaf 12-92
- + | + added support for NaN and Infinites
- + | + added support for -0
- + |
- + | Revision 1.2.1 olaf 11-92
- + | + prevent the tie rounding case if dividing is not exact.
- + | > paranoia now says: "Division appears to round correctly"
- + | ** requires _normdf Version 1.6.1 or later
- + |
- | Revision 1.2, kub 01-90 :
- | added support for denormalized numbers
- |
- ***************
- *** 72,100 ****
- andw #0x07ff,d1 | kill sign bit
-
- andl #0x0fffff,d4 | remove exponent from u.mantissa
- ! tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d4 | restore implied leading "1"
- bra 1f
- 0: addw #1,d0 | "normalize" exponent
- - 1: movel d4,d3
- - orl d5,d3
- - beq retz | dividing zero
-
- ! andl #0x0fffff,d6 | remove exponent from v.mantissa
- ! tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d6 | restore implied leading "1"
- bra 1f
- 0: addw #1,d1 | "normalize" exponent
- - 1: movel d6,d3
- - orl d7,d3
- -
- - #ifndef ERROR_CHECK
- - beq divz | divide by zero
- - #endif ERROR_CHECK
-
- ! movew d2,a0 | save sign
-
- subw d1,d0 | subtract exponents,
- addw #BIAS8-11+1,d0 | add bias back in, account for shift
- --- 83,168 ----
- andw #0x07ff,d1 | kill sign bit
-
- andl #0x0fffff,d4 | remove exponent from u.mantissa
- ! andl #0x0fffff,d6 | remove exponent from v.mantissa
- ! |
- ! |
- ! |
- ! cmpw #0x7ff,d0
- ! beq 0f |u == NaN || u== Inf
- ! cmpw #0x7ff,d1
- ! beq 1f | v == NaN || v == Inf
- ! tstw d0
- ! bne 3f | u not zero nor denorm
- ! movel d5,d3
- ! orl d4,d3
- ! beq 2f | 0/ ?
- !
- ! 3: tstw d1
- ! bne nospec
- !
- ! movel d7,d3
- ! orl d6,d3
- ! bne nospec
- ! bra retinf | x/0 -> +/- Inf
- !
- ! 0: orl d5,d4 | u == NaN ?
- ! bne retnan | NaN/ x
- ! cmpw #0x7ff,d1
- ! beq retnan | Inf/Inf or Inf/NaN
- ! bra retinf | Inf/x | x != Inf && x != NaN
- !
- ! 1: orl d7,d6
- ! bne retnan | x/NaN
- ! bra retzero | x/Inf -> +/- 0
- !
- ! 2: tstw d1
- ! bne retzero | 0/x ->+/- 0
- ! orl d5,d4
- ! bne retzero | 0/x
- ! bra retnan | 0/0
- ! |
- ! | Return Infinity with correct sign
- ! |
- ! retinf: clrl d1
- ! tstl d2
- ! bpl 0f
- ! movel #0xfff00000,d0
- ! return: moveml sp@+,d2-d7
- ! rts
- !
- ! 0: movel #0x7ff00000,d0
- ! bra return
- ! |
- ! | Return NaN
- ! |
- ! retnan: movel #0x7fffffff,d0
- ! moveql #-1,d1
- ! bra return
- ! |
- ! | Return correct signed zero
- ! |
- ! retzero:clrl d0 | zero destination
- ! clrl d1
- ! tstl d2
- ! bmi return
- ! bset #31,d0
- ! bra return
- ! |
- ! | End of special handling
- ! |
- ! nospec: tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d4 | restore implied leading "1"
- bra 1f
- 0: addw #1,d0 | "normalize" exponent
-
- ! 1: tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d6 | restore implied leading "1"
- bra 1f
- 0: addw #1,d1 | "normalize" exponent
-
- ! 1: movew d2,a0 | save sign
-
- subw d1,d0 | subtract exponents,
- addw #BIAS8-11+1,d0 | add bias back in, account for shift
- ***************
- *** 129,159 ****
- notl d2 | invert quotient to get it right
- notl d3
-
- ! movel d2,d4 | save quotient mantissa
- movel d3,d5
- movew a0,d2 | get sign back
- - clrw d1 | zero rounding bits
- jmp norm_df | (registers on stack removed by norm_df)
- -
- - retz: clrl d0 | zero destination
- - clrl d1
- - moveml sp@+,d2-d7
- - rts | no normalization needed
- -
- - #ifndef ERROR_CHECK
- - | NOTE: __infinitydf is in the text segment
- - divz: moveml __infinitydf,d0-d1 | return infinity value
- - moveml sp@+,d2-d7 | should really cause trap ?!?
- -
- - btst #31,a7@(4) | transfer sign of dividend
- - beq clear | (mjr++)
- - bset #31,d0 |
- - rts |
- - clear: |
- - bclr #31,d0 |
- - rts
- -
- - #endif ERROR_CHECK
-
- #else
-
- --- 197,210 ----
- notl d2 | invert quotient to get it right
- notl d3
-
- ! movel d5,d1
- ! orl d4,d1 | check for exact result
- ! beq 1f
- ! moveql #-1,d1 | Set rounding bits for tie case
- ! 1: movel d2,d4 | save quotient mantissa
- movel d3,d5
- movew a0,d2 | get sign back
- jmp norm_df | (registers on stack removed by norm_df)
-
- #else
-
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divmods.s,v
- retrieving revision 1.2
- diff -c -r1.2 _divmods.s
- *** 1.2 1990/04/01 04:41:12
- --- _divmods.s 1992/11/24 04:14:46
- ***************
- *** 14,22 ****
-
- .text
- .even
- ! .globl __divsi3, ___divsi3
- ! .globl __modsi3, ___modsi3
-
- __divsi3:
- ___divsi3:
- movel d2,a0 | save registers
- --- 14,23 ----
-
- .text
- .even
- ! .globl __divsi3, ___divsi3, .ldiv
- ! .globl __modsi3, ___modsi3, .lrem
-
- + .ldiv:
- __divsi3:
- ___divsi3:
- movel d2,a0 | save registers
- ***************
- *** 83,88 ****
- --- 84,90 ----
- bra 8b | back to user
-
-
- + .lrem:
- __modsi3:
- ___modsi3:
- movel sp@(8),sp@- | push divisor
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divsf3.cpp,v
- retrieving revision 1.2
- diff -c -r1.2 _divsf3.cpp
- *** 1.2 1992/10/09 20:35:29
- --- _divsf3.cpp 1992/12/18 16:35:40
- ***************
- *** 43,49 ****
- --- 43,55 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.2.1 olaf 11-92
- + | + prevent the tie rounding case if dividing is not exact.
- + | > paranoia now says: "Division appears to round correctly"
- + | ** requires _normsf Version 1.4.2 or later
- + |
- | Revision 1.2, kub 01-90 :
- | added support for denormalized numbers
- |
- ***************
- *** 117,124 ****
- 5: subw #2,d0 | remove rounding offset for denormalized nums
- notl d3 | invert quotient to get it right
-
- ! movel d3,d4 | save quotient mantissa
- ! clrw d1 | zero rounding bits
- jmp norm_sf | (registers on stack removed by norm_sf)
-
- # ifndef ERROR_CHECK
- --- 123,133 ----
- 5: subw #2,d0 | remove rounding offset for denormalized nums
- notl d3 | invert quotient to get it right
-
- ! clrl d1 | zero rounding bits
- ! tstl d4 | check for exact result
- ! beq 1f
- ! moveql #-1,d1 | prevent tie case
- ! 1: movel d3,d4 | save quotient mantissa
- jmp norm_sf | (registers on stack removed by norm_sf)
-
- # ifndef ERROR_CHECK
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_muldf3.cpp,v
- retrieving revision 1.2
- diff -c -r1.2 _muldf3.cpp
- *** 1.2 1992/10/09 20:35:29
- --- _muldf3.cpp 1992/12/28 07:56:04
- ***************
- *** 58,64 ****
- --- 58,68 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.2.1 olaf 12-92:
- + | + added support for NaN and Infinites
- + | + added support for -0
- |
- | Revision 1.2, kub 01-90 :
- | added support for denormalized numbers
- ***************
- *** 74,80 ****
- lea sp@(4),a0
- moveml d2-d7,sp@-
- moveml a0@,d4-d5/d6-d7 | d4-d5 = v, d6-d7 = u
- - subw #16,sp | multiplication accumulator
-
- movel d6,d0 | d0 = u.exp
- swap d0
- --- 78,83 ----
- ***************
- *** 89,94 ****
- --- 92,145 ----
- andw #0x07ff,d1 | kill sign bit
-
- andl #0x0fffff,d6 | remove exponent from u.mantissa
- + andl #0x0fffff,d4 | remove exponent from v.mantissa
- + |
- + | Testing for NaN and Infinities
- + |
- + cmpw #0x7ff,d0
- + beq 0f
- + cmpw #0x7ff,d1
- + bne nospec
- + bra 1f
- + | first operand is special
- + | Nan?
- + 0: orl d7,d6
- + bne retnan
- + | Test v==0.
- + tstw d1
- + bne retinf | Inf * x == Inf
- + orl d5,d4
- + beq retnan | Inf * 0 == NaN
- + retinf:
- + clrl d1
- + tstl d2
- + bpl 0f
- + movel #0xfff00000,d0
- + return: moveml sp@+,d2-d7
- + rts
- +
- +
- + 0: movel #0x7ff00000,d0
- + bra return
- +
- + retnan: movel #0x7fffffff,d0
- + moveql #-1,d1
- + bra return
- + |
- + | v is special
- + |
- + 1: orl d5,d4
- + bne retnan
- + tstw d0
- + bne retinf
- + orl d7,d6
- + beq retnan
- + bra retinf
- + |
- + | end of NaN and Inf.
- + |
- + nospec: subw #16,sp | multiplication accumulator
- +
- tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d6 | restore implied leading "1"
- ***************
- *** 98,104 ****
- orl d7,d3
- beq retz | multiplying by zero
-
- - andl #0x0fffff,d4 | remove exponent from v.mantissa
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x100000,d4 | restore implied leading "1"
- --- 149,154 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_mulsi3.s,v
- retrieving revision 1.1
- diff -c -r1.1 _mulsi3.s
- *** 1.1 1990/03/26 17:37:16
- --- _mulsi3.s 1992/11/24 04:14:47
- ***************
- *** 11,18 ****
-
- .text
- .even
- ! .globl __mulsi3, ___mulsi3
-
- __mulsi3:
- ___mulsi3:
- movel d2,a0 | save registers
- --- 11,20 ----
-
- .text
- .even
- ! .globl __mulsi3, ___mulsi3, .lmul, .ulmul
-
- + .lmul:
- + .ulmul:
- __mulsi3:
- ___mulsi3:
- movel d2,a0 | save registers
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_negdf2.s,v
- retrieving revision 1.2
- diff -c -r1.2 _negdf2.s
- *** 1.2 1992/10/09 20:35:29
- --- _negdf2.s 1992/12/28 07:56:05
- ***************
- *** 2,8 ****
- --- 2,12 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | revision 1.1.1, olaf 12-92
- + | + Since sign of NaN is ignored, we can flip it.
- + | + -0. is different from 0., but compares equal!
- |
- | Revision 1.1, kub 12-89 :
- | Ported over to 68k assembler
- ***************
- *** 16,24 ****
-
- __negdf2: | floating point negate
- ___negdf2:
- ! movel sp@(4),d0 | do not negate if operand is 0.0
- ! orl sp@(8),d0
- ! moveml sp@(4),d0-d1 | get number
- ! beq 0f
- bchg #31,d0 | flip sign bit
- ! 0: rts
- --- 20,25 ----
-
- __negdf2: | floating point negate
- ___negdf2:
- ! moveml sp@(4),d0-d1
- bchg #31,d0 | flip sign bit
- ! rts
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_normdf.cpp,v
- retrieving revision 1.6
- diff -c -r1.6 _normdf.cpp
- *** 1.6 1992/11/06 23:02:09
- --- _normdf.cpp 1992/12/28 07:56:08
- ***************
- *** 9,14 ****
- --- 9,17 ----
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.6.2 olaf 12-92:
- + | + added support for -0.
- + |
- | Revision 1.6.1 olaf 10-92:
- | + corrected rounding in tie case: round up, not down.
- | (needed for enquire 4.3)
- ***************
- *** 173,182 ****
-
- retz:
- moveq #ERANGE,d0
- ! Emove d0,Errno
- clrl d0 | return zero value
- clrl d1
- ! moveml sp@+,d2-d7
- rts
-
- oflow:
- --- 176,188 ----
-
- retz:
- moveq #ERANGE,d0
- ! Emove d0,Errno
- clrl d0 | return zero value
- clrl d1
- ! tstw d2
- ! bpl 0f | -0
- ! bset #31,d0
- ! 0: moveml sp@+,d2-d7
- rts
-
- oflow:
- ***************
- *** 189,195 ****
- Emove d0,Errno
- #endif ERROR_CHECK
-
- ! moveml pc@(__infinitydf),d0-d1 | return infinity value
- andw #0x8000,d2 | get sign bit of argument
- swap d2
- clrw d2
- --- 195,202 ----
- Emove d0,Errno
- #endif ERROR_CHECK
-
- ! | moveml pc@(__infinitydf),d0-d1 | return infinity value
- ! moveml __infinitydf,d0-d1 | return infinty value
- andw #0x8000,d2 | get sign bit of argument
- swap d2
- clrw d2
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_normsf.cpp,v
- retrieving revision 1.3
- diff -c -r1.3 _normsf.cpp
- *** 1.3 1992/11/06 23:02:09
- --- _normsf.cpp 1992/12/18 16:35:41
- ***************
- *** 9,14 ****
- --- 9,17 ----
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.4.2 olaf 11-92
- + | + correct stack after overflow.
- + |
- | Revision 1.4.1 olaf 10-92:
- | + corrected rounding in tie case: round up, not down.
- | (needed for enquire 4.3)
- ***************
- *** 141,151 ****
- movel a7@+,d1
- #endif ERROR_CHECK
-
- ! movel pc@(__infinitysf),d0 | return infinity value
-
- btst #15,d2 | transfer sign
- beq ofl_clear | (mjr++)
- bset #31,d0 |
- rts
- ofl_clear:
- moveml sp@+,d2-d5 | should really cause trap ?!?
- --- 144,156 ----
- movel a7@+,d1
- #endif ERROR_CHECK
-
- ! | movel pc@(__infinitysf),d0 | return infinity value
- ! movel __infinitysf,d0
-
- btst #15,d2 | transfer sign
- beq ofl_clear | (mjr++)
- bset #31,d0 |
- + moveml sp@+,d2-d5
- rts
- ofl_clear:
- moveml sp@+,d2-d5 | should really cause trap ?!?
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_truncdf.cpp,v
- retrieving revision 1.2
- diff -c -r1.2 _truncdf.cpp
- *** 1.2 1992/10/09 20:35:29
- --- _truncdf.cpp 1992/12/28 07:56:10
- ***************
- *** 48,54 ****
- --- 48,57 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.2.1 olaf 12-92 :
- + | + added support for Inf and NaN.
- |
- | Revision 1.2, kub 01-90 :
- | added support for denormalized numbers
- ***************
- *** 70,77 ****
- movew d0,d2 | extract sign
- lsrw #4,d0
- andw #0x7ff,d0 | kill sign bit
- -
- andl #0x0fffff,d4 | remove exponent from mantissa
- tstw d0 | check for zero exponent - no leading "1"
- beq 0f | for denormalized numbers
- orl #0x100000,d4 | restore implied leading "1"
- --- 73,96 ----
- movew d0,d2 | extract sign
- lsrw #4,d0
- andw #0x7ff,d0 | kill sign bit
- andl #0x0fffff,d4 | remove exponent from mantissa
- + |
- + |
- + |
- + cmpw #0x7ff,d0
- + bne nospec
- + orl d4,d5
- + bne retnan
- + movel #0x7f800000,d0
- + tstl d4
- + bpl return
- + bset #31,d0
- + return: moveml sp@+,d2-d5
- + rts
- + retnan: movel #0x7fffffff,d0
- + bra return
- +
- + nospec:
- tstw d0 | check for zero exponent - no leading "1"
- beq 0f | for denormalized numbers
- orl #0x100000,d4 | restore implied leading "1"
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_udivmod.s,v
- retrieving revision 1.2
- diff -c -r1.2 _udivmod.s
- *** 1.2 1990/04/01 04:41:34
- --- _udivmod.s 1992/11/24 04:14:48
- ***************
- *** 13,21 ****
-
- .text
- .even
- ! .globl __udivsi3, ___udivsi3
- ! .globl __umodsi3, ___umodsi3
-
- __udivsi3:
- ___udivsi3:
- movel d2,a0 | save registers
- --- 13,22 ----
-
- .text
- .even
- ! .globl __udivsi3, ___udivsi3, .uldiv
- ! .globl __umodsi3, ___umodsi3, .ulrem
-
- + .uldiv:
- __udivsi3:
- ___udivsi3:
- movel d2,a0 | save registers
- ***************
- *** 65,70 ****
- --- 66,72 ----
- bra 8b | back to user
-
-
- + .ulrem:
- __umodsi3:
- ___umodsi3:
- movel sp@(8),sp@- | push divisor
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bcmp.c,v
- retrieving revision 1.12
- diff -c -r1.12 bcmp.c
- *** 1.12 1992/09/14 14:56:40
- --- bcmp.c 1992/12/18 16:35:43
- ***************
- *** 3,9 ****
- #include <assert.h>
-
- #undef ODD
- ! #define ODD(x) (((long)(x)) & 1L)
-
- /*
- * compare n bytes efficientlty
- --- 3,9 ----
- #include <assert.h>
-
- #undef ODD
- ! #define ODD(x) ((int)((long)(x) & 1L))
-
- /*
- * compare n bytes efficientlty
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/flonum.h,v
- retrieving revision 1.6
- diff -c -r1.6 flonum.h
- *** 1.6 1992/09/14 14:56:40
- --- flonum.h 1992/12/18 16:35:46
- ***************
- *** 33,42 ****
- };
- #endif
-
- union double_di {
- ! double d;
- ! long i[2];
- };
-
- union flt_or_int {
- long i;
- --- 33,60 ----
- };
- #endif
-
- + #ifdef __TURBOC__
- + # define __IEEE_DOUBLE_EXTENDED__
- + /* IEEE double extended: 80 bits (1 sign + 15 exp + 64 mant) */
- + #else
- + # define __IEEE_DOUBLE_REAL__
- + /* IEEE double real: 64 bits (1 sign + 11 exp + 52 mant) */
- + #endif
- +
- + #ifdef __IEEE_DOUBLE_EXTENDED__
- union double_di {
- ! double d;
- ! short j[5]; /* a double has 80 bits */
- ! long i[2]; /* for accessing the first 64 bits as long words */
- };
- + #endif
- +
- + #ifdef __IEEE_DOUBLE_REAL__
- + union double_di {
- + double d;
- + long i[2]; /* a double has 64 bits */
- + };
- + #endif
-
- union flt_or_int {
- long i;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fread.c,v
- retrieving revision 1.14
- diff -c -r1.14 fread.c
- *** 1.14 1992/09/14 14:56:40
- --- fread.c 1992/12/18 16:35:48
- ***************
- *** 66,78 ****
- goto again;
- }
- else
- { /* read in n bytes into data */
- ! if((cnt = _read(fp->_file, data, (unsigned long)n)) != n)
- { /* EOF or error */
- ! fp->_flag |= ((cnt >= 0) ? _IOEOF : _IOERR);
- }
- ! if( cnt>0 )
- ! l += cnt;
- }
- }
- } else {
- --- 66,81 ----
- goto again;
- }
- else
- + while (n > 0)
- { /* read in n bytes into data */
- ! if((cnt = _read(fp->_file, data, (unsigned long)n)) <= 0)
- { /* EOF or error */
- ! fp->_flag |= ((cnt == 0) ? _IOEOF : _IOERR);
- ! goto ret;
- }
- ! l += cnt;
- ! data = data + cnt;
- ! n -= cnt;
- }
- }
- } else {
- ***************
- *** 106,118 ****
- fp->_cnt = cnt;
- } else {
- /* read in n bytes into data */
- ! if((cnt = _read(fp->_file, data, (unsigned long)n)) != n)
- { /* EOF or error */
- ! fp->_flag |= ((cnt >= 0) ? _IOEOF : _IOERR);
- ! /* if EOF but read bytes still convert CRLF */
- ! if( cnt<=0 ) goto ret;
- }
- ! ptr=data;
- while( cnt>0 ) {
- if( *ptr!='\r' ) {
- *data++=*ptr++;
- --- 109,126 ----
- fp->_cnt = cnt;
- } else {
- /* read in n bytes into data */
- ! if((cnt = _read(fp->_file, data, (unsigned long)n)) <= 0)
- { /* EOF or error */
- ! fp->_flag |= ((cnt == 0) ? _IOEOF : _IOERR);
- ! goto ret;
- }
- ! /* Quickly move to first CR */
- ! ptr = memchr (data, '\r', cnt);
- ! if (ptr == NULL)
- ! ptr = data + cnt;
- ! cnt -= ptr - data;
- ! n -= ptr - data;
- ! data = ptr;
- while( cnt>0 ) {
- if( *ptr!='\r' ) {
- *data++=*ptr++;
- ***************
- *** 124,131 ****
- cnt--;
- }
- }
- - if( fp->_flag&_IOEOF )
- - goto ret;
- }
- }
- }
- --- 132,137 ----
-