home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10809 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.0 KB

  1. Xref: sparky comp.arch:10809 comp.lang.misc:3726
  2. Newsgroups: comp.arch,comp.lang.misc
  3. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
  4. From: peter@ferranti.com (peter da silva)
  5. Subject: Re: how to advocate new software/hardware features (Re: Hardware Support for Numeric Algorithms)
  6. Message-ID: <id.OS0V.0DI@ferranti.com>
  7. Organization: Xenix Support, FICC
  8. References: <TMB.92Nov13144057@arolla.idiap.ch> <1992Nov13.155126.3660@linus.mitre.org> <1992Nov13.200222.23955@sal.wisc.edu>
  9. Date: Mon, 16 Nov 1992 21:56:36 GMT
  10. Lines: 25
  11.  
  12. In article <1992Nov13.200222.23955@sal.wisc.edu> alan@sal.wisc.edu (Alan Watson) writes:
  13. > >Quite a few modern microprocessors have hardware to do 32 x 32 bit 
  14. > >multiplies and 64 bit / 32 bit divides.  I know of no HLL that will
  15. > >allow me to write code to access these instructions. For example,
  16. > >suppose I want to compute A*B/C exactly, where A,B, C are 32 bit
  17. > >ints and C > A and C > B.  How do I do this in a HLL ?
  18.  
  19. In Forth: A B C */ (this is actually 16 * 16 / 16 -> 16, but equivalent
  20.             operations exist for 32-bit operators in modern Forths)
  21.  
  22. > This is a compiler issue, not a language issue; many compilers provide
  23. > access to system-specific operations.
  24.  
  25. No, it's a language issue. Forth, as implemented on an 8-bit CPU with no
  26. hardware multiplier, provides this routine. I have also been concerned
  27. that no high level language other than Forth provides this sort of facility.
  28. I have become MORE concerned that the ANSI C standard requires that the
  29. straightforward expression of this NOT work, although it's possible to
  30. write code that your compiler vendor may convert to this operation if
  31. he was smart enough not to prohibit it...
  32. -- 
  33. Peter da Silva / 77487-5012 USA / +1 713 274 5180
  34. true(<<VV$@\\$'&O 9$O%'$LT$&$"V6"$&$<4$?'&$ #I&&?$=$<<@)24 24 scale 3 21 moveto
  35. {dup 36 eq{pop not}{dup 7 and 4 sub exch 56 and 8 div 4 sub 2 index{rlineto}{
  36. rmoveto}ifelse}ifelse}forall stroke pop showpage % Har du kramat din varg idag?
  37.