Boost logo

Boost :

Subject: Re: [boost] [review queue] What to do about the library review queue?
From: degski (degski_at_[hidden])
Date: 2017-03-16 00:32:21


On 15 March 2017 at 17:06, Andrey Semashev <andrey.semashev_at_[hidden]>
wrote:

> > This is what happens in the CPU.
>
> Actually, no.
>

http://support.amd.com/TechDocs/25112.PDF (I didn't go through the 5
manuals to find a better quote, but they are there!)

Chapter 3, Page 61.

"Using 64-bit registers, the entire product
can be produced with only one instruction:
; Multiply RAX by RBX. The 128-bit product is stored in RDX:RAX.
00000000 48 F7 EB imul rb"

That you can't get at it (the full result) without some (inline) assembler
is another issue. RAX is what's returned (as far as I remember) from a
function, your truncating multiplication, the higher bits are waiting for
you in RDX.

I don't have a SPARC to my disposal, so cannot comment.

degski


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk