aboutsummaryrefslogtreecommitdiff
path: root/target-alpha/op_helper.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-10 11:10:14 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-10 11:10:14 +0000
commit970d622e8ab1de8fdf5762e23e92a2dea9d7d36c (patch)
tree64502c6f9190d5cd48b21b653ac700d1c431f555 /target-alpha/op_helper.c
parente441570f8abd131ec39ca6e81aaaf0d4ade8572f (diff)
target-alpha: fix cmpbge instruction
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). (Vince Weaver) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5667 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-alpha/op_helper.c')
-rw-r--r--target-alpha/op_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index 393187eb79..0fa4fe015a 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -330,7 +330,7 @@ uint64_t helper_cmpbge (uint64_t op1, uint64_t op2)
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)