Subject: MATH_EMULATE regression in -current vs. 1.3.2
To: None <port-i386@netbsd.org>
From: Todd Whitesel <toddpw@best.com>
List: port-i386
Date: 01/03/1999 19:55:40
Okay, I've finally got most of my other stuff wrapped up enough to actually
start looking at MATH_EMULATE.

First item is to verify that I can build kernels which always use the emulator
even if a real NPX is present (since I have no pre-Pentium machines here).

It looks like commenting out npx0 in the config file should be sufficient,
and it appears to work well; I added a printf right after the first use of
fninit() in arch/i386/i386/math_emulate.c which tells you the PID of each
process as it starts to use floating point.

However, this test case works with 1.3.2 but bus errors with -current:

#include <stdio.h>
#include <stdlib.h>

main(int argc, char **argv)
{
double sum = 0.;

while (*++argv)
	sum += atof(*argv);

printf("The sum is %f\n", sum);
}

./a.out reports 0.0 correctly on 1.3.2, but dies deep inside printf
on -current circa 24-Dec-1999.

./a.out 1 1
succeeds/fails similarly (haven't actually run it through gdb however).


BTW I tried commenting out MATH_EMULATE in the config file and it appears
to trigger a rebuild of the entire kernel. Is there any way to declare which
files actually have MATH_EMULATE in them (or even do a blast-grep in config)
to reduce the impact of this?


Advice/pointers welcome; more info as it comes in.

Todd Whitesel
toddpw @ best.com