Mixing hard and soft floating point?
Wolfgang Denk
wd at denx.de
Mon Oct 19 00:10:02 EST 2009
Dear Joakim Tjernlund,
In message <OFEFBDE7C9.DA9D5B8B-ONC1257653.003E3DC6-C1257653.003F0B37 at transmode.se> you wrote:
>
> > If the application is really using FP instructions a lot, then there
> > is a huge difference between using soft-float and MATH_EMU; I
> > remember test cases where soft-float was faster by factors of
> > 500...1000.
>
> Ouch, I had no idea that it could be that much.
Well, consider really simple operations, like FP add or similar, and
compare the library code for the soft-FP implementationagainst the
cost for a trap into the kernel. Or even worse - a consider simple
assignment ("float x, foo; x = foo"); with soft-float: "lis 9,x at ha;
stw 3,x at l(9)" = 2 instructions, with MATH_EMU "lis 9,x at ha; stfs
1,x at l(9)" = 1 insn plus a kernel trap.
For real numbers, run a benchmark that models your real use case.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Little known fact about Middle Earth: The Hobbits had a very sophi-
sticated computer network! It was a Tolkien Ring...
More information about the Linuxppc-dev
mailing list