From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joern Rennecke To: krovetz@cs.ucdavis.edu (Ted Krovetz) Cc: egcs@cygnus.com Subject: Re: MIPS long long using inline asm Date: Wed, 08 Apr 1998 21:20:00 -0000 Message-id: <199804082251.XAA26826@phal.cygnus.co.uk> References: <9804081640.AA16957@toadflax.cs.ucdavis.edu> X-SW-Source: 1998-04/msg00363.html > Hi, > > I'm doing cryptographic research at UC Davis and have need for fast > 32-bit x 32-bit -> 64-bit multiplications. On intel using gcc's inline > assembler I get this using > > #define XMUL(x, y) \ > ({ UINT64 __res; UINT32 __x = (x), __y = (y); \ > __asm__ ("mull %2" : "=A" (__res) : "a" (__x), "r" (__y)); \ > __res; }) > > where the output specifier "=A" (__res) tells the compiler to bind the > long long variable __res to the two 32-bit registers EDX:EAX. > > I want to do something similar on MIPS. How can I use gcc and inline > assembly to bind a pair of 32-bit registers to a long long variable? Look at longlong.h in the gcc sources. Actually, if putting the 64 bit result in two 32 bit variables is good enough, you might just use umul_ppmm directly.