[PATCH] D156661: [SPIRV] Add support for SPV_KHR_bit_instructions

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 01:42:56 PDT 2023


pmatos added a comment.

In D156661#4548049 <https://reviews.llvm.org/D156661#4548049>, @iliya-diyachkov wrote:

> For such cases, we can use SPIRV translator as a reference tool. You can build it (https://github.com/KhronosGroup/SPIRV-LLVM-Translator) and run to see what output it generates. It also has a set of tests that we partly adopted for our backend, so you can use its test base to search for tests of some functionality and reuse them.
>
> For example, they have test/transcoding/cl_khr_extended_bit_ops.cl for SPV_KHR_bit_instructions extension. Here is the beginning of SPIRV, which the translator outputs:
>
>   ...
>                  OpCapability Addresses
>                  OpCapability Linkage
>                  OpCapability Kernel
>                  OpCapability Vector16
>                  OpCapability Int64
>                  OpCapability Int16
>                  OpCapability Int8
>                  OpCapability BitInstructions
>                  OpExtension "SPV_KHR_bit_instructions"
>             %1 = OpExtInstImport "OpenCL.std"
>   ...
>
> There is no Shader capability but we have BitInstructions capability and SPV_KHR_bit_instructions extension (as you suggested).

OK - thanks. I think you confirmed what I wanted to know.
When using these instructions, we can use BitInstructions, instead of Shader cap. This means that the current hardcoded (afaiu) Shader cap will need to be optionally enabled only when required.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156661/new/

https://reviews.llvm.org/D156661



More information about the llvm-commits mailing list