home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / rtl / tpl60n17 / readme.doc < prev    next >
Encoding:
Text File  |  1992-10-12  |  20.0 KB  |  422 lines

  1.      Turbo-Pascal 6.0 Runtime Libary Update - Release 1.7   10-12-1992
  2.  
  3.  
  4.      This library is a complete replacement for the runtime library that
  5.      came with your Turbo Pascal 6.0 compiler. Due to lots of optimizations,
  6.      programs compiled with this version of TURBO.TPL will be faster.
  7.      This library maintains 99.9% compatibility with the original library.
  8.      Differences are usually due to enhancements and should not cause
  9.      any compatibility problems. Some bugs from the original library
  10.      supplied by Borland have been eliminated, but there can be no guarantee
  11.      that new ones have not crept in. If you discover any bugs, or have
  12.      other comments, please let me know. My email and snail mail addresses
  13.      are given below. Due to the nature of Borland's licensing of the
  14.      TPL source code I am not allowed to distribute the source code of
  15.      my enhanced library, so I can only provide the binary.
  16.  
  17.  
  18.      THIS VERSION OF THE LIBRARY REPLACEMENT FOR TP 6.0 IS THE FINAL VERSION.
  19.      NO FURTHER UPDATES WILL BE MADE, SINCE A NEW TURBO PASCAL VERSION (7.0)
  20.      WILL BE OUT BY THE END OF 1992!!
  21.  
  22.  
  23.      Original library code is Copyright (C) 1983,91 Borland International
  24.  
  25.      New / additional library code is Copyright (C) 1988-1992
  26.      Norbert Juffa, Wielandtstr. 14, 7500 Karlsruhe 1, Germany
  27.      Internet: S_JUFFA@IRAVCL.IRA.UKA.DE
  28.  
  29.  
  30.  
  31.      Contents of this document:
  32.  
  33.      I.   Capabilities of RTL replacement
  34.      II.  Revision History
  35.      III. References
  36.  
  37.  
  38.  
  39.      I. Capabilities of RTL replacement
  40.      ==================================
  41.  
  42.      Improvements in SYSTEM module
  43.      -----------------------------
  44.  
  45. o    REAL type software arithmetic operations now comply with ANSI/IEEE
  46.      Standard 754-1985 for Binary Floating Point Arithmetic [1,2] as much
  47.      as possible. Note that REAL arithmetic by design differs from the
  48.      standard in many ways, especially available numeric formats, value
  49.      set, and available operations. The rounding mode implemented here
  50.      is "round to nearest or even" as specified in the standard. Add,
  51.      Subtract, Multiply, Squaring, Division, and Square Root deliver
  52.      exact results with regard to this rounding mode, as demanded by the
  53.      standard. Conversions from REAL to LONGINT and from EXTENDED to REAL
  54.      use rounding to nearest or even, as specified in the standard. Correct
  55.      implementation of above features was tested with the PARANOIA test
  56.      program [3]. The correctness of basic REAL arithmetic functions has
  57.      also been tested against the coprocessor/emulator EXTENDED format
  58.      with the program FUN1_TST. The EXTENDED format carries approximately
  59.      19 decimal digits of precision.
  60.  
  61. o    REAL arithmetic operations have been sped up. Speed up is fourfold for
  62.      SQRT (up to 22x on a 80386), twofold for FRAC and between 30% and 70%
  63.      for SIN, COS, ARCTAN, LN, EXP and division (2.8x speed up for division
  64.      on 80386). Overall numeric processing power using REAL arithmetic
  65.      increases by about 34% for an 8086 and by 45% for an 80386 as measured
  66.      by the WHETSTONE benchmark [4,5].
  67.  
  68. o    Overall accuracy of REAL arithmetic transcendental functions has been
  69.      improved as indicated by Cody&Waite's ELEFUNT tests [6]: DLOG, DEXP,
  70.      DATAN, DSIN. Correct argument reduction ensures that relative error
  71.      over the whole argument range does not exceed 1.9e-12 for Exp, 2.8e-12
  72.      for Arctan, and 2.7e-12 for Ln. These values have been determined
  73.      by comparing the function returns of the REAL transcendental functions
  74.      to the values computed with a Cyrix 83D87 coprocessor for the EXTENDED
  75.      format. For Sin and Cos, relative error is also in the above range
  76.      when the argument is reasonably small (e.g. in range -100..100) and
  77.      not very close to an integer multiple of 0.25*Pi.
  78.  
  79. o    Execution of coprocessor floating point computations using an 80287 or
  80.      80387 has been accelerated. For these coprocessors, NOPs will be inserted
  81.      before every floating point instruction converted from an emulator
  82.      interrupt instead of WAITs. As a result of this optimization, an
  83.      improvement in execution speed of 14% has been observed running the
  84.      Lawrence Livermore Loops (LLL) [7] on a Cyrix 83D87, the improvement
  85.      for the WHETSTONE benchmark on the 83D87 is 9.4%. Maximum performance
  86.      gain for tight loops (e.g. fractal computation) by this measre is about
  87.      22%.
  88.  
  89. o    On a 80287XL, 80387, or 80846 the Sin and Cos functions take advantage
  90.      of the FSIN and FCOS instructions of these coprocessors, speeding up
  91.      these functions by almost a factor of two. As a side effect, there is
  92.      also some improvement in accuracy as measured by the DSIN test program
  93.      from the ELEFUNT test suite. Also, the Arctan function takes advantage
  94.      of the increased argument range of the FPATAN function. These
  95.      optimizations result in another 19% increase in WHETSTONE power, so
  96.      that the total combined speedup over the original library is 30%
  97.      for this benchmark.
  98.  
  99. o    STRING operations are faster, especially for longer strings. Most
  100.      dramatic increase is in the INSERT function, with execution times
  101.      reduced to up to one fourth compared with the original version of
  102.      the RTL. Faster string operations cause 7% performance increase for
  103.      the DHRYSTONE [8,9] benchmark on a 8086.
  104.  
  105. o    Improved speed of random number generation. Random for REAL numbers
  106.      is 10% faster, Random for EXTENDED numbers is 5% faster, no speed
  107.      difference for Integer Random function.
  108.  
  109. o    Binary to decimal conversions used in Str and Write procedures have
  110.      been sped up by up to 70% for integers (BYTE, SHORTINT, INTEGER,
  111.      WORD, LONGINT), up to 5% for REAL numbers and about 3% for EXTENDED
  112.      numbers.
  113.  
  114. o    Improved speed of LONGINT arithmetic. Division enjoys fourfold
  115.      reduction of execution time on 8086, for an 80386 the speed up
  116.      factor is 6.7.
  117.  
  118. o    Several of the functions of the heap manager have been tuned,
  119.      giving up to 10% faster operation for these routines.
  120.  
  121. o    Set functions have been sped up by a few percent, but the add
  122.      variable range operation may be up to eight times as fast.
  123.  
  124. o    UPCASE function has been enhanced to support the complete IBM character
  125.      set. This means that characters ä,ü,ö,å,æ,é,ñ,ç are converted to upper
  126.      case by this function.
  127.  
  128. o    Several bugs of the original RTL supplied by Borland have been fixed:
  129.  
  130.      Using REAL arithmetic in $N- mode, Trunc and Round could not produce
  131.      the smallest legal LONGINT number -2147483648. Arguments that should
  132.      result in this number caused a run time error 207 instead. Trunc/Round
  133.      now will return the correct result of -2147483648. Correct implementation
  134.      can be checked using the ROUNDTST program.
  135.  
  136.      The Random function could return 1.0 when compiled in the $N+ state,
  137.      although the specifications call for a return value 0 <= Random < 1.
  138.      This has been corrected. Return values from Random are strictly
  139.      smaller than 1 now.
  140.  
  141.      GetDir now correctly returns a run-time error 15 (invalid drive)
  142.      when called with a non existent drive. Differing from the original,
  143.      it also signals all errors reported by DOS as run-time errors. E.g.
  144.      when applied to a floppy drive that does not contain a floppy, it
  145.      will now return run-time error 152 (drive not ready), where previously
  146.      it would incorrectly signal successful completion of the operation
  147.      (InOutRes = 0).
  148.  
  149.      LONGINT Read and Val routines now accept the smallest LONGINT
  150.      number -2147483648 as decimal input.
  151.  
  152.      For programs compiled with $N+, only true INFs are printed out as
  153.      INF where with the original library some NaNs are also printed as
  154.      INF. Correct operation can be tested with the INFBUG program.
  155.  
  156.      Addition/Subtraction of REAL arithmetic sometimes was unnecessarily
  157.      inaccurate due to incorrect handling of discarded digits of the
  158.      operand with smaller absolute value. This has been fixed with the
  159.      introduction of a completely new add/subtract routine.
  160.  
  161.      Multiplication of REAL numbers by small integers was inaccurate,
  162.      causing among others problems unnecessary inaccuracies in binary
  163.      <-> decimal conversion. This has been eliminated with the new
  164.      REAL arithmetic modules.
  165.  
  166.      REAL arithmetic EXP functions no longer signals overflow when
  167.      called with small arguments, but underflows to zero instead as it
  168.      should.
  169.  
  170.      Denormals in EXTENDED computations no longer cause invalid state
  171.      on 8087 coprocessor when being converted to true zeros. Consistency
  172.      between register contents and tag bits is now asserted. Removal of
  173.      this bug can be tested with the BUG87 program.
  174.  
  175.      Denormals in EXTENDED format are now correctly converted to decimal
  176.      strings by the Str and Write routines. The original routines printed
  177.      EXTENDED precision denormals as zero. Note that TP 6.0 supports
  178.      EXTENDED denormals only if your machine has an 80287XL, 80387, 80486
  179.      or equivalent. On the 8087 and Intel's original 80287 coprocessor
  180.      denormals are only supported for the SINGLE and DOUBLE formats.
  181.  
  182.      Stack checking routine for programs compiled in the $S+ state now
  183.      reliably detects all stack overflows. This bug in TP 6.0 has also
  184.      been fixed in the second release of TP 6.0 by Borland, but Borland's
  185.      code is slower than the one used here.
  186.  
  187.      Program initialization routine now tries to prevent that programs
  188.      compiled with the $G+ (286 code generation) switch are run on 8086
  189.      and 8088. The checks done are not 100% safe, but catch most of these
  190.      cases, displaying the message "CPU > 8086 required" and aborting the
  191.      program with a return code of 254 ($FE) instead of letting it crash.
  192.      Note that this check lets programs compiled with $G+ run on 80186 and
  193.      V20/V30 processors, since these have the ability to execute all 80286
  194.      real mode instructions produced by Turbo Pascal.
  195.  
  196. o    Improved functionality only marginally increases overall code length
  197.      of the SYSTEM unit by 631 bytes (about 2.9%). This is due to careful
  198.      optimizing in numerous routines. Most programs compiled with the new
  199.      RTL will be smaller due to finer granularity of the RTL modules.
  200.      Savings are usually in the 0.5-1 KB range for reasonably large programs.
  201.  
  202.  
  203.      Improvements in DOS module
  204.      --------------------------
  205.  
  206. o    Decreased code size by careful optimization of register usage in
  207.      some routines.
  208.  
  209.  
  210.      Improvements in CRT module
  211.      --------------------------
  212.  
  213. o    Bug fix in routine DirectWrite. The method used to prevent "snow"
  214.      when writing directly to a CGA graphics card was not entirely save.
  215.      When used in a heavily interrupted program (e.g. serial communication
  216.      as a background task), it would not always write during the time
  217.      when scanning was in the invisible parts of the screen. The method
  218.      used now is 100% save and is even faster, since it takes advantage
  219.      of the horizontal and vertical retrace periods, as opposed to the
  220.      old method which only used the horizontal retrace time. New routine
  221.      has been tested successfully on original IBM-CGA card.
  222.  
  223.  
  224.  
  225.      II. Revision History
  226.      ====================
  227.  
  228.      Changes since version 1.6, dated 08-31-92
  229.      -----------------------------------------
  230.  
  231. o    The Round function for REAl arithmetic would sometimes not return the
  232.      correct IEEE-rounded result due to wrong handling of the sticky flag.
  233.      This has been fixed.
  234.  
  235. o    Size of the RTL has been reduced a bit.
  236.  
  237.  
  238.      Changes since version 1.5, dated 06-10-92
  239.      -----------------------------------------
  240.  
  241. o    The Test8087 variable would sometimes contain the wrong value when
  242.      the environment conatined the string 87=Y. This has been fixed.
  243.  
  244. o    Speed and accuracy of the REAL arithmetic Sin und Cos functions have
  245.      been enhanced. The previously introduced limits for arguments to these
  246.      functions have been removed. Sin and Cos now accept all REAL numbers
  247.      as arguments without producing a run-time error, just like the routines
  248.      in the original TP 6.0 RTL. Due to the nature of the argument reduction
  249.      scheme now used, the accuracy of the Sin and Cos functions takes a
  250.      rather sharp drop if the arguments exceed an absolute value of about 1e8.
  251.      Outside this range, accuracy is about the same as for the Sin and Cos
  252.      from the original library. There is a gradual loss of precision towards
  253.      bigger arguments. For arguments with an absolute value of more than
  254.      about 5e12, there is a total loss of precision. Sin always returns 0,
  255.      Cos always returns 1 for arguments exceeding this limit.
  256.  
  257.  
  258.      Changes since version 1.4, dated 05-07-92
  259.      -----------------------------------------
  260.  
  261. o    Fixed fatal bug in the Reset procedure. When applying Reset to an
  262.      already open file, the procedure would crash the program during
  263.      the automatic closing of the file before reopening it. This bug was
  264.      reported by Chris Dennis (dennis_c@kosmos.wcc.govt.nz). Thanks!
  265.  
  266. o    Fixed bug in the Float->String conversion routine of the original RTL
  267.      that caused EXTENDED precision denormals to be printed as zero. The
  268.      conversion routine has been further enhanced to correctly print
  269.      unnormals on machines with a 387 or 486. Note that these processors
  270.      do not support unnormals, whereas the 8087 and 287 do. The original
  271.      RTL only prints unnormals correctly on machines that have a coprocessor
  272.      that supports this format. Since it is possible that unnormal numbers
  273.      stored by a 8087/287 are loaded into a 387/486, e.g. via a binary data
  274.      file, the conversion routine was changed to handle unnormals on all
  275.      processors. Note that due to this change, there is a difference in
  276.      printout between the original RTL and this RTL on machines with a
  277.      8087/287. The original RTL prints unnormals in an unnormalized format
  278.      e.g. -0.2777289e-4387, whereas this library prints unnormals in a
  279.      normalized format, e.g. -2.777289e-4388. The new conversion routine
  280.      can handle all EXTENDED encodings, even those not supported by the
  281.      387/486 processors [10]. Zeroes and Pseudozeros are printed as zero,
  282.      NaNs, Pseudo-NaNs, and Indefinite (a special NaN) are printed as NAN,
  283.      Infinities and Pseudoinfinities are printed as INF, unnormals are
  284.      printed the same way as normals/denormals after normalizing them as
  285.      much as possible.
  286.  
  287. o    Improved speed and accuracy of REAL ArcTan function.
  288.  
  289. o    Improved speed and accuracy of REAL Exp function.
  290.  
  291. o    Improved speed of REAL addition/subtraction and Round/Trunc to match
  292.      more closely the speed of these routines in the original RTL. These
  293.      routines had suffered a drop in performance due to increased accuracy
  294.      requirements before.
  295.  
  296.  
  297.      Changes since version 1.3, dated 05-01-92
  298.      -----------------------------------------
  299.  
  300. o    Fixed bug that set Test8087 variable incorrectly for 8087/80287
  301.      coprocessors.
  302.  
  303. o    Fixed bug in REAL Ln function error return. It would return the biggest
  304.      possible REAL number before if called with an argument <= 0. It now
  305.      correctly raises error 207 (invalid floating-point operation).
  306.  
  307.  
  308.      Changes since version 1.2, dated 11-01-92
  309.      -----------------------------------------
  310.  
  311. o    Fixed bug in Rename procedure. Due to this error, Rename would not
  312.      work at all, but always return with error code 3 (path not found).
  313.      This has been corrected. This error was reported by ShinKuang Chang
  314.      (skchang@csemail.cropsci.ncsu.edu). Thanks!
  315.  
  316. o    Cleaned up the source code of the ELEFUNT test programs a bit. Since
  317.      these programs were ported from the FORTRAN original in a 'quick and
  318.      dirty' way, they were looking quite messy.
  319.  
  320.  
  321.      Changes since version 1.1 beta, dated 04-01-92
  322.      ----------------------------------------------
  323.  
  324. o    The Round and Trunc functions were unable to produce the smallest
  325.      LONGINT number, -2147483648. If a call to these functions resulted
  326.      in this number, an error was raised instead of returning the correct
  327.      result. This has been fixed. Valid inputs to the Trunc functions are
  328.      REAL numbers x for which -2147483649 < x < 2147483648 holds. Valid
  329.      inputs to the Round function are numbers x for which -2147483648.5
  330.      <= x < 2147483647.5 holds.
  331.  
  332.  
  333.      Changes since first beta release (version 1.0, dated 03-21-92)
  334.      --------------------------------------------------------------
  335.  
  336. o    Fixed bug in the routine that adds variable ranges to sets (as in
  337.      s := [foo..bar], where s is a set and foo and bar are variables of
  338.      the set's base type.
  339.  
  340. o    Switched back code in the REAL add/subtract routine to plain 8086
  341.      code. Forgot to remove the use386 flag when building code for the
  342.      original release 1.0 beta.
  343.  
  344.  
  345.      Changes since the alpha release
  346.      -------------------------------
  347.  
  348. o    There was an error in the 8087 float to string conversion in the
  349.      alpha release which has been fixed.
  350.  
  351. o    A bug in the coprocessor identification that sets the Test8087 variable
  352.      present in the alpha release has been fixed.
  353.  
  354. o    For string -> LONGINT conversion, it is now possible to input the
  355.      smallest LONGINT number -2147483648 in decimal.
  356.  
  357. o    An enhanced argument reduction has been implemented for REAL arithmetic
  358.      SIN, COS, and EXP function, delivering much more accurate results over
  359.      the complete argument range. This has slowed these functions down
  360.      somewhat, however, none of them runs slower than in the original TP 6.01
  361.      RTL. As a result of the new argument reduction, arguments to SIN and
  362.      COS are restricted to the range -3.37325e9..3.37325e9 now. Arguments to
  363.      these functions were previously unrestricted. For arguments outside the
  364.      range given, an error 207 will result. This is consistent with the
  365.      coprocessor/emulator generated SIN/COS functions, that also signal
  366.      error 207 for arguments out of range (-9.22337e18..9.22337e18).
  367.  
  368. o    SIN, COS, and ARCTAN functions compiled in the $N+ state will now use
  369.      the faster coprocessor instructions available on the 387 and 486 if
  370.      such a coprocessor/FPU is present.
  371.  
  372. o    A check has been included to prevent programs compiled with $G+ (286 code
  373.      generation) to run on a 8086.
  374.  
  375. o    The Random function has been fixed to return values strictly smaller than
  376.      1 when compiled with $N+.
  377.  
  378.  
  379.  
  380.      III. References
  381.      ===============
  382.  
  383. [1]  IEEE: IEEE Standard for Binary Floating-Point Arithmetic.
  384.      SIGPLAN Notices, Vol. 22, No. 2, 1985, pp. 9-25
  385.  
  386. [2]  IEEE Standard for Binary Floating-Point Arithmetic.
  387.      ANSI/IEEE Std 754-1985.
  388.      New York, NY: Institute of Electrical and Electronics Engineers 1985
  389.  
  390. [3]  Karpinski, R.: Paranoia: A Floating-Point Benchmark.
  391.      Byte, February 1985, pp. 223-235
  392.  
  393. [4]  Curnow, H.J.; Wichmann, B.A.: A synthetic benchmark.
  394.      Computer Journal, Vol. 19, No. 1, 1976, pp. 43-49
  395.  
  396. [5]  Wichmannn, B.A.: Validation code for the Whetstone benchmark.
  397.      NPL Report DITC 107/88, National Physics Laboratory, UK, March 1988
  398.  
  399. [6]  Cody, W.J.; Waite, W.: Software Manual for the Elementary Functions.
  400.      Englewood Cliffs, NJ: Prentice Hall 1980
  401.  
  402. [7]  McMahon, H.H.: The Livermore Fortran Kernels: A Test of the Numerical
  403.      Performance Range.
  404.      Technical Report UCRL-53745, Lawrence Livermore National Laboratory,
  405.      December 1986, p. 179
  406.  
  407. [8]  Weicker, R.P.: Dhrystone: A Synthetic Systems Programming Benchmark.
  408.      Communications of the ACM, Vol. 27, No. 10, October 1984, pp. 1013-1030
  409.  
  410. [9]  Weicker, R.P.: Dhrystone Benchmark: Rationale for Version 2 and
  411.      Measurement Rules.
  412.      SIGPLAN Notices, Vol. 23, No. 8, August 1988, pp. 49-62
  413.  
  414. [10] 387DX User's Manual, Programmer's Reference. Intel 1989
  415.  
  416.  
  417.      Note:
  418.  
  419.      PARANOIA, DHRYSTONE, WHETSTONE, LLL, and ELEFUNT source code is
  420.      available from NETLIB@ORNL.GOV
  421.  
  422.