home *** CD-ROM | disk | FTP | other *** search
/ Really Useful CD 1 / ReallyUsefulCD1.iso / extras / progutils / arm_divide / readme < prev   
Encoding:
Text File  |  1991-06-12  |  2.2 KB  |  59 lines

  1. comp.sys.acorn (890/892)
  2. From: zrzm0370@rusmv1.rus.uni-stuttgart.de (Joerg Scheurich)
  3. Newsgroups: comp.sys.acorn
  4. Subject: integer division
  5. Message-ID: <1991Jun10.112536.15897@rusmv1.rus.uni-stuttgart.de>
  6. Date: 10 Jun 91 11:25:36 GMT
  7. Sender: zrzm0370@rusmv1.rus.uni-stuttgart.de (Joerg Scheurich)
  8. Organization: Comp.Center (RUS), U of Stuttgart, FRG
  9. Lines: 92
  10.  
  11. Posting-number: Volume 01, Issue 07
  12. Submitted-by: MUFTI
  13. Archive-name: Division Macros/part01
  14.  
  15. Hi 
  16.  
  17. So i know, there is no Assembler-command for integer-division in the 
  18. ARM. Therefor a fast division-routine is a thing of common interest.
  19.  
  20. In a earlier Posting i wrote about the bad quick hacked division-routine
  21. for the demo of my formula-tool (math. formula ==> assemblermacros).
  22.  
  23. Now i wrote a better routine, but i don't know, if there is a better 
  24. algorithm.
  25.  
  26. The shorter and slower 32-Bit/32-Bit-division-routine requires
  27. 382     Cycles in 100 Bytes, with usage of 4 32-Bit-registers and 4 Byte memory.
  28. With unrolling the loop,
  29. the faster  and longer 32-Bit/32-Bit-division-routine requires 
  30. 182     Cycles in 692 Bytes, with usage of 4 32-Bit-registers.
  31.   
  32. This is very faster then the old routine (which requires 2**33 Cycles in 
  33. worst case and requires all time of the universe, if there is a division
  34. by zero ... )
  35.  
  36. Cause the INTERNAL-assembler-command of the INTEL 8086
  37. for a                  32-Bit/16-Bit-division  requires
  38. 165-184 Cycles in 2-4 Bytes, with usage of 3  16-Bit-registers,
  39. i think, the result is ok.   
  40.  
  41. The result is nothing against the INTERNAL-assembler-command of the ARM
  42. for a                  32-Bit*32-Bit-multiplication which  requires
  43. 17     Cycles in    4 Bytes, with usage of 1-3 32-Bit-registers,
  44. but my Professor in digital electronics used to say:
  45. "If a program contain much divisions, the programmer is a idiot" ...
  46.  
  47. Know someone a better (faster or shorter) algorithm ?
  48.  
  49. so long
  50. MUFTI
  51.  
  52. ( internet:    zrzm0111@helpdesk.rus.uni-stuttgart.de
  53.   ( from janet: zrzm0111%de.uni-stuttgart.rus.helpdesk@NFS-RELAY )
  54.   bitnet:      ZRZM  AT DS0RUS1I )
  55.  
  56. This is not a posting of a binary. Cause the readable routines contains very 
  57. much linefeeds and spaces, I send them in submit-extract-format (41 lines). 
  58.  
  59.