|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +nav-class: dark |
| 4 | +categories: matt |
| 5 | +title: Bigger, Faster, Stronger Types |
| 6 | +author-id: matt |
| 7 | +author-name: Matt Borland |
| 8 | +--- |
| 9 | + |
| 10 | +We continue to make exciting progress developing new libraries for inclusion in Boost, and expanding those already available. |
| 11 | + |
| 12 | +# New Libraries |
| 13 | + |
| 14 | +## int128 |
| 15 | + |
| 16 | +Int128 ([https://github.com/cppalliance/int128](https://github.com/cppalliance/int128)) is a small library that has more or less fallen out of work on Decimal. |
| 17 | +It provides two type: an unsigned 128-bit integer and a signed 128-bit integer. |
| 18 | +Since my last post the library should now be ready for beta, and subsequently production use. |
| 19 | +Much effort was put into optimizing every operation on a multitude of architectures. |
| 20 | +The documentation includes bar charts showing the performance of our types vs Boost.Multiprecision, and built-in types (if available). |
| 21 | +While orgianlly envisioned as just an improvement to the Decimal backend arithmetic, I think this has much more additional usefulness. |
| 22 | + |
| 23 | +## Decimal |
| 24 | + |
| 25 | +Decimal ([https://github.com/cppalliance/decimal](https://github.com/cppalliance/decimal)) is a ground-up implementation of IEEE 754 Decimal Floating Point types in C++14, co-authored with Chris Kormanyos. |
| 26 | +In January we had our formal review for inclusion in Boost. |
| 27 | +As int128 above became more production ready we have integrated it into Decimal as a new backend integer type. |
| 28 | +Not only do we now use the int128 as a backend, we were able to find a few bugs in integration due to the special functions test suite in Decimal. |
| 29 | +The relationship during co-development has worked out really well. |
| 30 | +We also recently merged a new 256-bit integer backend based on developments and lessons learned from `int128`. |
| 31 | +These combined have given us >100% speedups for the 128-bit types, and also benefit the 64-bit types to a lesser degree. |
| 32 | +Discussions are ongoing in the Cpplang Slack channel `#boost-decimal`. |
| 33 | + |
| 34 | +# Existing Libraries |
| 35 | + |
| 36 | +## Math |
| 37 | + |
| 38 | +As posted a few versions ago Boost.Math began offering support to be run on GPU with NVCC, NVRTC, and SYCL. |
| 39 | +We have recieved a few bug reports now that this functionallity is being used more. |
| 40 | +For Boost 1.89 we have put good effort into fixes and internal restructuring to address the issues that people have been having. |
| 41 | + |
| 42 | +## Multiprecision |
| 43 | + |
| 44 | +For the first time in a while Boost.Multiprecision has a new backend type: `cpp_double_fp_backend`. |
| 45 | +This project was started during GSoC 2021 and has finally come to full fruition. |
| 46 | +The `cpp_double_fp_backend` back-end is the sum of two IEEE floating-point numbers combined to create a type having roughly twice the composite width of one of its parts. |
| 47 | +The `cpp_double_fp_backend` back-end is used in conjunction with `number` and acts as an entirely C++ header only floating-point number type. |
| 48 | +If you need more precision than a `double` with less computational expense than arbitrary precision types look out for this in Boost 1.89. |
0 commit comments