home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!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: <1992Nov15.193356.1549@sal.wisc.edu>
- Organization: Space Astronomy Lab, Madison WI
- References: <1992Nov13.155126.3660@linus.mitre.org> <TMB.92Nov14145619@pollux.idiap.ch> <7899@charon.cwi.nl>
- Date: Sun, 15 Nov 1992 19:33:56 GMT
- Lines: 35
-
- In article <7899@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes:
- >But wait. SPARC version 7 does not have an integer multiply instruction,
- >it uses multiply step. When you code the multiply in assembly you will
- >find that you get a 64 bit result, but in C it is not possible to
- >retrieve that result. Doing it with inline assembly is not what you
- >want in general (>32 instructions inline assembly), so you do it
- >out-of-line. Hence it is not sufficient to have good inliners, on
- >some platforms you need out of line assembly routines to do what you
- >want, and no, the compilers do not help. (The same holds for HP-PA 1,
- >IBM PC-RT, AMD 29k and a few more.) So the operation is available but
- >you do not get it.
- >
- >So let's see. You promote the GCC interface with asm. How do you
- >code the 32x32->64 multiply on the SPARC in GCC?
-
- Include the following in every source file:
-
- static inline long long mul32to64 (long i, long j)
- {
- whatever asm magic one requires
- }
-
- This terribly inelegant; if you want elegance BUY a compiler for the
- machine which has 64 bit longs and use:
-
- long i64;
- int i32, j32;
- i64 = (long) i32 * (long) j32;
-
- If the compiler insists on promoting i32 and j32 to 64 bits before the
- multiplication, ask for your money back.
-
- Solutions exists for many of the specific problems which have been
- discussed in this thread: most of the free ones are inelegant and most
- of the elegant ones are expensive.
-