Skip to content

Commit

Permalink
Use SoftFloat 3e for implementing arithmetic operations in RzFloat (#…
Browse files Browse the repository at this point in the history
…4535)

* Add a new test for checking 80-bit floating point operations

    * New test `f80_ieee_div_test` tests the division of two 80-bit
      floats

* Add SoftFloat 2c as a meson subproject

* Add softfloat code to make the failing test case pass

* Update the hash for the latest softfloat revision

* Implement `rz_float_sqrt` using SoftFloat

* Run the `f80_ieee_div_test` only for x86

* Replace SoftFloat version 2c with 3e

    * 3e has less bugs and more features
    * Modify the implementation in accordance

* Update SoftFloat revision and add a guard around the 80-bit div test

* Use SoftFloat for add, sub, mul operations as well

* Make rem and mod also use SoftFloat functions

    * Also add test for mod and rem, and fix behavior of rem

* Add comment about behavior of mod and rem

* Add comments for tests which have different results for mod and rem

* Simplify usage of loop variable as suggested in review

* Remove unused macro from float.c

* Implement `FMA` and `ROUND` using SoftFloat API

* Add more tests for 80-bit floats

* Change remote to a repository under rizinorg

* Add info about the rounding mode in the Doxygen for rem and mod

* Add comments in tests for rem and mod in `test_float.c`

* Use bitvectors to initialize 80-bit soft floats

    * This makes the tests more portable and hence they can be run on
      any platform

* Remove guards for f80 tests since they are portable now
  • Loading branch information
DMaroo authored Jun 25, 2024
1 parent 3a33626 commit 19ec6ba
Show file tree
Hide file tree
Showing 9 changed files with 490 additions and 1,303 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ subprojects/libmspack/
subprojects/blake3/
subprojects/xz-*/
subprojects/zstd-*/
subprojects/softfloat/
dist/windows/Output
# Core files generated by OpenBSD
*.core
1 change: 1 addition & 0 deletions doc/PACKAGERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ At the time of writing, these are:
* `use_sys_libmspack`
* `use_sys_pcre2`
* `use_sys_tree_sitter`
* `use_sys_softfloat`

See [meson_options.txt][] for a complete list of compile-time options.

Expand Down
Loading

0 comments on commit 19ec6ba

Please sign in to comment.