home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / misc / 126 < prev    next >
Encoding:
Text File  |  1992-12-31  |  6.8 KB  |  167 lines

  1. Newsgroups: comp.sys.sgi.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!venezia!penev
  3. From: penev@venezia (Penio Penev)
  4. Subject: Re: Where does the CPU go, when its not doing nuthin' (gr_osview)
  5. References: <1992Dec27.213821.29605@sol.ctr.columbia.edu>
  6. Sender: nobody@ctr.columbia.edu
  7. Organization: Rockefeller University
  8. Date: Thu, 31 Dec 1992 12:25:15 GMT
  9. X-Newsreader: TIN [version 1.1 PL6]
  10. Message-ID: <1992Dec31.122515.12993@sol.ctr.columbia.edu>
  11. Reply-To: penev@venezia.rockefeller.edu
  12. X-Posted-From: venezia.rockefeller.edu
  13. NNTP-Posting-Host: sol.ctr.columbia.edu
  14. Lines: 151
  15.  
  16. Penio Penev (penev@venezia) wrote:
  17. : ForthNet articles from GEnie (ForthNet@willett.pgh.pa.us) wrote:
  18. : : Category 9,  Topic 2
  19. : : Message 127       Sat Dec 26, 1992
  20. : : ELLIOTT.C                    at 13:40 EST
  21. : :  
  22. : :  -----via CRS Premium Bulletin Board -
  23. : :  USR Dual Standard 16.8K  (416) 629-7000
  24. : : 
  25. : :  Date: 12-22-92 (02:09)
  26. : :    To: ALL
  27. : :  From: MARCEL HENDRIX
  28. : :  Subj: THREADING SPEED
  29. : : 
  30. : :  Penio Penev wrote about M. Anton Ertl's ``Threading speed''
  31. : : 
  32. : :    M. Anton Ertl's benchmark intrigued me too, but it was in a
  33. : :  foreign language (C). However, your Forth version I can
  34. : :  reproduce.  Here is what
  35. : : 
  36. : :  I found for the TMS320C30, a 32-bits, 33 MHz DSP chip from Texas
  37. : :  Instruments. The output shown is produced from within my
  38. : :  interactive target compiler for this chip (The tc is written in
  39. : :  iForth, a 32-bit Forth for the '386. It runs under GO32 in
  40. : :  protected mode on my PC).
  41. : : 
  42. : ..
  43. : :  | code cdummy  next, end-code
  44. : :  | : dummy ;
  45. : :  | : dd    FOR dummy  NEXT ;
  46. : :  | : cc    FOR cdummy NEXT ;
  47. : :  | : tara  FOR NEXT ;
  48. : :  | cr .( tara : ) timer-reset 10000000 tara .elapsed .(  Indigo: 1300 )
  49. : :  | cr .( dd   : ) timer-reset 10000000 dd   .elapsed .(  Indigo: 3100 )
  50. : :  | cr .( cc   : ) timer-reset 10000000 cc   .elapsed .(  Indigo: 2500 )
  51. : :  tara : 3.630 seconds elapsed. Indigo: 1300
  52. : :  dd   : 10.065 seconds elapsed. Indigo: 3100
  53. : :  cc   : 10.065 seconds elapsed. Indigo: 2500  ok
  54. : :  <TARGET> see cc
  55. : :  $000005C7  ldi *ar0++(1),r0              08402001 .... MH> dpop,
  56. : :  $000005C8  ldi $5CF,r2                   086205CF ....
  57. : :  $000005C9  push r2                       0F220000 ....
  58. : :  $000005CA  push r0                       0F200000 ....
  59. : :  $000005CB  push r0                       0F200000 ....
  60. : :  $000005CC  ldi r0,r7                     08070000 .... MH> loop count
  61. : :  $000005CD  addi 1,r2                     02620001 ....
  62. : :  $000005CE  bu r2                         68000002 ....
  63. : :  $000005CF  bu $5D3                       6A000003 .... MH> LEAVE use
  64. : :  $000005D0  callu $5B7                    7200FFE6 ....
  65. : :  $000005D1  subi 1,r7                     18670001 .... MH> NEXT
  66. : :  $000005D2  bne $5D0                      6A06FFFD ....
  67. : :  $000005D3  subi 3,sp                     18740003 ....
  68. : :  $000005D4  retsu                         78800000 .... ok
  69. : :  <TARGET> words
  70. : : 
  71. : : 2
  72. : :  tara              cc                dd                dummy
  73. : :  cdummy            ok
  74. : :  <TARGET> see cdummy
  75. : :  $000005B7  retsu                         78800000 .... ok
  76. : :  <TARGET> see dummy
  77. : :  $000005B8  retsu                         78800000 .... ok
  78. : :  <TARGET> close-log
  79. : :  ---
  80. : ..
  81. : :    The long intro to FOR makes work a bit easier for the target
  82. : :  compiler, and allows me to code  FOR ... LEAVE ... NEXT if I want
  83. : :  to. You cannot nest FOR NEXT's.
  84. : The difinition of FOR NEXT I posted _can_ be nested. There is another
  85. : definition, which cannot. Words can be invoked from it, but You do not
  86. : have I in it.
  87. :  1 : FOR( ( - a)  TS V1 mov  Drop  V1 dec  begin ; IMMEDIATE
  88. :  2 : )NEXT ( a)  V1 Z= until  V1 dec ;  IMMEDIATE
  89. : Measurements:
  90. : : TARA()  FOR( )NEXT ; ok
  91. : COUNTER 1000000000 TARA() TIMER 62000 ok
  92. : In dbx:
  93. :  [RETRY, 0x10011ef4]    addiu   sp,sp,-4
  94. :  [RETRY, 0x10011ef8]    move    v1,s0
  95. :  [RETRY, 0x10011efc]    lw      s0,0(s8)
  96. :  [RETRY, 0x10011f00]    addiu   s8,s8,4
  97. :  [RETRY, 0x10011f04]    addiu   v1,v1,-1
  98. :  [RETRY, 0x10011f08]    bne     v1,zero,0x10011f08
  99. :  [RETRY, 0x10011f0c]    addiu   v1,v1,-1
  100. : *[RETRY, 0x10011f10]    addiu   sp,sp,4
  101. :  [RETRY, 0x10011f14]    jr      ra
  102. :  [RETRY, 0x10011f18]    lw      ra,4(sp)
  103. : :    The constant 100,000,000 was changed to 10,000,000 because, as
  104. : :  you can see, the code takes about three to four times as long to
  105. : :  run as on your Indigo. It is possible to optimize CC above, by
  106. : :  using bned instead of bne, but that won't give me 300% more
  107. : :  speed(?) I really wonder how the R3000 does it. Branch
  108. : :  prediction?
  109. : The R3000 can deliver one result in one clock if the pipe is kept
  110. : full. It can utilize the branch delay slot (the instruction after the
  111. : branch). I was rather surprised (pleasantly), when I realised, that
  112. : the branch delay slot is enough to fill the pipe.  Two clocks/loop at
  113. : 33 MHz means 17.5 loops/us = 17.5 Mloops/second.  The 1000M loops
  114. : should be performed in 57.1 seconds in theaory. The agreement with
  115. : experiment is very good, because I have at least 10 other open windos,
  116. : one of which is a graphical clock, updated on a second basis. This
  117. : means, that I can utilise ~ 92.1% of the power of my machine without
  118. : sacrificing any convinience.
  119.  
  120. What activities are caried on on a unburdened system? 8% of this
  121. powerfull CPU seems a little bit much for the clock. The other windows
  122. just waited for input from the keyboard. When I checked this with
  123. gr_osview, the CPU was almost all user's with very small ammount of
  124. sys. 
  125.  
  126. : In my oppinion the R3000 has some way of processing two instructions
  127. : in the early stages of the pipe (perhaps the first 2 of 5 total). I
  128. : made the following test:
  129. : : TT   FOR(  [ begin  0 Z= until  nop ]  )NEXT ; ok
  130. : COUNTER 100000000 TT TIMER 13000 ok
  131. : This is one branch, which is taken, and one which is not. The timing
  132. : is ~ two times the original one, which means, that both branches
  133. : execute in the same time. On the other hand in the Reference Manual
  134. : clearly states, that the branch decision is made one clock after the
  135. : calculation of the target address and the condition. This is one clock
  136. : after the Instruction Fetch phase on the target instruction.
  137. : The R4000 has an 8 stage pipe, and there (IMHO) maintaining two early
  138. : pipes is not possible (feasible). It has an instructions 'branch if
  139. : condition likely'. 
  140. : Another consequence of this feature is that You can make
  141. : call = jump and link, store, dec  = 3 clocks
  142. : ret  = jump register, load,  inc  = 3 clocks
  143. :                                   ----------
  144. :                                     6 clocks
  145. : call unnestable     = jump and link, store = 2 clocks
  146. : ret from unnestable = jump register, load  = 2 clocks
  147. :                                            ----------
  148. :                                              4 clocks
  149. : I like this processor.
  150. : -- Penio.
  151.  
  152. -- Penio.
  153.