Commit graph

14 commits

Author SHA1 Message Date
Christophe de Dinechin
c736e6a388 doc: Record performance data about unit conversion
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-07-28 14:14:04 +02:00
Christophe de Dinechin
18352159b0 doc: Update performance numbers for 1M loops
Ran 1M loops with hardware-accelerated, updated the numbers.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-08 12:13:36 +01:00
Christophe de Dinechin
2dbbec4ad7 Release 0.6.4 "Healing": Testing and fixes
This release focuses on heavy testing of the new variable-precision
decimal stack. Adding tests also means finding bugs.

Another significant change is support for fixed-precision
hardware-accelerated floating point, using 32-bit and 64-bit IEEE754
binary floating-point representation. Since this uses a binary format,
some decimal values do not map to decimal correctly. For example,
displaying 1.2 with a large number of decimals will show residue,
because 1.2 does not have an exact (zero-terminated) representation in
binary.

New features:

* plotting: Make refresh rate configurable
* menu: Add `/` key to `FractionsMenu`
* hwfp: Add support for hardware-accelerated floating-point
* menus: Add hardware floating-point flag to `MathModesMenu`
* ui: Allow multiple uses of `.` to insert DMS separators
* HMS: Editing of HMS values in HMS format

Bug fixes:

* stats: Fix crash on `variance` with single-column statistics
* algebraic: Clear error before evaluating the function
* functions: Correctly emit a type error for non-algebraics
* ui: Make sure we save stack if closing the editor
* logical: Fix mask for rotate left with 64-bit size
* logical: Make sure we save args for single-argument logicals
* flags: Update flags on `FlipFlag`, consume them from `BinaryToFlags`
* stack: Show multi-line objects correctly
* lists: Returns `Bad argument value` for index with bad arguments
* lists: Return an empty list for tail of empty list
* arithmetic: `→Frac` should not error on integers
* power: Do not shut down during `WAIT` if on USB power

Improvements:

* menu: Shorten the labels `→QIter` and `→QPrec` to avoid scrolling
* stack: Avoid running same code twice on simulator
* ids: Add aliases for hardware floating point
* functions: Optimize abs and neg
* ui: Replace calls to `rt.insert` with calls to `insert`
* menu: Reorganize fractions menu
* dms: Do the DMS conversion using fractions
* list: Adjust multi-line rendering
* copyright: Update copyright to 2024
* text: Return null text when indexing past end of text

Testing:

* tests: Increase the delay for help to draw
* tests: Add tests for hardware-accelerated floating-point
* tests: Add shifts and rotate tests
* tests: Check flag functions
* tests: Test DMS and HMS operations
* tests: Add test for `integrate` using decimal values
* tests: Test multi-line stack display
* tests: Add tests for `GETI`
* tests: Min and max commands
* tests: Repair last regression test
* tests: Check behaviour of 0^0
* tests: Avoid string overflow in case of very long message

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-05 01:12:46 +01:00
Christophe de Dinechin
c12d27ac8b hwfp: Add support for hardware-accelerated floating-point
The hardware-accelerated floating-point support in the ARM chip is
about 2000 faster than the variable-precision decimal floating point
implementation. It makes sense to use it.

See numbers recorded in `doc/6-Performance.md` for details.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-02-05 00:24:27 +01:00
Christophe de Dinechin
887f4173b4 doc: Record performance data for 1000 iterations of SumTest
We need to start recording the performance data of the decimal code on
a release-to-release basis. Definitely much slower than before, hence
the need to be realistic and reduce the number of iterations.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-01-18 22:48:16 +01:00
Christophe de Dinechin
666b6e1d24 doc: Redcord pertformance information for 0.6.0
Record the (bad) performance data for the variable-precision
decimal number representation.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-28 18:05:10 +01:00
Christophe de Dinechin
8745eb0414 docs: Record performance comparing variable-precision with BID128
As expected, variable precision incurs a performance cost, but it is
quite reasonable.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-25 19:35:23 +01:00
Christophe de Dinechin
6c94f3d700 Release 0.5.2 "Christmas Eve": Reaching hard limits on DM42
This release was a bit longer in coming than earlier ones, because we are about
to reach the limits of what can fit on a DM42. This release uses 711228 bytes
out of the 716800 (99.2%).

Without the Intel Decimal Library code, we use only 282980 bytes. This means
that the Intel Decimal Library code uses 60.2% of the total code space. Being
able to move further requires a rather radical rethinking of the project, where
we replace the Intel Decimal Library with size-optimized decimal code.

As a result, release 0.5.2 will be the last one using the Intel Decimal Library,
and is release in parallel with 0.6.0, which switches to a table-free and
variable-precisions implementation of decimal code that uses much less code
space. The two releases should otherwise be functionally identical

