home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.arch:10711 comp.lang.misc:3643
- Newsgroups: comp.arch,comp.lang.misc
- Path: sparky!uunet!caen!sol.ctr.columbia.edu!sal.wisc.edu!alan
- From: alan@sal.wisc.edu (Alan Watson)
- Subject: Re: how to advocate new software/hardware features (Re: Hardware Support for Numeric Algorithms)
- Message-ID: <1992Nov13.200222.23955@sal.wisc.edu>
- Organization: Space Astronomy Lab, Madison WI
- References: <1992Nov12.131856.12605@linus.mitre.org> <TMB.92Nov13144057@arolla.idiap.ch> <1992Nov13.155126.3660@linus.mitre.org>
- Date: Fri, 13 Nov 1992 20:02:22 GMT
- Lines: 35
-
- In article <1992Nov13.155126.3660@linus.mitre.org> bs@gauss.mitre.org (Robert D. Silverman) writes:
- >
- >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 ?
-
- This is a compiler issue, not a language issue; many compilers provide
- access to system-specific operations.
-
- If the compiler on your system does not provide an appropriate built-in
- either persuade your compiler supplier to put it in, or pay them to put
- it in, or use something like gcc or lcc and put it in yourself.
-
- For example, on my MIPS machine I am able to access the abs.s instruction
- in the following manner:
-
- #if defined __mips && defined __GNUC__
- #define __builtin_absf(y,x) \
- __asm__ volatile ("abs.s\t%0,%1 # __builtin_absf" : "=f" (y) : "f" (x));
- #else
- #define __builtin_absf(y,x) \
- if (x >= 0) y = x; else y = -x;
- #endif
-
-