home *** CD-ROM | disk | FTP | other *** search
/ telefisk.org / amiga_virus_collection_research.7z / VIRUSRESEARCH / ZAKAPIOR / CMQ060.README < prev    next >
Text File  |  1999-07-11  |  10KB  |  195 lines

  1. Short:    Patch CopyMem/Quick for 68060(040) v1.5
  2. Uploader: dbusse@primus-online.de (Dirk Busse)
  3. Author:   dbusse@primus-online.de (Dirk Busse)
  4. Type:     util/boot
  5. Requires: 68060 or 68040
  6.  
  7. Description:
  8.    This is a small patch which replace the CopyMem and CopyMemQuick
  9.    functions of exec.library.
  10.  
  11.    These functions are optimized for the 68060 processor. They should
  12.    also work with the 68040 processor.
  13.    The patch tests for a 68040 or 060 processor. If it can't find one,
  14.    it doesn't install the patch and exits with a return code of 20 (=fail).
  15.    It also fails, if it can't allocate the necessary memory.
  16.  
  17.    In some cases these new functions are four times faster than the
  18.    original functions.
  19.  
  20. Installation:
  21.    Just copy CMQ060 into c:
  22.    And insert CMQ060 in your s:Startup-Sequence
  23.  
  24. Some notes about Move16:
  25.    Move16 is a new assembler command of the 68040 and 060 processors. It
  26.    moves 16 bytes at once. Therefor it uses burst accesses.
  27.    Andreas Kleinert and Thomas Richter told me, there could be problems with
  28.    the Move16 command on the Amiga. Especially in the Chipram. Caused by
  29.    the DMA of the custom chips.
  30.    I couldn't produce such an error, but maybe on other systems.
  31.    So V1.4+ of CMQ060 doesn't use Move16 from or into memory below $01000000
  32.    (Chipram, ZorroII-Fastram, I/O-Space, Kickstart,...). Move16 is only
  33.    used, when the source and destination addresses are both higher than
  34.    $00ffffff (32-bit-Fastram,...).
  35.  
  36.    (If you didn't get any errors with V1.3 and want to get the most speed
  37.     improvement, you could use CMQ060Move16. This is identically with CMQ060
  38.     V1.3 and uses Move16 also in and from Chipram. But maybe you get
  39.     problems.)
  40.  
  41.    (If you want to avoid all problems which Move16 could cause [the 68040
  42.     has some Move16 bugs], you should use Aminet:util/boot/CMQ030. This one
  43.     never uses Move16 and is still faster than the other available patches.)
  44.  
  45. The source code is also in the archive.
  46.  
  47. Author:
  48.    Dirk Busse
  49.    Kropsburgstraße 8
  50.    D-67141 Neuhofen
  51.    Germany
  52.    <dbusse@primus-online.de>
  53.    <100.141999@germanynet.de>
  54.  
  55. How often are these functions used?
  56.    Some people told me, they couldn't notice a speed improvement.
  57.    You couldn't get a speed improvement by a factor of two. But there is a
  58.    little speed improvement, even if you couldn't notice it.
  59.    To show you how often the patched functions are called, I've inserted two
  60.    modified patches into Version 1.1b of this archive.
  61.    CMQ060beep:
  62.       Every time one of the patched functions CopyMem or CopyMemQuick is
  63.       called, your AMIGA makes a DisplayBeep. After calling LoadWB your
  64.       AMIGA beeps very often per second. If you boot your AMIGA without
  65.       Startup-Sequence and install CMQ060beep, you could see, every AMIGA
  66.       dos command like Dir, List, Avail, Resident... is using the patched
  67.       functions.
  68.       They all are using the CopyMem function. And this is the function with
  69.       the most speed improvement.
  70.    CMQ060beepCMQ:
  71.       This will only make a DisplayBeep, if the patched CopyMemQuick
  72.       function is called. So it shows you which programms are using the
  73.       patched CopyMemQuick function. For Example: PageStream3.3 while moving
  74.       a scrollbar or making a redraw or TeleInfo2 or ... .
  75.    The two above patches aren't for real use. They are only to demonstrate
  76.    how often the functions are used.
  77.  
  78.  
  79. Speed comparision:
  80.    There are already some similar patches available on the Aminet:
  81.       CopyMemQuicker V2.8 from 1994 -> Aminet:util/boot/COPMQR28.lha
  82.       PCM V1.0            from 1996 -> Aminet:util/boot/PCM_1.0.lha
  83.       Also MCP patches these functions.
  84.  
  85.    CopyMemQuicker is optimized for a 68000,010 and 020 processor.
  86.    But on a 68060 (I think also on a 68040) you could get some more
  87.    speed improvement.
  88.  
  89.    PCM is optimized for the 68040 and 060 processor. But some copy modes
  90.    like Long to Even aren't optimized. And the copy mode Long+1 to Even+1
  91.    needs twice the time as the original exec function.
  92.    PCM works only with a 68040 or 060, because it also uses the Move16
  93.    command (see the note above).
  94.  
  95.    In a lot of cases the patched functions from MCP are the slowest of all.
  96.    Some copy modes are even slower than the original Kickstart 3.1
  97.    functions.
  98.  
  99. Here are some test results. All results are measured on the same
  100. AMIGA 2000 with a DKB WildFire060-50MHz:
  101.  
  102. "TestIt" from                                                                 
  103. CopyMemQuicker
  104. V2.8              original  CopyMemQuicker  MCP    PCM CMQ030 CMQ060 CMQ060
  105.                 Kickstart3.1     V2.8     V1.32b12 V1.0 V1.1   V1.4  Move16
  106. CopyMem           routines                                            V1.4
  107. 565×64kB L->L       1.85         1.85       1.85   1.35 1.79   1.31   1.31
  108. 147×64kB L->L+1     1.33         1.14       1.07   1.07 0.47   0.45   0.47
  109. 413×64kB L->E       2.21         2.21       2.21   2.23 1.31   1.31   1.31
  110. 147×64kB L->E+1     1.35         1.15       1.07   1.07 0.45   0.45   0.45
  111. 147×64kB L+1->L     1.35         1.15       0.51   0.47 0.47   0.45   0.47
  112. 382×64kB L+1->L+1   2.11         1.23       2.88   0.91 1.21   0.89   0.87
  113. 147×64kB L+1->E     1.33         1.15       0.81   0.79 0.47   0.45   0.47
  114. 501×64kB L+1->E+1   1.71         1.70       3.81   3.71 1.59   1.57   1.59
  115. 501×64kB E->L       1.71         1.71       1.75   1.59 1.59   1.59   1.59
  116. 147×64kB E->L+1     1.33         1.15       1.11   1.07 0.47   0.47   0.47
  117. 382×64kB E->E       2.11         1.23       2.13   0.91 1.21   0.87   0.89
  118. 147×64kB E->E+1     1.35         1.13       1.13   1.09 0.47   0.45   0.45
  119. 147×64kB E+1->L     1.33         1.15       0.51   0.45 0.45   0.47   0.47
  120. 413×64kB E+1->L+1   2.19         2.19       3.15   3.05 1.31   1.29   1.29
  121. 147×64kB E+1->E     1.33         1.15       0.81   0.79 0.45   0.45   0.45
  122. 564×64kB E+1->E+1   1.81         1.81       4.31   1.35 1.79   1.31   1.31
  123. 33900×1kB L->L      1.10         1.11       1.13   1.31 1.03   1.04   1.07
  124. 9400×1kB L->L+1     1.17         0.93       0.91   0.86 0.29   0.29   0.27
  125. 24000×1kB E->E      1.70         0.80       1.68   0.92 0.74   0.75   0.75
  126. 196000×128B L->L    1.02         0.73       1.03   1.04 0.75   0.75   0.75
  127. 155000×128B E->E    1.61         0.63       1.55   1.05 0.62   0.60   0.59
  128. 588000×19B L->L     0.83         0.60       1.43   0.74 0.50   0.51   0.49
  129. 622000×18B L->L     0.81         0.51       1.43   0.77 0.51   0.49   0.51
  130. 663000×17B L->L     0.75         0.70       1.47   0.73 0.52   0.52   0.50
  131. 956000×16B L->L     0.79         0.71       1.98   1.00 0.58   0.51   0.50
  132. 1060000×8B L->L     0.85         0.79       1.17   1.01 0.58   0.52   0.52
  133. 1430000×4B L->L     0.73         0.61       1.09   1.14 0.45   0.39   0.41
  134. 2190000×1B L->L     0.67         0.61       0.73   0.84 0.33   0.57   0.62
  135. CopyMemQuick
  136. 565×64kB L->L       1.85         1.87       1.85   1.33 1.79   1.31   1.29
  137. 33900×1kB L->L      1.09         1.11       1.13   0.89 1.03   1.03   1.07
  138. 196000×128B L->L    0.99         0.71       1.03   0.81 0.73   0.73   0.73
  139. 956000×16B L->L     0.69         0.63       0.88   0.94 0.38   0.39   0.38
  140. 1060000×8B L->L     0.47         0.57       0.71   0.60 0.40   0.40   0.40
  141. 1430000×4B L->L     0.35         0.51       0.73   0.52 0.23   0.21   0.25
  142.                                                                             
  143. "Test" from
  144. PCM V1.0    ("Test" moves ten times a Block of 500.000 Bytes)
  145. Fast->Fast
  146. CopyMem             0.26         0.26       0.18   0.18 0.24   0.18   0.18
  147. CopyMemQuick        0.26         0.26       0.18   0.20 0.26   0.18   0.18
  148. Chip->Fast
  149. CopyMem             1.98         1.98       1.96   2.16 2.16   2.15   1.98
  150. CopyMemQuick        1.98         1.98       1.98   2.16 2.16   2.16   1.98
  151. Fast->Chip                                                                  
  152. CopyMem             1.92         1.91       1.92   1.90 1.90   1.90   1.90
  153. CopyMemQuick        1.92         1.92       1.92   1.90 1.90   1.88   1.90
  154. Chip->Chip                                                                  
  155. CopyMem             3.64         3.62       3.64   3.70 3.96   3.96   3.72
  156. CopyMemQuick        3.62         3.62       3.62   3.70 3.94   3.94   3.72
  157.  
  158.  
  159. History:
  160.    1.0 (12.Sep.1998)
  161.        - First public version.
  162.    1.1 (15.Sep.1998)
  163.        - V1.0 exits with a return code of 10 (=error), if it can't find
  164.          a 68040 or 68060 or can't get the necessary memory.
  165.          V1.1 exits, in this cases, with a return code of 20 (=fail).
  166.        - Fixed a mistake in the readme.
  167.    1.1b (19.Sep.1998)
  168.        (I didn't changed the Patch itself! It's the same as V1.1)
  169.        - Added the Testresults of MCP V1.30 into the readme.
  170.        - Added CMQ060beep and CMQ060beepCMQ (see above).
  171.    1.2 (29.Nov.1998)
  172.        - Added the Testresults of MCP V1.32b12 into the readme.
  173.        - Changed the source code.
  174.          There was a problem with a wrong written program which expects
  175.          the address of the last source byte +1 in A0 and the address
  176.          of the last destination byte +1 in A1.
  177.          This version of CMQ060 solves problems with such badly programs.
  178.          It's now 100 Bytes longer, but the speed is the same. Big moves
  179.          by the CopyMem function will be one or two cycles faster, but
  180.          you didn't recognize it.
  181.    1.3 (5.Jan.1999)
  182.        All changes made to this version doesn't effect the speed. They
  183.        are only to avoid problems with future versions of AMIGA OS.
  184.        - changed the version string to the "standard" format
  185.        - changed BMI to BCS and BPL to BCC
  186.          -> now CMQ030 could move blocks bigger than 2 GigaByte ;-)
  187.    1.4 (3.Apr.1999)
  188.        - CMQ060 now doesn't use Move16 into/from memory below $01000000
  189.        - added CMQ060Move16 (It's the same as CMQ060 V1.3)
  190.        - added the test results of CMQ030 (Does never use Move16)
  191.    1.5 (11.Jul.1999)
  192.        - Fixed Move16 workaround that rarely caused some problem (Thanks
  193.          for the report Jim)
  194.        - Speed up to one copy section.
  195.