Skip to content

Commit

Permalink
Support operand kind for SPV_INTEL_maximum_registers (KhronosGroup#5580)
Browse files Browse the repository at this point in the history
* Support operand kind for SPV_INTEL_maximum_registers

* improvements

* Update DEPS
  • Loading branch information
vmaksimo authored Feb 28, 2024
1 parent fbc7a14 commit 0b027ba
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ vars = {
'protobuf_revision': 'v21.12',

're2_revision': 'ed9fc269e2fdb299afe59e912928d31ad3fdcf7d',
'spirv_headers_revision': '05cc486580771e4fa7ddc89f5c9ee1e97382689a',
'spirv_headers_revision': 'b73e168ca5e123dcf3dea8a34b19a5130f421ae1',
}

deps = {
2 changes: 2 additions & 0 deletions include/spirv-tools/libspirv.h
Original file line number Diff line number Diff line change
@@ -301,6 +301,8 @@ typedef enum spv_operand_type_t {
SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL,
// Enum type from SPV_INTEL_cache_controls
SPV_OPERAND_TYPE_STORE_CACHE_CONTROL,
// Enum type from SPV_INTEL_maximum_registers
SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS,

// This is a sentinel value, and does not represent an operand type.
// It should come last.
3 changes: 2 additions & 1 deletion source/binary.cpp
Original file line number Diff line number Diff line change
@@ -670,7 +670,8 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
case SPV_OPERAND_TYPE_OVERFLOW_MODES:
case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT:
case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: {
case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT:
case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS: {
// A single word that is a plain enum value.

// Map an optional operand type to its corresponding concrete type.
3 changes: 3 additions & 0 deletions source/operand.cpp
Original file line number Diff line number Diff line change
@@ -220,6 +220,8 @@ const char* spvOperandTypeStr(spv_operand_type_t type) {
return "load cache control";
case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL:
return "store cache control";
case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS:
return "named maximum number of registers";
case SPV_OPERAND_TYPE_IMAGE:
case SPV_OPERAND_TYPE_OPTIONAL_IMAGE:
return "image";
@@ -360,6 +362,7 @@ bool spvOperandIsConcrete(spv_operand_type_t type) {
case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER:
case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL:
case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL:
case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS:
return true;
default:
break;
1 change: 1 addition & 0 deletions source/val/validate_mode_setting.cpp
Original file line number Diff line number Diff line change
@@ -346,6 +346,7 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
case spv::ExecutionMode::LocalSizeHintId:
case spv::ExecutionMode::LocalSizeId:
case spv::ExecutionMode::FPFastMathDefault:
case spv::ExecutionMode::MaximumRegistersIdINTEL:
valid_mode = true;
break;
default:

0 comments on commit 0b027ba

Please sign in to comment.