mirror of
https://github.com/holub/mame
synced 2025-05-13 17:38:21 +03:00
drcbex86: Fix remainder clobbering quotient, thanks smf, nw
This commit is contained in:
parent
a432afe28a
commit
6adf45347f
@ -6720,6 +6720,7 @@ int drcbe_x86::ddivu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t s
|
|||||||
return FLAG_V;
|
return FLAG_V;
|
||||||
|
|
||||||
dstlo = src1 / src2;
|
dstlo = src1 / src2;
|
||||||
|
if (&dstlo != &dsthi)
|
||||||
dsthi = src1 % src2;
|
dsthi = src1 % src2;
|
||||||
return ((dstlo == 0) << 2) | ((dstlo >> 60) & FLAG_S);
|
return ((dstlo == 0) << 2) | ((dstlo >> 60) & FLAG_S);
|
||||||
}
|
}
|
||||||
@ -6736,6 +6737,7 @@ int drcbe_x86::ddivs(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src
|
|||||||
return FLAG_V;
|
return FLAG_V;
|
||||||
|
|
||||||
dstlo = src1 / src2;
|
dstlo = src1 / src2;
|
||||||
|
if (&dstlo != &dsthi)
|
||||||
dsthi = src1 % src2;
|
dsthi = src1 % src2;
|
||||||
return ((dstlo == 0) << 2) | ((dstlo >> 60) & FLAG_S);
|
return ((dstlo == 0) << 2) | ((dstlo >> 60) & FLAG_S);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user