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