Skip to content
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

[libclc] Move mad to the CLC library #123607

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

frasercrmck
Copy link
Contributor

All targets build __clc_mad -- even SPIR-V targets -- since it compiles to the optimal llvm.fmuladd intrinsic. There is no change to the bytecode generated for non-SPIR-V targets.

The mix builtin, which is implemented as a wrapper around mad, is left as an OpenCL-layer wrapper of __clc_mad. I don't know if it's worth having a specific CLC version of mix.

The changes to the other CLC files/functions are moving uses of mad to __clc_mad, and reformatting. There is an additional instance of trunc becoming __clc_trunc, which was missed before.

The mix builtin, which is implemented as a wrapper around mad, is left
as an OpenCL-layer wrapper of __clc_mad. I don't know if it's worth
having a specific CLC version of mix.

All targets build __clc_mad -- even SPIR-V targets -- since it compiles
to the optimal llvm.fmuladd intrinsic. There is no change to the
bytecode generated for non-SPIR-V targets.

The changes to the other CLC files/functions are moving uses of mad to
__clc_mad, and reformatting. There is an additional instance of trunc
becoming __clc_trunc, which was missed before.
@frasercrmck frasercrmck added the libclc libclc OpenCL library label Jan 20, 2025
@frasercrmck frasercrmck requested a review from arsenm January 20, 2025 12:58
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