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.