Same for me (crashes/freeze with DM42-3.10; OK with 3.9),
both units.
Same for me (crashes/freeze with DM42-3.10; OK with 3.9),
Yikes. Does it crash inside bid128_pow()?
I can't say for sure because I don't have that level of access to the DM42 platform. This said, one user that I passed a test firmware version to reported that both types of crash ceased when using that firmware. The only difference between the current 3.10 and that test version is the Intel Decimal FP Library (2.0U2 in the 3.10 firmware, 2.0U1 in the test firmware). Dialling back the compiler optimisation has no effect either, so it isn't that.
Code: Select all
$ diff -w bid128_pow.c ../../../IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c
2c2
< Copyright (c) 2007-2011, Intel Corp.
---
> Copyright (c) 2007-2018, Intel Corp.
972a973,1003
> // Check for appropriately small (unsigned int) exponent, and compute as
> // x^N where N is that integer if EXACTLY an integer, or 1/(x^|N|) for N < 0
>
> {
> int exact_y;
> int sign = 0;
> int save_flags = *pfpsf;
>
> *pfpsf &= ~BID_INEXACT_EXCEPTION;
> BIDECIMAL_CALL1_NORND(bid128_to_int32_xrnint, exact_y, y);
> if ((*pfpsf & BID_INEXACT_EXCEPTION) == 0) {
> if (exact_y < 0) sign = 1;
> exact_y = abs(exact_y);
> if (exact_y > 0) {
> BID_UINT128 tmp, r = BID128_1;
> BID_UINT128 p = x;
> for (; exact_y; exact_y >>= 1) {
> if (exact_y & 1) {
> BIDECIMAL_CALL2(bid128_mul, r, r, p);
> }
> if (exact_y > 1)
> BIDECIMAL_CALL2(bid128_mul, p, p, p);
> }
> tmp = BID128_1;
> if (sign) BIDECIMAL_CALL2(bid128_div, r, tmp, r);
> BID_RETURN(r);
> }
> }
> *pfpsf = save_flags;
> }
>
I won't have time to test this tonight -- I have to go out -- but I'm not convinced this is going to have much to do with it unless it's just plain buggy. It uses recursive repeated squaring for values of the exponent that fit into an unsigned, 32-bit integer. 10^10 is somewhat outside that range so this portion of code shouldn't come into play.Thomas Okken wrote: ↑Wed Oct 10, 2018 7:04 pmSpecial-case code for integer exponents, using recursive repeated squaring. What happens when you calculate 5^(1e10 + 0.0001)?
ConfirmedThomas Okken wrote: ↑Wed Oct 10, 2018 11:03 pm5^(2^31-1) => Out of Range
5^(2^31) => freeze
(On the DM42 with the 3.10 firmware)