aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/half_float.c
Commit message (Collapse)AuthorAgeFilesLines
* util: add float to float16 conversions with RTZ and RTNESamuel Iglesias Gonsálvez2019-09-171-0/+7
| | | | | | | | | | | | | | | | | | In order to be coherent with the pre-existent functions, this new API is the one meant to be used when doing half float to float conversions. It is no more than a wrapper for the softfloat.h API but we meant to keep that one private. v2: - Replace custom f32 -> f16 RTZ implementation with the softfloat one (Andres). v3: - Added API usage clarifying comments (Caio). Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* src/util: Switch _mesa_half_to_float() to u_half.h's version.Eric Anholt2019-07-161-43/+2
| | | | | | | | | The two implementations differ across the entire input range only in that u_half.h preserves mantissa bits for NaNs. The u_half.h version shaves 15% off of the text size of half_float.o. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* util: mark s as MAYBE_UNUSED in _mesa_half_to_unorm8Kai Wasserbäch2018-08-181-1/+2
| | | | | | | | | | | | | Only used, when asserts are enabled. Fixes an unused-variable warning with gcc-8: ../../../src/util/half_float.c: In function '_mesa_half_to_unorm8': ../../../src/util/half_float.c:189:14: warning: unused variable 's' [-Wunused-variable] const int s = (val >> 15) & 0x1; ^ Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* util: don't use __builtin_clz unconditionallyMarek Olšák2018-07-311-1/+11
| | | | | | This fixes the build if __builtin_clz is unsupported. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: add ASTC 2D LDR decoderMarek Olšák2018-07-311-0/+59
| | | | | | Tested-by: Mike Lothian <[email protected]> Tested-By: Gert Wollny <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* glsl: move half<->float convertion to utilRob Clark2015-10-161-0/+177
Needed in NIR too, so move out of mesa/main/imports.c Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Rob Clark <[email protected]>