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

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 03:11:59 PDT 2023


pmatos created this revision.
pmatos added reviewers: mpaszkowski, zuban32, iliya-diyachkov.
Herald added subscribers: asb, wingo, ThomasRaoux, hiraditya.
Herald added a project: All.
pmatos requested review of this revision.
Herald added subscribers: llvm-commits, wangpc.
Herald added a project: LLVM.

Draft version of patch to add support for SPV_KHR_bit_instructions.

Created revision so we can discuss how to proceed here.
SPV_KHR_bit_instructions (http://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_bit_instructions.html), 
adds support for instructions that we already support through 
the Shader capability but without requiring the shader cap.

However we currently have no way to disable the shader cap afaiu.
On the other hand, SPV_KHR_bit_instructions was one of the 
extensions @mpaszkowski listed that we need to implement.

So what does it mean at the moment the need to implement this?
Is it just the ability to issue the extension and capabilities
instructions without issuing the Shader capability? If so,
then I will need to add here a way to disable the Shader 
capability. What do you think?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156661

Files:
  llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td


Index: llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
===================================================================
--- llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
+++ llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
@@ -244,6 +244,7 @@
 defm SPV_EXT_demote_to_helper_invocation : ExtensionOperand<56>;
 defm SPV_INTEL_fpga_reg : ExtensionOperand<57>;
 defm SPV_INTEL_optnone : ExtensionOperand<58>;
+defm SPV_KHR_bit_instructions : ExtensionOperand<59>;
 
 //===----------------------------------------------------------------------===//
 // Multiclass used to define Capabilities enum values and at the same time
@@ -398,6 +399,7 @@
 defm PhysicalStorageBufferAddressesEXT : CapabilityOperand<5347, 0, 0, [], [Shader]>;
 defm CooperativeMatrixNV : CapabilityOperand<5357, 0, 0, [], [Shader]>;
 defm OptNoneINTEL : CapabilityOperand<6094, 0, 0, [SPV_INTEL_optnone], []>;
+defm BitInstructions : CapabilityOperand<6025, 0, 0, [SPV_KHR_bit_instructions]>
 
 //===----------------------------------------------------------------------===//
 // Multiclass used to define SourceLanguage enum values and at the same time


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156661.545570.patch
Type: text/x-patch
Size: 1123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230731/8b2fa1c5/attachment.bin>


More information about the llvm-commits mailing list