util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Thu, 6 Sep 2018 14:01:34 +0000 (16:01 +0200)
committerAndres Gomez <agomez@igalia.com>
Tue, 17 Sep 2019 20:39:18 +0000 (23:39 +0300)
commit5308333e789e19956172d4e77e7ae4cf2fb4eafb
tree07d5a269097c3adb93575c17d0280e0317cb8a94
parent733ede8ff6c107ff2acb2dc6ba647d3ad2b3b6dc
util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes

In order to be coherent with the pre-existent API for half floats,
this new API for double is the one meant to be used when doing double
to float conversions. It is no more than a wrapper for the softfloat.h
API but we meant to keep that one private.

v2:
- Fix bug in _mesa_double_to_float_rtz() in the inf/nan detection
  using the exponent value.

v3:
- Replace custom f64 -> f32 implementations with the softfloat
  one (Andres).

v4:
- Added API usage clarifying comments (Caio).

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/util/Makefile.sources
src/util/double.c [new file with mode: 0644]
src/util/double.h [new file with mode: 0644]
src/util/meson.build