clc: support cl_khr_extended_bit_ops

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35448>
This commit is contained in:
Karol Herbst 2025-06-11 02:08:05 +02:00 committed by Marge Bot
parent 1a5b5a883d
commit cf3b16f7af
2 changed files with 4 additions and 0 deletions

View file

@ -50,6 +50,7 @@ enum clc_spirv_version {
};
struct clc_optional_features {
bool extended_bit_ops;
bool fp16;
bool fp64;
bool int64;

View file

@ -965,6 +965,9 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
c->getPreprocessorOpts().addMacroDef("cl_khr_expect_assume=1");
bool needs_opencl_c_h = false;
if (args->features.extended_bit_ops) {
c->getPreprocessorOpts().addMacroDef("cl_khr_extended_bit_ops=1");
}
if (args->features.fp16) {
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_fp16");
}