home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / forth / 3683 < prev    next >
Encoding:
Internet Message Format  |  1992-12-27  |  4.4 KB

  1. Path: sparky!uunet!paladin.american.edu!gatech!pitt!willett!ForthNet
  2. From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie)
  3. Newsgroups: comp.lang.forth
  4. Subject: Hardware ONLY issues
  5. Message-ID: <4192.UUL1.3#5129@willett.pgh.pa.us>
  6. Date: 27 Dec 92 12:23:37 GMT
  7. Organization: EIEI-U
  8. Lines: 108
  9.  
  10. Category 9,  Topic 2
  11. Message 127       Sat Dec 26, 1992
  12. ELLIOTT.C                    at 13:40 EST
  13.  
  14.  -----via CRS Premium Bulletin Board -
  15.  USR Dual Standard 16.8K  (416) 629-7000
  16.  
  17.  Date: 12-22-92 (02:09)
  18.    To: ALL
  19.  From: MARCEL HENDRIX
  20.  Subj: THREADING SPEED
  21.  
  22.  Penio Penev wrote about M. Anton Ertl's ``Threading speed''
  23.  
  24.    M. Anton Ertl's benchmark intrigued me too, but it was in a
  25.  foreign language (C). However, your Forth version I can
  26.  reproduce.  Here is what
  27.  
  28.  I found for the TMS320C30, a 32-bits, 33 MHz DSP chip from Texas
  29.  Instruments. The output shown is produced from within my
  30.  interactive target compiler for this chip (The tc is written in
  31.  iForth, a 32-bit Forth for the '386. It runs under GO32 in
  32.  protected mode on my PC).
  33.  
  34.  [regrets on possible bad reformatting; the source code below was
  35.  a bit more than I was up to dealing with]
  36.  
  37.  
  38.  <TARGET> open-log
  39.  <TARGET> include thread.tst
  40.  | \ These are the contents of thread.tst:
  41.  | code cdummy  next, end-code
  42.  | : dummy ;
  43.  | : dd    FOR dummy  NEXT ;
  44.  | : cc    FOR cdummy NEXT ;
  45.  | : tara  FOR NEXT ;
  46.  | cr .( tara : ) timer-reset 10000000 tara .elapsed .(  Indigo: 1300 )
  47.  | cr .( dd   : ) timer-reset 10000000 dd   .elapsed .(  Indigo: 3100 )
  48.  | cr .( cc   : ) timer-reset 10000000 cc   .elapsed .(  Indigo: 2500 )
  49.  tara : 3.630 seconds elapsed. Indigo: 1300
  50.  dd   : 10.065 seconds elapsed. Indigo: 3100
  51.  cc   : 10.065 seconds elapsed. Indigo: 2500  ok
  52.  <TARGET> see cc
  53.  $000005C7  ldi *ar0++(1),r0              08402001 .... MH> dpop,
  54.  $000005C8  ldi $5CF,r2                   086205CF ....
  55.  $000005C9  push r2                       0F220000 ....
  56.  $000005CA  push r0                       0F200000 ....
  57.  $000005CB  push r0                       0F200000 ....
  58.  $000005CC  ldi r0,r7                     08070000 .... MH> loop count
  59.  $000005CD  addi 1,r2                     02620001 ....
  60.  $000005CE  bu r2                         68000002 ....
  61.  $000005CF  bu $5D3                       6A000003 .... MH> LEAVE use
  62.  $000005D0  callu $5B7                    7200FFE6 ....
  63.  $000005D1  subi 1,r7                     18670001 .... MH> NEXT
  64.  $000005D2  bne $5D0                      6A06FFFD ....
  65.  $000005D3  subi 3,sp                     18740003 ....
  66.  $000005D4  retsu                         78800000 .... ok
  67.  <TARGET> words
  68.  
  69. 2
  70.  tara              cc                dd                dummy
  71.  cdummy            ok
  72.  <TARGET> see cdummy
  73.  $000005B7  retsu                         78800000 .... ok
  74.  <TARGET> see dummy
  75.  $000005B8  retsu                         78800000 .... ok
  76.  <TARGET> close-log
  77.  ---
  78.    Commands that the target can not understand (like cr timer-
  79.  reset .elapsed) are passed back to the host and executed there.
  80.  The only words that have code in the target are listed with WORDS
  81.  , above.
  82.  
  83.    The disassembler is part of the target compiler. It can show
  84.  the code in rpn too, but I like it better this way :-) The
  85.  mnemonics have the format <opcode> <source> [<source2>]
  86.  <destination>.
  87.  
  88.    Assembler: AR0 is address register 0. It points to the Forth
  89.  data stack.  The machine stack is also the Forth return stack.
  90.  "bu" means "branch unconditionally".
  91.  
  92.    The long intro to FOR makes work a bit easier for the target
  93.  compiler, and allows me to code  FOR ... LEAVE ... NEXT if I want
  94.  to. You cannot nest FOR NEXT's.
  95.  
  96.    The constant 100,000,000 was changed to 10,000,000 because, as
  97.  you can see, the code takes about three to four times as long to
  98.  run as on your Indigo. It is possible to optimize CC above, by
  99.  using bned instead of bne, but that won't give me 300% more
  100.  speed(?) I really wonder how the R3000 does it. Branch
  101.  prediction?
  102.  
  103.  Marcel Hendrix,       | The Roman Rule --Dutch Forth Workshop  |
  104.  The one who says it cannot be done should
  105.          |    never interrupt the one who is doing it.
  106.  
  107.  NET/Mail : FS FORTH Systeme BBS West Germany ++49 7667 556
  108.  ---
  109.   * The GrapeVine/Ferret Face BBS * NLR,ARK * 501-753-8121 DS *
  110.   * PostLink(tm) v1.04  GRAPEVINE (#318) : RelayNet(tm) Hub
  111.  
  112.  
  113. -----
  114. This message came from GEnie via willett.  You *cannot* reply to the author
  115. using e-mail.  Please post a follow-up article, or use any instructions
  116. the author may have included (USMail addresses, telephone #, etc.).
  117. Report problems to: dwp@willett.pgh.pa.us
  118.