History log of /arch/powerpc/math-emu/math.c
Revision Date Author Comments
cc7059b5ea730edde256deb94a42f8e9e732d9b8 04-Jul-2013 James Yang <James.Yang@freescale.com> powerpc/math-emu: Fix load/store indexed emulation

Load/store indexed instructions where the index register RA=R0, such
as "lfdx f1,0,r3", are not illegal.

Load/store indexed with update instructions where the index register
RA=R0, such as "lfdux f1,0,r3", are invalid, and, to be consistent
with existing math-emu behavior for other invalid instruction forms,
will signal as illegal.

Signed-off-by: James Yang <James.Yang@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
037f0eed57c3f35367ac32275e45f24e297549e9 14-Jul-2013 Kevin Hao <haokexin@gmail.com> powerpc: Make flush_fp_to_thread() nop when CONFIG_PPC_FPU is disabled

In the current kernel, the function flush_fp_to_thread() is not
dependent on CONFIG_PPC_FPU. So most invocations of this function
is not wrapped by CONFIG_PPC_FPU. Even through we don't really
save the FPRs to the thread struct if CONFIG_PPC_FPU is not enabled,
but there does have some runtime overhead such as the check for
tsk->thread.regs and preempt disable and enable. It really make
no sense to do that. So make it a nop when CONFIG_PPC_FPU is
disabled. Also remove the wrapped #ifdef CONFIG_PPC_FPU
when invoking this function.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
e05c0e81b0628808a7490c35d1803644a18b0405 16-Jul-2013 Kevin Hao <haokexin@gmail.com> powerpc: split She math emulation into two parts

For some SoC (such as the FSL BookE) even though there does have
a hardware FPU, but not all floating point instructions are
implemented. Unfortunately some versions of gcc do use these
unimplemented instructions. Then we have to enable the math emulation
to workaround this issue. It seems a little redundant to have the
support to emulate all the floating point instructions in this case.
So split the math emulation into two parts. One is for the SoC which
doesn't have FPU at all and the other for the SoC which does have the
hardware FPU and only need some special floating point instructions to
be emulated.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
6761ee3d7e139ec8728e1515bfc5fdcaf3be317e 14-Jul-2013 Kevin Hao <haokexin@gmail.com> powerpc/math-emu: Move the flush FPU state function into do_mathemu

By doing this we can make sure that the FPU state is only flushed to
the thread struct when it is really needed.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
f0870c55301da7e27be53d65dc62020a0fba749a 10-Jul-2013 Kevin Hao <haokexin@gmail.com> powerpc/math-emu: Remove the unneeded check for CONFIG_MATH_EMULATION in math.c

The math.c is only built when CONFIG_MATH_EMULATION is enabled.
So the #ifdef check for CONFIG_MATH_EMULATION in it seems redundant.
Drop all of them.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
cf5c2e543c7b4a5ec49f547070c0f3f4c95e20ed 10-Jul-2013 Kevin Hao <haokexin@gmail.com> powerpc/math-emu: Remove the dead code in math.c

The math.c is only built when CONFIG_MATH_EMULATION is enabled.
So we would never get into the case that CONFIG_MATH_EMULATION
is not defined in this file.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
04ae9001719c3f0012d239a7c5aa4136f6b6541d 09-Jun-2013 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/math-emu: Fix decoding of some instructions

The decoding of some instructions such as fsqrt{s} was incorrect,
using the wrong registers, and thus could not work.

This fixes it and also adds a couple of place holders for missing
instructions.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
d2b194ed820880eb19c43b9c10d9f5f30026ee54 04-Jun-2008 Kumar Gala <galak@kernel.crashing.org> powerpc/math-emu: Use kernel generic math-emu code

The math emulation code is centered around a set of generic macros that
provide the core of the emulation that are shared by the various
architectures and other projects (like glibc). Each arch implements its
own sfp-machine.h to specific various arch specific details.

For historic reasons that are now lost the powerpc math-emu code had
its own version of the common headers. This moves us to using the
kernel generic version and thus getting fixes when those are updated.

Also cleaned up exception/error reporting from the FP emulation functions.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
9c75a31c3525a127f70b919856e32be3d8b03755 26-Jun-2008 Michael Neuling <mikey@neuling.org> powerpc: Add macros to access floating point registers in thread_struct.

We are going to change where the floating point registers are stored
in the thread_struct, so in preparation add some macros to access the
floating point registers. Update all code to use these new macros.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
ba02946a903015840ef672ccc9dc8620a7e83de6 12-Oct-2007 Kumar Gala <galak@kernel.crashing.org> [POWERPC] Fix handling of stfiwx math emulation

Its legal for the stfiwx instruction to have RA = 0 as part of its
effective address calculation. This is illegal for all other XE
form instructions.

Add code to compute the proper effective address for stfiwx if
RA = 0 rather than treating it as illegal.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
5cd272085bbc905532869f3e1fd18a7100496b56 28-Mar-2006 Kumar Gala <galak@kernel.crashing.org> powerpc: move math-emu over to arch/powerpc

Towards the goal of having arch/powerpc not build anything over in arch/ppc
move math-emu over. Also, killed some references to arch/ppc/ in the
arch/powerpc Makefile which should belong in drivers/ when the particular
sub-arch's move over to arch/powerpc.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>