[llvm] [SPIRV] Add support for `cl_khr_extended_bit_ops` (PR #120571)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 07:01:50 PST 2025


================
@@ -0,0 +1,2766 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s --spirv-ext=+SPV_KHR_bit_instructions -o - | FileCheck %s --check-prefix=CHECK-EXTENSION
----------------
MrSidims wrote:

There was quite a lot of effort put into this test. Moving forward I suggest not to test every possible type input for such builtins as honestly there is no difference between i8, i16, i32 and i64 scalars in terms of lowering LLVM IR to SPIR-V (well, i64 is a bit special as it requires **Int64** Capability, but it doesn't relate with this feature and tested elsewhere, right?). Same is applicable for vector sizes.

Such extensive tests makes sense if the specification says, that behavior is type dependent (for example adds extra capabilities). Also such extensive testing makes sense for other backend, when depending on a type you should pick between WORD/DWORD/QWORD/array of words, but SPIR-V is too high level for that.

https://github.com/llvm/llvm-project/pull/120571


More information about the llvm-commits mailing list