Skip to content

[libclc] Move fmod, remainder & remquo to the CLC library #132054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

frasercrmck
Copy link
Contributor

These functions were already nominally in the CLC namespace; this commit just formally moves them over.

Note that 'half' versions of these CLC functions are now provided. Previously the corresponding OpenCL builtins would forward directly to the 'float' versions of the CLC builtins. Now the OpenCL builtins call the 'half' CLC builtins, which themselves call the 'float' CLC versions. This keeps the interface between the OpenCL and CLC libraries neater and keeps the CLC library self-contained.

No changes to the generated code for non-SPIR-V targets is observed.

@frasercrmck frasercrmck added the libclc libclc OpenCL library label Mar 19, 2025
@frasercrmck frasercrmck requested a review from arsenm March 19, 2025 16:10
@frasercrmck frasercrmck force-pushed the libclc-clc-remainder-fmod-remquo branch from ae2c1b1 to 3d3b659 Compare March 20, 2025 15:41
It was already nominally in the CLC namespace; this commit just formally
moves it over.

Note that a fp16 version of __clc_remainder is now provided. It is
defined as forwarding on to the fp32 version. This makes a difference in
the OpenCL layer, where the fp16 remainder builtin will forward to the
fp16 __clc_remainder builtin, rather than directly forwarding onto the
fp32 __clc_remainder builtin.

No changes to the generated code for non-SPIR-V targets is observed.
@frasercrmck frasercrmck force-pushed the libclc-clc-remainder-fmod-remquo branch from 3d3b659 to 02aacb0 Compare March 27, 2025 11:19
@frasercrmck frasercrmck changed the title [libclc] Move __clc_(remainder|fmod|remquo) to the CLC library [libclc] Move fmod, remainder & remquo to the CLC library Mar 27, 2025
@frasercrmck frasercrmck merged commit d32e71d into llvm:main Mar 27, 2025
11 checks passed
@frasercrmck frasercrmck deleted the libclc-clc-remainder-fmod-remquo branch March 27, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc OpenCL library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants