X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FPrimOps.cmm;h=c7c372756ce721c6bbcac7a8453b7edc763871cd;hb=a148ad2778c66fbfd75f138af6e6a22ab7c843fe;hp=6c3593e4a485a97306735ffdd8421db8dc51a359;hpb=372a8212471344d55128b7bffc9cf8bb962ae742;p=ghc-hetmet.git diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 6c3593e..c7c3727 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -928,16 +928,20 @@ decodeDoublezu2Intzh_fast W_ p; FETCH_MP_TEMP(mp_tmp1); FETCH_MP_TEMP(mp_tmp2); - FETCH_MP_TEMP(mp_tmp_w); + FETCH_MP_TEMP(mp_result1); + FETCH_MP_TEMP(mp_result2); /* arguments: D1 = Double# */ arg = D1; /* Perform the operation */ - foreign "C" __decodeDouble_2Int(mp_tmp1 "ptr", mp_tmp2 "ptr", mp_tmp_w "ptr", arg) []; - - /* returns: (Int# (mant high), Int# (mant low), Int# (expn)) */ - RET_NNN(W_[mp_tmp1], W_[mp_tmp2], W_[mp_tmp_w]); + foreign "C" __decodeDouble_2Int(mp_tmp1 "ptr", mp_tmp2 "ptr", + mp_result1 "ptr", mp_result2 "ptr", + arg) []; + + /* returns: + (Int# (mant sign), Word# (mant high), Word# (mant low), Int# (expn)) */ + RET_NNNN(W_[mp_tmp1], W_[mp_tmp2], W_[mp_result1], W_[mp_result2]); } /* ----------------------------------------------------------------------------- @@ -2118,7 +2122,11 @@ delayzh_fast W_ time; W_ divisor; (time) = foreign "C" getourtimeofday() [R1]; - divisor = TO_W_(RtsFlags_MiscFlags_tickInterval(RtsFlags))*1000; + divisor = TO_W_(RtsFlags_MiscFlags_tickInterval(RtsFlags)); + if (divisor == 0) { + divisor = 50; + } + divisor = divisor * 1000; target = ((R1 + divisor - 1) / divisor) /* divide rounding up */ + time + 1; /* Add 1 as getourtimeofday rounds down */ StgTSO_block_info(CurrentTSO) = target;