[PATCH 2/2] powerpc/math-emu: keep track of the instructions unimplemented by FPU

Kevin Hao haokexin at gmail.com
Fri Jul 12 12:25:12 EST 2013


On Thu, Jul 11, 2013 at 09:30:02AM -0500, Scott Wood wrote:
> On 07/11/2013 07:45:21 AM, Benjamin Herrenschmidt wrote:
> >On Thu, 2013-07-11 at 20:21 +0800, Kevin Hao wrote:
> >> Some cores (such as Freescale BookE) don't implement all floating
> >> point instructions in ISA. But some gcc versions do use these
> >> instructions. So we would have to enable the math emulation in this
> >> case. Add this to emulated instructions tracking statistics so that
> >> the user has a way to know that its toolcahin emit these
> >unimplemented
> >> floating point instructions.
> >
> >That patch is gross, it makes the function even more nasty than it
> >already is. Besides, CONFIG_PPC_FPU doesn't mean you have a HW FPU,
> >you need to check the CPU feature bits.
> >
> >Also the caller already does PPC_WARN_EMULATED, so this patch makes
> >you call it twice or am I missing something ?
> 
> Sorry, that was my fault -- for some reason I didn't see that when I
> grepped for PPC_WARN_EMULATED looking for math stuff, and thus
> requested it be added.  In any case, I don't see why it should be
> conditional on having an FPU (and indeed, the warning in the caller
> isn't conditional).

I thought it only made sense to warn only for the case when the core
does have a FPU but some unimplemented floating instructions are emulated.
As for the core which doesn't have a FPU at all and we explicitly enable the
math emulation it may seems a little redundant to warn in this case. But after
a second thought, this is the statistics of all the emulated instructions,
so it does seem reasonable to warn in all cases. I will remove the dependancy
on FPU.

Thanks,
Kevin

> 
> -Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20130712/765dd3dd/attachment.sig>


More information about the Linuxppc-dev mailing list