[PATCH] Fix rounding bug in emulation for double float operating
Kumar Gala
galak at kernel.crashing.org
Fri Dec 14 16:01:36 EST 2007
On Dec 9, 2007, at 11:00 PM, Liu Yu wrote:
>
> 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 at freescale.com>
>
> ---
> arch/powerpc/math-emu/op-2.h | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
applied.
- k
More information about the Linuxppc-dev
mailing list