SPV_OPERAND_TYPE_OPTIONAL_LITERAL,
// An optional literal string.
SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING,
- // An optional memory access qualifier, e.g. Volatile
+ // An optional memory access qualifier mask, e.g. Volatile, Aligned,
+ // or a combination.
SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS,
// An optional execution mode
SPV_OPERAND_TYPE_OPTIONAL_EXECUTION_MODE,
SPV_OPERAND_TYPE_VARIABLE_LITERAL_ID,
// A sequence of zero or more pairs of (Id, Literal)
SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL,
- // A sequence of zero or more memory access operands
- SPV_OPERAND_TYPE_VARIABLE_MEMORY_ACCESS,
// A sequence of zero or more execution modes
SPV_OPERAND_TYPE_VARIABLE_EXECUTION_MODE,
case spv::OpStore:
case spv::OpCopyMemory:
case spv::OpCopyMemorySized:
- return SPV_OPERAND_TYPE_VARIABLE_MEMORY_ACCESS;
+ // Expect an optional mask. When the Aligned bit is set in the mask,
+ // we will later add the expectation of a literal number operand.
+ return SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS;
case spv::OpExecutionMode:
return SPV_OPERAND_TYPE_VARIABLE_EXECUTION_MODE;
default:
case OperandMemorySemantics: return SPV_OPERAND_TYPE_MEMORY_SEMANTICS;
case OperandMemoryAccess:
// This case does not occur in Rev 31.
- // We expect that it will become SPV_OPERAND_TYPE_VARIABLE_MEMORY_ACCESS,
+ // We expect that it will become SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS,
// and we can remove the special casing above for memory operation
// instructions.
break;
case SPV_OPERAND_TYPE_VARIABLE_LITERAL:
case SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL:
case SPV_OPERAND_TYPE_VARIABLE_LITERAL_ID:
- case SPV_OPERAND_TYPE_VARIABLE_MEMORY_ACCESS:
case SPV_OPERAND_TYPE_VARIABLE_EXECUTION_MODE:
return true;
default:
{SPV_OPERAND_TYPE_OPTIONAL_ID,
SPV_OPERAND_TYPE_LITERAL_IN_OPTIONAL_TUPLE, type});
return true;
- case SPV_OPERAND_TYPE_VARIABLE_MEMORY_ACCESS:
- pattern->insert(pattern->begin(), {SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS, type});
- return true;
case SPV_OPERAND_TYPE_VARIABLE_EXECUTION_MODE:
pattern->insert(pattern->begin(), {SPV_OPERAND_TYPE_OPTIONAL_EXECUTION_MODE, type});
return true;