**New features**

* Shift and rotate instructions (#622)
* Add `CompatibleTypes` and `DetsailedTypes` setting to control `Type` results
* Recognize HP-compatible negative values for flags, e.g. `-64 SF` (#625)
* Add settings to control multiline result and stack display (#634)

**Bug fixes**

* Truncate to `WordSize` the small results of binary operations (#624)
* Fix day-of-week shortcut in simulator
* Avoid double-evaluation of immediate commands when there is no help
* Generate an error when selecting base 1 (#628)
* Avoid `Number too big` error on based nunbers
* Correctly garbage-collect menu entries (#630)
* Select default settings that allow solver to find solutions (#627)
* Fix display of decimal numbers (broken by multi-line display)
* Fix rendering of menu entries for `Fix`, `Std`, etc
* Detect non-finite results in arithmetic, e.g. `(-8)^0.3`m (#635, #639)
* Fix range-checking for `Dig` to allow `-1` value
* Accept large values for `Fix`, `Sci` and `Eng` (for variable precision)
* Restore missing last entry in built-in units menu (#638)
* Accept `Hz` and non-primary units as input for `ConvertToUnitPrefix` (#640)
* Fix LEB128 encoding for signed value 64 and similar (#642)
* Do not parse `IfThenElse` as a command
* Do not consider `E` as a digit in decimal numbers (#643)
* Do not parse `min` as a function in units, but as minute (#644)

**Improvements**

* Add `OnesComplement` flag for binary operation (not used yet)
* Add `ComplexResults` (-103) flag (not used yet)
* Accept negative values for `B→R` (according to `WordSize`)
* Add documentation for `STO` and `RCL` accessing flash storage
* Mention `True` and `False` in documentation
* Rename `MaxBigNumBits` to `MaxNumberBits`
* Return HP-compatible values from `Type` function
* Minor optimization of flags implementation
* Catalog auto-completion now suggests all possible spellings (#626)
* Add aliases for `CubeRoot` and `Hypothenuse`
* Align based number promotion rules to HP calculators (#629)
* Expand the range of garbage collector integrity check on simulator
* Show command according to preferences in error messages (#633)
* Avoid crash in `debug_printf` if used before font initialization
* Update performance data in documentation
* Add ability to disable any reference to Intel Decimal Floating-point library
* Simplify C++ notations for safe pointers (`+x` and `operartor bool()`)
* Fix link to old `db48x` project in `README.md`

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-25 19:14:26 +01:00
Christophe de Dinechin
0c11203c20 docs: Update performance information for 0.5.0 and 0.5.1
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-12-02 17:18:23 +01:00
Christophe de Dinechin
d696c3ca38 runtime: Remove the execute callback
Defer program and expression execution to the `program` class.
This allows us to remove `execute()`, which applies to every object,
with `run()`, which only exists for `program`. There is also a
`program::run()` static member that dynamic checks if we should run
`evaluate()` or if we can `run()`.

Also reimplement `while`, `until`, `if`, `ift`and `ifte` using a
deferred conditional so as to avoid C++ stack recursion.

This allows us to have really good behaviour on tail recursion, see
the `Collatz` and `CBench` examples in the `Demo.48S` file. For this
particular case, DB48X on DM42 is 25x faster than the HP50G, which
becomes slower as the recursion depth increases.

Fixes: #537

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-11-09 18:03:43 +01:00
Christophe de Dinechin
ebb6c8a377 performance: Implement some highly-focused optimizations
Did a few additional focused optimizations that bring back another
100ms on the `NQueens` benchmark on the DM42.

This comes at the expense of about 4K of additional generated code,
which is probably as much as is reasonable to dedicate to this.

The numbers for the DM32 are now the best we ever had.

Fixes: #533

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-11-03 23:05:09 +01:00
Christophe de Dinechin
044352cc4c types: Reimplement a range-based type checking
Reimplement a range-based type-checking that does not require a memory
access and a bitmap check every time a type is checked.

This brings the `NQueens` execution time on DM42 from 1215 to 1175,
which is about 3%.

Fixes: #532

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-11-03 21:45:40 +01:00
Christophe de Dinechin
8fd3220f44 performance: Reduce frequency of busy cursor drawing
Retrict the busy cursor drawing to key transitions:

* Starting to evaluate the command line
* Drawing the stack
* Entering / exiting the garbage collector

This leads to much less frequent animation, but gets us 20% back
on the `NQueens` benchmark on DM42 (from 1447 down to 1215ms).

Fixes: #531

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-11-03 20:31:29 +01:00
Christophe de Dinechin
c1f20ad2df Performance optimization
Performance optimization of object dispatch

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-11-03 19:42:12 +01:00