qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] softfloat: Fix shift128Right for shift counts 64..127
@ 2013-06-02 15:17 Peter Maydell
  2013-06-03  9:14 ` Paolo Bonzini
  2013-06-10 21:48 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2013-06-02 15:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Anthony Liguori, patches

shift128Right would give the wrong result for a shift count
between 64 and 127. This was never noticed because all of
our uses of this function are guaranteed not to use shift
counts in this range.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Found by code inspection. This contribution can be licensed
under either the softfloat-2a or -2b license.

 fpu/softfloat-macros.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fpu/softfloat-macros.h b/fpu/softfloat-macros.h
index b5164af..9b09545 100644
--- a/fpu/softfloat-macros.h
+++ b/fpu/softfloat-macros.h
@@ -168,7 +168,7 @@ INLINE void
         z0 = a0>>count;
     }
     else {
-        z1 = ( count < 64 ) ? ( a0>>( count & 63 ) ) : 0;
+        z1 = (count < 128) ? (a0 >> (count & 63)) : 0;
         z0 = 0;
     }
     *z1Ptr = z1;
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-10 21:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-02 15:17 [Qemu-devel] [PATCH] softfloat: Fix shift128Right for shift counts 64..127 Peter Maydell
2013-06-03  9:14 ` Paolo Bonzini
2013-06-10 21:48 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).