[libclc] libclc: clspv: update gen_convert.cl for clspv (PR #66902)
Kévin Petit via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 14 04:23:53 PDT 2024
================
@@ -307,8 +320,8 @@ def generate_saturated_conversion(src, dst, size):
# Conversion from float to int
print(
""" {DST}{N} y = convert_{DST}{N}(x);
- y = select(y, ({DST}{N}){DST_MIN}, {BP}(x < ({SRC}{N}){DST_MIN}){BS});
- y = select(y, ({DST}{N}){DST_MAX}, {BP}(x > ({SRC}{N}){DST_MAX}){BS});
+ y = select(y, ({DST}{N}){DST_MIN}, {BP}(x <= ({SRC}{N}){DST_MIN}){BS});
+ y = select(y, ({DST}{N}){DST_MAX}, {BP}(x >= ({SRC}{N}){DST_MAX}){BS});
----------------
kpet wrote:
Did you intend to change these lines? If yes and the change applies independently of the clspv mode, this looks like a standalone bugfix.
https://github.com/llvm/llvm-project/pull/66902
More information about the cfe-commits
mailing list