Enables FPE on ppc by default. Note: user application still needs to set, with feenableexcept() , which exception will trigger a SIGFPE.
This belongs in trap.hh, as EXC_PGM_FPE, or similar name, since it's part of SRR1, not MSR.
Actually, I think this really should belong in spr.h, as SRR1_PGM_FPE, and the other EXC_PGM* #defines moved there, too. But that's not how it's done now, so just put it in trap.h.
I just have some style related comments and 2 questions about the changes.
Do we want to enable FP exceptions by default?
This brace should be in the line above.
Variable declarations should be all in the beginning of a block, separated of other statements by a new line, and function call initializers should not be used (e.g. mfmsr()).
I may be missing something, but why is enable_fpu() needed here?
It's still not "enabled". By default none of the exception enabled registers are enable. User must call feenableexcept() if he wants to receive a FP exception.
enable_fpu() loads the floating point registers from the PCB. Without it the application can't capture the SIGFPE.
I think this whole union could be replaced by an uint64_t.