llvm-project/libclc/generic/lib
Daniel Stone 59510c4212 libclc: Fix rounding during type conversion
The rounding during type conversion uses multiple conversions, selecting
between them to try to discover if rounding occurred. This appears to
not have been tested, since it would generate code of the form:
    float convert_float_rtp(char x)
    {
      float r = convert_float(x);
      char y = convert_char(y);
      [...]
    }

which will access uninitialised data. The idea appears to have been to
have done a char -> float -> char roundtrip in order to discover the
rounding, so do this.

Discovered by inspection.

Signed-off-by: Daniel Stone <daniels@collabora.com>

Reviewed By: jvesely

Differential Revision: https://reviews.llvm.org/D81999
2021-08-19 22:24:19 -07:00
..
async
atomic
cl_khr_global_int32_base_atomics
cl_khr_global_int32_extended_atomics
cl_khr_int64_base_atomics
cl_khr_int64_extended_atomics
cl_khr_local_int32_base_atomics
cl_khr_local_int32_extended_atomics
common libclc: Add Mesa/SPIR-V target 2020-08-17 14:01:46 -07:00
geometric
integer
math libclc: Add a __builtin to let SPIRV targets select between SW and HW FMA 2020-09-16 01:37:22 -04:00
misc
relational
shared
workitem
SOURCES
atom_int32_binary.inc
clc_unary.inc
clcmacro.h
gen_convert.py libclc: Fix rounding during type conversion 2021-08-19 22:24:19 -07:00
subnormal_config.cl
subnormal_disable.ll
subnormal_helper_func.ll
subnormal_use_default.ll