Handle division by zero case in Sparc64 udivx and sdivx ops

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2767 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2007-05-02 16:37:44 +00:00
parent 5a1237c45f
commit 14a1120e5c
1 changed files with 6 additions and 0 deletions

View File

@ -926,12 +926,18 @@ void OPPROTO op_mulx_T1_T0(void)
void OPPROTO op_udivx_T1_T0(void)
{
if (T1 == 0) {
raise_exception(TT_DIV_ZERO);
}
T0 /= T1;
FORCE_RET();
}
void OPPROTO op_sdivx_T1_T0(void)
{
if (T1 == 0) {
raise_exception(TT_DIV_ZERO);
}
if (T0 == INT64_MIN && T1 == -1)
T0 = INT64_MIN;
else