ARM: Fix modulo operator and math.floor/ceil for inf/nan.

This commit is contained in:
Mike Pall 2012-05-10 16:19:07 +02:00
parent 48567b6043
commit 3fc5948abf

View File

@ -1303,6 +1303,7 @@ static void build_subroutines(BuildCtx *ctx)
| b ->fff_restv | b ->fff_restv
| |
|2: // |x| < 1 |2: // |x| < 1
| bcs ->fff_restv // |x| is not finite.
| orr CARG3, CARG3, CARG1 // ztest = abs(hi) | lo | orr CARG3, CARG3, CARG1 // ztest = abs(hi) | lo
|.if "func" == "floor" |.if "func" == "floor"
| tst CARG3, CARG2, asr #31 // return (ztest & sign) == 0 ? 0 : -1 | tst CARG3, CARG2, asr #31 // return (ztest & sign) == 0 ? 0 : -1
@ -2055,6 +2056,7 @@ static void build_subroutines(BuildCtx *ctx)
| bx lr | bx lr
| |
|2: // |x| < 1: |2: // |x| < 1:
| bxcs lr // |x| is not finite.
| orr CARG3, CARG3, CARG1 // ztest = (2*hi) | lo | orr CARG3, CARG3, CARG1 // ztest = (2*hi) | lo
|.if "func" == "floor" |.if "func" == "floor"
| tst CARG3, CARG2, asr #31 // iszero = ((ztest & signmask) == 0) | tst CARG3, CARG2, asr #31 // iszero = ((ztest & signmask) == 0)