[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [patch] Alpha : fix cmpbge instruction
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [patch] Alpha : fix cmpbge instruction |
Date: |
Mon, 10 Nov 2008 12:11:06 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Mon, Nov 10, 2008 at 01:48:28AM -0500, Vince Weaver wrote:
> Hello
>
> The cmpbge instruction should compare all 8 bytes of one 64-bit value with
> another. However, we were looping with a < 7 condition which was skipping
> the top byte. So if we were doing a compare where the top byte was
> important, we could get the wrong result (this notably breaks the strlen()
> function with certain sized strings).
>
> Attached is a patch
Thanks, applied.
> Index: target-alpha/op_helper.c
> ===================================================================
> --- target-alpha/op_helper.c (revision 5666)
> +++ target-alpha/op_helper.c (working copy)
> @@ -330,7 +330,7 @@
> int i;
>
> res = 0;
> - for (i = 0; i < 7; i++) {
> + for (i = 0; i < 8; i++) {
> opa = op1 >> (i * 8);
> opb = op2 >> (i * 8);
> if (opa >= opb)
>
>
>
>
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' address@hidden | address@hidden
`- people.debian.org/~aurel32 | www.aurel32.net