home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / forth / 2818 < prev    next >
Encoding:
Text File  |  1992-07-20  |  3.2 KB  |  72 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!email!mips.complang.tuwien.ac.at!anton
  3. From: anton@mips.complang.tuwien.ac.at (Anton Martin Ertl)
  4. Subject: Re: Non-Forth systems/languages.
  5. Message-ID: <1992Jul21.084657.3124@email.tuwien.ac.at>
  6. Sender: news@email.tuwien.ac.at
  7. Nntp-Posting-Host: mips.complang.tuwien.ac.at
  8. Organization: Institut fuer Computersprachen, Technische Universitaet Wien
  9. References:  <3898.UUL1.3#5129@willett.pgh.pa.us> <1992Jul20.180116.5853@Informatik.TU-Muenchen.DE>
  10. Date: Tue, 21 Jul 1992 08:46:57 GMT
  11. Lines: 59
  12.  
  13. In article <1992Jul20.180116.5853@Informatik.TU-Muenchen.DE>, pazsan@Informatik.TU-Muenchen.DE (Bernd Paysan) writes:
  14. |> 
  15. |> In article <3898.UUL1.3#5129@willett.pgh.pa.us>, ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) writes:
  16. |> |> Category 3,  Topic 16
  17. |> |> Message 84        Fri Jul 17, 1992
  18. |> |> E.RATHER [Elizabeth]         at 00:01 EDT
  19. |> |>  
  20. |> |> In our experience w/ "funny chips" the way to really get performance out of a
  21. |> |> strange architecture is to design the Forth machine to take as much advantage
  22. |> |> of the architecture as possible internally. For example, on the i860 we use a
  23. |> |> modified dtc in which the 1st instruction of the "jumped to" code actually
  24. |> |> follows the jump in the calling def, because the pipelining enables that
  25. |> |> instruction to be executed "for free" during the jump.  It's unclear whether
  26. |> |> writing the code in C as Ertl has done can facilitate that type of
  27. |> |> optimization.
  28. |> 
  29. |> At least the code for HP-PA doesn't, but it doesn't run, either :-(. It compiles
  30. |> NEXT DTC as
  31. |> 
  32. |>         ldws,ma 4(0,%r20),%r19
  33. |>         bv 0(%r19)
  34. |>         nop
  35. |> 
  36. |> and adds a nop to the pipeline. The SPARC code added the increment of the pointer
  37. |> in the branch delay, but I don't have it here now, so I can't post it. The
  38. |> ldws,ma increments the pointer, so nothing was found to fit into the pipeline 
  39. |> (and I can't find anything by hand, too). The NEXT ITC is quite the same:
  40. |> 
  41. |>         ldws,ma 4(0,%r20),%r19
  42. |>         ldw 0(0,%r19),%r19
  43. |>         bv 0(%r19)
  44. |>         nop
  45.  
  46. What you don't see is the delay slots between the load and the use of
  47. the loaded value in the next instruction. However, in a real forth
  48. primitive these delay slots will be filled (and the nop after the
  49. branch will be replaced) with other instructions (for computing and
  50. stack manipulation). This is done automatically by the C compiler.
  51.  
  52. There is one possible optimization that I don't know how to express in
  53. GNU C. You can draw the load of the next execution token into the
  54. previous primitive, where it can fill the branch delay slot, i.e.:
  55.  
  56. NEXT DTC
  57.         bv 0(%r19)
  58.         ldws,ma 4(0,%r20),%r19
  59.  
  60. This would reduce cache miss sensitivity and may reduce delay slots in
  61. some primitives. On the other hand, loading the next instruction
  62. will be wasted effort in at least 25% of the executed instructions
  63. (CALL and EXIT), so this "optimization" may backfire. It probably will
  64. pay off in processors of the next generation, which have many delay
  65. slots. So perhaps GNU C will give us another extension for expressing
  66. such things.
  67.  
  68. - anton
  69. -- 
  70. M. Anton Ertl                    Some things have to be seen to be believed
  71. anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
  72.