Emulating a hardware signed multiplier
Décio Luiz Gazzoni Filho
decio at decpp.net
Sun Oct 25 02:31:33 CET 2009
On Oct 24, 2009, at 6:40 PM, Børge Strand-Bergesen wrote:
> The hardware multiplier takes two signed 64-bit numbers and produces a
> signed 128-bit number. I'm new to GMP and I'm looking for a way to
> make it interpret numbers the same way the hardware multiplier does.
You're on an XP machine, so you're on x86. I suppose you have a
`recent' (< 5 years) processor, who then supports 64-bit extensions.
One single 64-bit assembly signed multiply instruction does what you
want. It executes in a couple of CPU cycles. Why complicate matters?
More information about the gmp-discuss