summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/math-emu
Commit message (Collapse)AuthorAgeFilesLines
* powerpc/math_emu/efp: Look for errata handler when type mismatchesLiu Yu2011-10-061-5/+1
| | | | | | | | | We already have cpu a005 errata handler when instruction cannot be recognized. Before we lookup the inst, there's type checking, and we also need to handle it in errata handler when the type checking failed. Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/math_emu/efp: No need to round if the result is exactLiu Yu2011-10-061-1/+10
| | | | | Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/math_emu/efp: Use pr_debug instead of printkLiu Yu2011-10-061-46/+37
| | | | | Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/85xx: Fix SPE float to integer conversion failureShan Hai2011-03-151-4/+8
| | | | | | | | | | | | | | | | | | | | | | | Conversion from float to integer should based on both the instruction encoding and the sign of the operand. A simple testcase to show the issue: static float fm; static signed int si_min = (-2147483647 - 1); static unsigned int ui; int main() { fm = (float) si_min; ; ui = (unsigned int)fm; printf("ui=%d, should be %d\n", ui, si_min); return 0; } Result: ui=-1, should be -2147483648 Signed-off-by: Shan Hai <shan.hai@windriver.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/85xx: Workaroudn e500 CPU erratum A005Liu Yu2011-03-151-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | This erratum can occur if a single-precision floating-point, double-precision floating-point or vector floating-point instruction on a mispredicted branch path signals one of the floating-point data interrupts which are enabled by the SPEFSCR (FINVE, FDBZE, FUNFE or FOVFE bits). This interrupt must be recorded in a one-cycle window when the misprediction is resolved. If this extremely rare event should occur, the result could be: The SPE Data Exception from the mispredicted path may be reported erroneously if a single-precision floating-point, double-precision floating-point or vector floating-point instruction is the second instruction on the correct branch path. According to errata description, some efp instructions which are not supposed to trigger SPE exceptions can trigger the exceptions in this case. However, as we haven't emulated these instructions here, a signal will send to userspace, and userspace application would exit. This patch re-issue the efp instruction that we haven't emulated, so that hardware can properly execute it again if this case happen. Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/Makefiles: Change to new flag variablesmatt mooney2010-10-131-1/+1
| | | | | | | Replace EXTRA_CFLAGS with ccflags-y and EXTRA_AFLAGS with asflags-y. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* powerpc/math-emu: Fix efp dependenceLiu Yu2009-03-111-3/+2
| | | | | | | | There is no dependece between efp and math-emu. But when disable math-emu the efp code cannot be built. Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc: Add SPE/EFP math emulation for E500v1/v2 processors.Liu Yu2008-12-032-0/+722
| | | | | | | | | | | | | | | | | This patch add the handlers of SPE/EFP exceptions. The code is used to emulate float point arithmetic, when MSR(SPE) is enabled and receive EFP data interrupt or EFP round interrupt. This patch has no conflict with or dependence on FP math-emu. The code has been tested by TestFloat. Now the code doesn't support SPE/EFP instructions emulation (it won't be called when receive program interrupt), but it could be easily added. Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/math-emu: Remove redundant 'ret'Liu Yu2008-12-0318-52/+34
| | | | | | | | FP_DECL_EX is already used, so ret is redundant. And FP_SET_EXCEPTION will add status into return value. Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/math-emu: Use kernel generic math-emu codeKumar Gala2008-10-0145-2574/+278
| | | | | | | | | | | | | | | 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>
* powerpc: Add macros to access floating point registers in thread_struct.Michael Neuling2008-07-011-28/+28
| | | | | | | | | 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>
* [POWERPC] Replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-0141-46/+46
| | | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
* [POWERPC] Fix carry bug in 128-bit unsigned integer addingLiu Yu2008-01-231-10/+30
| | | | | | | Synchronize it to the definition in include/math-emu/op-4.h for short term. Signed-off-by: Liu Yu <Yu.Liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* [POWERPC] Fix rounding bug in emulation for double float operatingLiu Yu2007-12-131-1/+2
| | | | | | | | | | | | | | | | | This patch fixes rounding bug in emulation for double float operating on PowerPC platform. When pack double float operand, it need to truncate the tail due to the limited precision. If the truncated part is not zero, the last bit of work bit (totally 3 bits) need to '|' 1. This patch is completed in _FP_FRAC_SRS_2(X,N,sz) (arch/powerpc/math-emu/op-2.h). Originally the code leftwards rotates the operand to just keep the truncated part, then check whether it is zero. However, the number it rotates is not correct when N is not smaller than _FP_W_TYPE_SIZE, and it will cause the work bit '|' 1 in the improper case. This patch fixes this issue. Signed-off-by: Liu Yu <b13201@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* [POWERPC] Fix handling of stfiwx math emulationKumar Gala2007-10-161-4/+9
| | | | | | | | | | | 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>
* [POWERPC] ppc math-emu needs -fno-builtin-fabs for math.c and fabs.cAl Viro2006-09-261-0/+3
| | | | | | | ... since they deal with internal function with that name. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Mackerras <paulus@samba.org>
* Remove obsolete #include <linux/config.h>Jörn Engel2006-06-301-1/+0
| | | | | Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* powerpc: move math-emu over to arch/powerpcKumar Gala2006-03-2753-0/+4506
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>
OpenPOWER on IntegriCloud