This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [using gcc book] 5.20 double-word integers


On Tue, Aug 26, 2003 at 10:48:29AM -0400, Chris Devers wrote:
> On Tue, 26 Aug 2003, Gabriel Paubert wrote:
> 
> > On Sat, Aug 23, 2003 at 09:33:34PM -0400, Chris Devers wrote:
> > > Hello again,
> > >
> > > In chapter five, section 5.9 (Double-Word Integers) of the _Using GCC_
> > > book, we have the following sentence:
> > >
> > >     Multiplication is open-coded if the machine supports
> > >     fullword-to-doubleword a widening multiply instruction.
> > >
> > > I feel this would read more clearly if written as follows:
> > >
> > >     Multiplication is open-coded if the machine supports a
> > >     widening fullword-to-doubleword multiply instruction.
> >
> > Warning: nitpicking ahead.
> >
> > On PPC32 at least, there is no widening multiply instruction, but
> > there is a multiply high instruction which allows to easily compute
> > all the necessary terms and is used for that purpose.
> 
> Do you feel this warrants a change in phrasing? 

This is a very low level technical detail, so maybe not.

> Was the original version any more accurate?

Certainly not.

> The sentence is already written in terms of a caveat
> ("...foo if bar..."); are you saying that this caveat should be further
> qualified for PPC32 (etc?) targets?

I don't know all the targets, but such an instruction is quite
frequent because it allows to speed up divisions by constants.
I know Alpha has it, for example.

> 
> Suggested rephrasings are welcome.

Something like:

Multiplication is open-coded if an instruction which provides
the most significant half of the product is available.

But I don't like it. I'm not a native English speaker, 
but the worst is that it's still ambiguous and not 100% correct.

Finally, when rereading the whole "Double-word Integers" section,
it seems obvious that it was written before the existence of 64
bit machines, in which registers are twice the size of an int,
and often use exactly the same instructions for 32 and 64 bit
operations.

	Regards,
	Gabriel


> 
> 
> -- 
> Chris Devers      cdevers@pobox.com
> http://devers.homeip.net:8080/blog/
> 
> trash can, n.
> (GUI) An iconized disposal device designed to facilitate the accidental
> deletion of essential files. See also ICON; GARBAGE; MOUSE; BIN.
> 
>     -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]