OK, for those of you who have been wondering whether I was spending all
my time on a south-pacific island or some such: no, no such luck,
unfortunately. The good news is that there is a new kernel patch.
The highlights:
- Math-emulator for weird (err, "exotic") IEEE stuff now exists
- Drew's new NCR SCSI driver works (supports synchronous
transfers, disconnect/reconnect, you name it!)
- Unaligned faults for floating point registers loads/stores
are now supported as long as the offending instruction was
either a ldt or stt. This may sound weird, but it covers
the important case where gcc uses floating point registers
to hold integer values temporarily. (This was inspired by
a patch by Jay Estabrook.)
The math emulator is based on GPL'd code that Jim Paradis sent me a
few weeks ago (thanks Jim!). The core math algorithms are the same,
but a lot of it changed because the old code didn't worry much about
non-finite IEEE arithmetic. Performance of the IEEE probably isn't
great, but then, if you have to trap you loose anyway performance
wise. Also, most of the traps will involve non-finite arithmetic only
and that part is probably handled fairly well. The emulator certainly
could need more testing. What I did test fairly extensively is the
handling of non-finite numbers (denormals, Infs, and NaNs). But I
also did some quick tests on all the operators and in the test cases
they always returned a result that was bit for bit identical to the
hardware produced result.
Just to avoid any misunderstandings: ALL Alpha chips produced to date
do SUPPORT FLOATING POINT IN HARDWARE. And yes, the floating point
unit is pretty darn fast at that. So why do we need a math-emulator
at all? Well, the Alpha FPUs do not implement the "exotic" aspects of
IEEE fp arithmetic (if you wonder why, look at the code in
arch/alpha/math-emu...). "Exotic" means non-finite numbers, which are
denormalized numbers, infinities, and not-a-numbers. In addition,
earlier chips (EV4 and EV45) do not support rounding towards plus or
minus-infinity in hardware. Rounding towards 0 (chopped mode) and
rounding towards nearest are supported by all Alpha chips in hardware.
Another exotic IEEE feature is the "inexact" flag which gets set (and
may result in a trap) whenever an operation has a result that deviates
from the inifitely precise result. As long as you don't use these
features, the Alpha FPU will go at its full speed. Otherwise, you'll
need to use the -mieee or -mieee-with-inexact flags of the forthcoming
gcc. Those flags tell the compiler to generate code that allows the
kernel to emulate the parts of the IEEE standard that the current
Alpha chips do not implement in hardware. IMHO, adding the math
emulator is strictly a "nice to have" feature. There are occasional
programs where it's useful (e.g., Octave and other interactive math
programs) but most of the time you won't worry about this.
A few caveats regarding the new patch:
- It replaces the call to "quickstrip" with "strip"; this
requires that you have binutils 2.6 installed (yeah, a
patch for it will be forthcoming shortly as well... In
the meantime, just continue to use quickstrip)
- In drivers/scsi/53c7,8xx.c be sure the PERM_OPTIONS are
set to suite your system. Unlike Drew's version, mine
has OPTION_ALWAYS_SYNCHRONOUS turned on. I haven't seen
any problems yet either on my Noname or Cabriolet, so maybe
it's pretty safe to do so. Also, search for
CONFIG_ALPHA_CABRIOLET: the SCSI controller in my Cabrio is
FAST SCSI capable whereas I haven't had much luck with the
Noname's controller yet (but I haven't tried very hard, I
must admit). To be on the safe side, you'd want to set
the constant in that #ifdef to 50 so you run the SCSI at
5MHz only).
- A special not for Dave Rusling (and all other people blessed
with an EV5): notice that the bus_to_virt() function changed
in a trivial but important way. You may wanna make sure
your alcor.h is updated accordingly.
Oh, there are also two new OSF/1 compatiable syscalls to allow
applications to control the IEEE trapping mode. The next libc version
has appropriate wrappers and also contains an x87 compatible
setfpucw() function.
Oops, now I almost forgot: the patch is available as:
ftp://ftp.azstarnet.com/pub/linux/axp/sys/axp-diff-1.3.48-pci.gz
and is relative to Linus's 1.3.48 version. Precompiled binaries for
the Noname and Cabrio are available in the same directory.
Enjoy,
--david