This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
ARM float/double conversion
- From: Timothy Wall <twall at oculustech dot com>
- To: gdb at sources dot redhat dot com
- Date: Wed, 05 Dec 2001 09:53:58 -0500
- Subject: ARM float/double conversion
- Organization: Oculus Technologies
- Reply-to: twall at oculustech dot com
In gdb/doublest.c, there is some conversion done for
floatformat_littlebyte_bigword (currently only used by ARM):
longswaps = fmt->totalsize / FLOATFORMAT_CHAR_BIT;
longswaps >>= 3;
while (longswaps-- > 0)
{
/* This is ugly, but efficient */
*swapout++ = swapin[4];
*swapout++ = swapin[5];
*swapout++ = swapin[6];
*swapout++ = swapin[7];
*swapout++ = swapin[0];
*swapout++ = swapin[1];
*swapout++ = swapin[2];
*swapout++ = swapin[3];
swapin += 8;
}
What's odd is that fmt->totalsize can be either 64 or 96, based on the formats
defined in libiberty/floatformat.c. For either case, longswaps will be 1, so
I don't understand why
this code was "generalized". I assume that the extended double on the ARM has
just the
first two 32-bit words swapped.
I actually need to extend this code to do similar swaps for a 32-bit float,
and was going to
"generalize" to accommodate that (little-endian, bigword, word size is 16
bits).
T.