[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Kernel IEEE Math Completion (everything is zeroed!?!)

I was fooling around on my Alpha and just noticed that all the special IEEE 
numbers (infs, nans, and denormals) are now being replaced by zeros.

For example,

  #include <stdio.h>

  int main() {
    double value1;
    double value2;

    printf("Please enter the num: ");
    printf("Please enter the den: ");
    printf("\n%g/%g = %g\n",value1,value2,value1/value2);

    return 0;

saved to "div.c" and compiled with "gcc -o div -lm -Wall div.c" gives

  0/0 = 0 (should be nan)
  1/0 = 0 (should be inf)
  1e-320/2 = 0 (should be 5e-321: 1e-320 is a denormalized)

Dumping the generated code with "objdump -d div | less" shows gcc is 
generating all the required trap instructions and su extentions on the 
floating point operations.  This leaves me wondering if something has changed 
in the IEEE floating point fixup code in newer kernels.

Unfortunately, I'm stuck at 2.6.15 or greater due to new udev requirements 
(and only 2.6.16 is available), but is there anyone else out there running an 
older kernel (maybe even 2.4) that could give this a try?

Thanks!  -Tyson

 Tyson Whitehead  (-twhitehe at uwo.ca -- WSC-)
 Computer Engineer                          Dept. of Applied Mathematics,
 Graduate Student- Applied Mathematics      University of Western Ontario,
 GnuPG Key ID# 0xF7666BFF                   London, Ontario, Canada

Attachment: pgphfUF0yxXQL.pgp
Description: PGP signature

Reply to: