🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #11020

Re: how to advocate new software/hardware features (Re: Hardware Support for Numeric Algorithms)

#11020
From: peter da silva
Date: Mon, 16 Nov 1992 21:56
25 lines
2025 bytes
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?
Technical Details
Message-ID: <id.OS0V.0DI@ferranti.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
References: <TMB.92Nov13144057@arolla.idiap.ch> <1992Nov13.155126.3660@linus.mitre.org> <1992Nov13.200222.23955@sal.wisc.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.arch,comp.lang.misc
Path: arc1-ca.pugleaf.net!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