UPDATE: DMCP-3.10 / DM42-3.10

This is where announcements of official firmware updates provided by SwissMicros for the DM42 calculator will be made.

Please do not post bug reports here. The Usage tips, tricks and problem reports forum is there for that.

Please do not post notices of third party firmware builds here, they will be deleted. Instead, please use the Third Party firmware builds forum for this purpose.
Thomas_ER
Posts: 192
Joined: Mon Jul 24, 2017 3:19 pm
Location: Germany

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas_ER »

Dani R. wrote:
Tue Oct 09, 2018 11:44 pm
DA74254 wrote:
Tue Oct 09, 2018 9:11 pm

I can confirm that mine crashes as well. SN 00245.
Just to note; mine crashes also connected to USB power and voltage indication 3,02V (5^E10)
Same here, crash on battery and USB power.
Same for me (crashes/freeze with DM42-3.10; OK with 3.9),
both units.
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by grsbanks »

OK, we've found the cause of the Y^X crash. It's the updated Intel Decimal Floating Point Library.

A version of DM42 built against library 2.0u2 hangs, one built against 2.0u1 does not hang. This is reproducible 100% for us and the compiler optimisations make no difference.

Noteworthy is the fact that the benchmark that has started crashing also uses the Y^X function so the two might be related.

Thanks for bringing this to our attention.

Stay tuned for a fw update soon.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken »

grsbanks wrote:
Wed Oct 10, 2018 10:32 am
OK, we've found the cause of the Y^X crash. It's the updated Intel Decimal Floating Point Library.
Yikes. Does it crash inside bid128_pow()?

I'll have to take a look at what happens when I build Free42 with the updated library. It seems odd that they would break an existing function like that, but since Free42 handles this case by simply calling bid128_pow(), it's not very obvious what could be wrong on that end, either.
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by grsbanks »

Thomas Okken wrote:
Wed Oct 10, 2018 3:19 pm
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.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken »

I compared the 2.0u1 and 2.0u2 versions of bid128_pow(), and there is a change:

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;
>   }
>
Special-case code for integer exponents, using recursive repeated squaring. What happens when you calculate 5^(1e10 + 0.0001)?

I'll test this with Free42 tonight...
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by grsbanks »

Thomas Okken wrote:
Wed Oct 10, 2018 7:04 pm
Special-case code for integer exponents, using recursive repeated squaring. What happens when you calculate 5^(1e10 + 0.0001)?
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.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
User avatar
Guenter
Posts: 168
Joined: Wed May 24, 2017 6:26 pm
Location: Germany

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Guenter »

Well, the obvious bug in 3.10 is annoying. But on the other hand I practiced how easy it is to go back to the previous version. Symply keep the old DM42 program(s) on the calculator (or reload it), invoke "SETUP/SYSTEM/Enter System Menu/Reset to DMCP menu" or SETUP/4/2/4 and select the DM42 program you wish to run (here DM42-3.9.1.pgm). That's quite cool, isn't it?

Günter
Günter
DM42 SN:00004 and SN:00184 -- DM41X SN:00013 and SN:00955
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken »

5^(2^31-1) => Out of Range
5^(2^31) => freeze

(On the DM42 with the 3.10 firmware)
Last edited by Thomas Okken on Thu Oct 11, 2018 12:20 am, edited 1 time in total.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken »

I tried the Linux (64-bit) and Windows (32-bit) builds with the 2.0u2 library, and neither had a problem with 5^(1e10), 5^(2^31), or 5^(2^31-1).
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by mcc »

Thomas Okken wrote:
Wed Oct 10, 2018 11:03 pm
5^(2^31-1) => Out of Range
5^(2^31) => freeze

(On the DM42 with the 3.10 firmware)
Confirmed
5
enter
2
enter
31
x^y
x^y

and it never comes back. Need to do the reset-via-needle-trick...

Cheers!
Meino
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
Post Reply