milankl/SoftPosit.jl

standard 2022 available

KlausC opened this issue · 5 comments

There is a new standard document available, which outdates the draft link given in README.
Probably it would be worth while adapting the software - look for an adapted version of the underlying C-library.

posithub

Many thanks for sharing this. Yes, I intend to eventually update SoftPosit.jl to match the current posit standard. I believe there's two main issues for that

  • Rename Posit16_2 to Posit16 etc to match that the standard proposes to always use 2 exponent bits for 8,16 and 32 bits.
  • Change the rounding mode from "round to zero at |x| < minpos/2" to never underflow.

Do you know whether there's any ambition to update SoftPosit-C ? At the moment the arithmetic functions here are still called from that library although it's actually faster to use the pure-Julia implementation of the conversions and to convert to Float32 do the arithmetic and convert back. So if the timeline of updating SoftPosit-C is longer than what we can do here, I'd suggest to

  • implement Posit8 <-> Float32 and Posit32 <-> Float64
  • replace all arithmetics with conversions - float arithmetic - back conversion

This should also allow SoftPosit.jl to be independent of SoftPosit-C.

Out of curiosity, are there other software implementations of posit apart from the C library?

there's a list here, but I believe the quality of the libraries varies quite a lot https://posithub.org/docs/PDS/PositEffortsSurvey.html

Started #68 to address these issues.

v0.5 (once #68 is merged) will include the 2022 standard, all the points from above have been addressed. The new version is independent of C-SoftPosit, more flexible (one conversion function for all formats) and faster (see #69). Feel free to reopen this issue in case there are still issues around the 2022 standard