This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: [RFA] mips: Fix "info registers" output


> Have a look at GCC's -fshort-double option.  I'm not sure how MIPS would 
>> respond to it but I suspect it would make everyones head hurt. :-)
> 
> 
> I suspect the stabs reader would go insane :)  You'd have two floating
> point types with different names but the same size... all sorts of
> assumptions would probably get confused.

It works for the d10v!  That has:

	float 32
	double 32
	long double 64

by default.  The poor d10v gets confused when ``double 64'' is specifed 
but that is only because the corresponding gdb code pre-dates multi-arch 
and so code to handle this is simply missing.

> That wouldn't affect builtin_type_double, though, which we define in
> terms of the 64 bits.  Are you saying that should be updated based on
> the type of 'double' in the objfile?  I don't really think so, since
> 'the type associated with the word "double"' isn't necessarily tied to
> "what this architecture would normally call a double" and
> builtin_type_double is the latter.  MIPS would normally call a 64-bit
> FP quantity a double, whatever GCC is up to.

Now I'm confused :-).  The type builtin_type_double is determined by the 
ABI, its value/behavour is influenced by TARGET_DOUBLE_BIT, 
TARGET_BYTE_ORDER and TARGET_DOUBLE_FORMAT.  They are all attributes of 
the ABI and their values can be determined from the object file.

Separate to this is the real register format and that is determined by 
the ISA.

Consider the PPC which has strictly 64 bit FP registers but supports the 
32 bit ``float'' type.  If you print the register it is 64 bit, if you 
print a 32 bit float stored in the register than the 64 bit value is 
first converted to 32 bit.

Other examples are Arm, m68k and i386.  As soon as those targets stopped 
trying to use type_double et.al. bugs mysteriously disappeared and the 
code became simpler :-)  The mips hasn't yet done this.

> 
> Right; the way registers are acquired is both ISA and ABI dependent.  I
> don't know that the way they are interpreted afterwards is ABI
> dependent...

Their interpretation is ISA dependant so they should be using things 
like type_ieee_double et.al.

enjoy,
Andrew



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