Port-sparc archive

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

sparc v8 .mul &co



For v8 we have a stub .mul implementation in /lib/libsparc_v8.so.0
that just calls the v8 smul instruction instead of the lengthy v7
routine in common/lib/libc/arch/sparc/gen/mul.S (from the sparc
manual).

The problem is, the trivial v8 ".mul" routine is not actually
compatabile with the v7 ".mul"

smul leaves its 64-bit output in %y, %o0 (rd), while .mul leaves its
output in %o1, %o0.  It also "indicates that overflow has occurred by
clearing the Z condition code upon return [note that this is different
from condition codes set by the SMULcc and UMULcc instructions]."

I've come across some handwritten sparc asm that fails with our v8
stub b/c of this difference.  I wonder how come we never stubmled over
this before.

-uwe


Home | Main Index | Thread Index | Old Index