Boost logo

Boost :

From: Matt Borland (matt_at_[hidden])
Date: 2024-05-15 11:17:04


>

> Matt, do we have benchmarks comparing yours to the decimal64
> implementation in GCC?
> i.e. The C++ std::decimal::decimal64 in <decimal/decimal> as well as
>

> the C _Decimal64
> (https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html)
> Those are backed by Intel's BID library.
>

Not yet, but I will add them. Our focus has been on ensuring correctness first, and only recently began optimizing routines for performance.

> Your implementation of decimal64 also stores a uint64_t of the IEEE
> 754 Decimal64 (presumably BID not DPD) format, correct?

Correct, we use the BID format.

> This also means that on every operation you have to decode significand,
> exponent, sign out of this - which isn't trivial given the format.
>

It's a series of bit-fiddling operations: https://github.com/cppalliance/decimal/blob/develop/include/boost/decimal/decimal64.hpp#L1006. Encoding from significand, exponent and sign is a much harder operation: https://github.com/cppalliance/decimal/blob/develop/include/boost/decimal/decimal64.hpp#L605

Matt






Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk