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]

question on arm soft-fp function __aeabi_d2uiz


Hi,
I found in gcc/config/arm/ieee754-df.S, the function __aeabi_d2uiz
converts double into unsigned integer and the function always return 0
if the double value is negative. for example the following codes:
-----------------------sample codes----------------------
unsigned long ul;
double d = -1.1;

int main(void)
{
    ul = (unsigned long)d;
    fprintf (stdout, "ul = 0x%X\n", ul);

    return 0;
}
the output of __aeabi_d2uiz on arm soft-fpu is 0x0, resulting in
different behaviors between "(unsigned int)(int)d" and "(unsigned
int)d".

I also tried the code on x86-cygwin, which prints 0xFFFFFFFF.
I am wondering why __aeabi_d2uiz returns 0 for negative double values.
Is this behavior defined by arm fpu and it's different with x86 in fpu
implementation?
I have no arm fpu platform to verify this question and have know
little about float porints, So any clarification?

Thanks very much.
-- 
Best Regards.


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