home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.arch:10700 comp.lang.misc:3638
- Newsgroups: comp.arch,comp.lang.misc
- Path: sparky!uunet!think.com!linus!linus.mitre.org!gauss!bs
- From: bs@gauss.mitre.org (Robert D. Silverman)
- Subject: Re: how to advocate new software/hardware features (Re: Hardware Support for Numeric Algorithms)
- Message-ID: <1992Nov13.155126.3660@linus.mitre.org>
- Sender: news@linus.mitre.org (News Service)
- Nntp-Posting-Host: gauss.mitre.org
- Organization: Research Computer Facility, MITRE Corporation, Bedford, MA
- References: <1992Nov10.153705.27804@yrloc.ipsa.reuter.COM> <1992Nov12.131856.12605@linus.mitre.org> <TMB.92Nov13144057@arolla.idiap.ch>
- Date: Fri, 13 Nov 1992 15:51:26 GMT
- Lines: 87
-
- In article <TMB.92Nov13144057@arolla.idiap.ch> tmb@idiap.ch writes:
- >bs@gauss.mitre.org writes:
- >> rbe@yrloc.ipsa.reuter.com writes:
- >> > Optimization before design is usually a bad idea.
- >>
- >> Spouting aphorisms adds little to this discussion. Especially since you
- >> are assuming facts not in evidence. (i.e. you are assuming that the
- >> optimization came before the design).
- >
- >What Rubin codes in the privacy of his own VAX is his own business.
- >
- >But he is trying to use his code as an example to convince the rest of
- >us that we should pay for our computer manufacturers to incorporate
- >"get bit from bitsream" and "generate exponential rv" instructions,
-
- Nothing so esoteric. I get the *impression* that none of you are really
- listening to what he is saying.
-
- Herman is bemoaning the fact that quite often a computer HAS hardware
- to execute some particular instruction that he likes, but that HLL's
- do not allow him access to it.
-
- I can cite one example that bothers me a lot.
-
- 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 ?
-
- If one has:
-
- long a,b,c,d;
-
- c = 7777777;
- a = 111111;
- b = 222222;
- d = a*b/c;
-
-
- I will NOT get the right answer, even when the computer has a 64 bit
- multiply because the compiler will not generate the instruction!
- It will generate an ordinary 32 bit multiply, and a*b will overflow.
-
- I would like to see a language that has a feature that will allow
- me to (say) define new operators that use specific machine instructions.
-
- for example: (pseudocode)
-
- #ifdef VAX define binary operator arg1 ** arg2 as 'emul arg1 arg2'
- #elseif SUN define binary operator arg1 ** arg2 as 'umul arg1 arg2'
- #ifdef VAX define binary operator arg1 /& arg2 as 'ediv arg1 arg2'
- #elseif SUN define binary operator arg1 /& arg2 as 'ldiv arg1 arg2'
-
-
- OR
-
- define unary operator *& arg1 as 'sigbit arg1'
-
- should my computer have an instruction, sigbit, that returns the
- most significant bit in a word.
-
- and be able to write:
-
- d = a**b/& c;
- or
-
- d = *& a;
-
-
- where 'emul' is the double length multiply instruction on a VAX and
- 'umul' is the same for a SUN-3. Similarly for ediv and ldiv.
-
- This requires that the code emitter for the compiler be able to
- recognize such things.
-
- I would also like to see an HLL developed that handles arithmetic
- correctly. i.e. a language for numerical and semi-numerical algorithms.
- Fortran claims to be that, but it is woefully inadequate.
-
- I could design such a language, but I don't have the spare time to
- do it and I can't see my employer paying me to do it.
- --
- Bob Silverman
- These are my opinions and not MITRE's.
- Mitre Corporation, Bedford, MA 01730
- "You can lead a horse's ass to knowledge, but you can't make him think"
-