[libclc] [libclc] Reorganize OpenCL builtins (PR #140557)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 19 08:06:27 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r HEAD~1...HEAD libclc/utils/gen_convert.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- gen_convert.py 2025-05-19 14:54:30.000000 +0000
+++ gen_convert.py 2025-05-19 15:05:38.831791 +0000
@@ -353,20 +353,18 @@
if src == dst:
# Conversion between same types
print(" return x;")
elif src in float_types:
-
# Conversion from float to int
print(
f""" {dstn} y = __clc_convert_{dstn}(x);
y = __clc_select(y, ({dstn}){dst_min}, {bool_prefix}(x <= ({srcn}){dst_min}){bool_suffix});
y = __clc_select(y, ({dstn}){dst_max}, {bool_prefix}(x >= ({srcn}){dst_max}){bool_suffix});
return y;"""
)
else:
-
# Integer to integer convesion with sizeof(src) == sizeof(dst)
if sizeof_type[src] == sizeof_type[dst]:
if src in unsigned_types:
print(f" x = __clc_min(x, ({src}){dst_max});")
else:
``````````
</details>
https://github.com/llvm/llvm-project/pull/140557
More information about the cfe-commits
mailing list