On Mon, Aug 19, 2002 at 03:11:25PM -0500, Branden Robinson wrote: > On Mon, Aug 19, 2002 at 07:22:14PM +0100, Philip Blundell wrote: > > The kernel does have some support for emulating umul in software; see > > arch/sparc/kernel/traps.c::do_illegal_instruction. This code seems to > > only be enabled for sun4c and sun4, whereas the original poster > > mentioned he is using sun4m. > > Thanks, Phil! > > SPARC folks: is there such a thing as a 4m that doesn't implement the > umul instruction?
Seems there is. The Cypress is a v7 CPU, but with a sun4m MMU. So it's sort of inbetween what is commonly accepted as a sun4c and a sun4m. > > It looks like the umul in X is actually coming from a piece of > > handwritten assembler in hw/xfree86/loader/SparcMulDiv.S. This could > > presumably be replaced by an implementation that doesn't use umul > > without too much trouble, but I guess the performance hit for other > > users wouldn't be justified. > > Any suggestions for how run-time checking could be done? Yes. The solution is in the HWCAP's. The kernel sets the Elf flags properly, so the code just needs to check them. If HWCAP_SPARC_MULDIV is set, then you can use hardware muldiv functions. Otherwise, it needs the software version. What I don't understand is why xfree86 is trying to handle this itself. Glibc has these functions already, so it seems the code is a waste. This is definitely a bug in xfree86. I'm working on a patch right now. -- Debian - http://www.debian.org/ Linux 1394 - http://linux1394.sourceforge.net/ Subversion - http://subversion.tigris.org/ Deqo - http://www.deqo.com/