Skip to content

Commit

Permalink
softfloat: Fix shift128Right for shift counts 64..127
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
pm215 authored and Anthony Liguori committed Jun 10, 2013
1 parent bc7d0e6 commit 4039736
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fpu/softfloat-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4039736

Please sign in to comment.