Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c89686210542f6946e48a907772a356b9fce03f0
Commit:     c89686210542f6946e48a907772a356b9fce03f0
Parent:     e8b5f43f7b572a898c7b17e9949b26e7362e7f31
Author:     Liu Yu <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 10 13:00:52 2007 +0800
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Thu Dec 13 22:59:00 2007 -0600

    [POWERPC] Fix rounding bug in emulation for double float operating
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/math-emu/op-2.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/math-emu/op-2.h b/arch/powerpc/math-emu/op-2.h
index b9b06b4..7d6f17c 100644
--- a/arch/powerpc/math-emu/op-2.h
+++ b/arch/powerpc/math-emu/op-2.h
@@ -59,7 +59,8 @@
     else                                                               \
       {                                                                        
\
        X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) |                   \
-                 (((X##_f1 << (sz - (N))) | X##_f0) != 0));            \
+                 (((X##_f1 << (2 * _FP_W_TYPE_SIZE - (N))) |           \
+                  X##_f0) != 0));                                      \
        X##_f1 = 0;                                                     \
       }                                                                        
\
   } while (0)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to