Document non-use of certain operand types
authorDavid Neto <dneto@google.com>
Mon, 28 Sep 2015 19:33:49 +0000 (15:33 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
Operand class enum values not used in the syntax table:
- Image channel order: only used to describe a return value
- Image channel type: only used to describe a return value
- "Image operands": used to make a section in the spec
  to describe values used to construct an optional image id,
  but does not itself appear in the syntax table.

Removes some TODOs from opcode.cpp.

source/opcode.cpp

index c78426d..b3532cb 100644 (file)
@@ -127,9 +127,17 @@ spv_operand_type_t convertOperandClassToType(spv::Op opcode,
     case OperandSamplerAddressingMode: return SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE;
     case OperandSamplerFilterMode: return SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE;
     case OperandSamplerImageFormat: return SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT;
-    case OperandImageChannelOrder: return SPV_OPERAND_TYPE_NONE; //TODO
-    case OperandImageChannelDataType: return SPV_OPERAND_TYPE_NONE; //TODO
-    case OperandImageOperands: return SPV_OPERAND_TYPE_NONE; //TODO
+    case OperandImageChannelOrder:
+      // This is only used to describe the value generated by OpImageQueryOrder.
+      // It is not used as an operand.
+      break;
+    case OperandImageChannelDataType:
+      // This is only used to describe the value generated by OpImageQueryFormat.
+      // It is not used as an operand.
+      break;
+    case OperandImageOperands:
+      // This is not used. It's only an artifact of spec generation.
+      break;
     case OperandFPFastMath: return SPV_OPERAND_TYPE_FP_FAST_MATH_MODE;
     case OperandFPRoundingMode: return SPV_OPERAND_TYPE_FP_ROUNDING_MODE;
     case OperandLinkageType: return SPV_OPERAND_TYPE_LINKAGE_TYPE;
@@ -142,7 +150,7 @@ spv_operand_type_t convertOperandClassToType(spv::Op opcode,
     case OperandFunction: return SPV_OPERAND_TYPE_FUNCTION_CONTROL;
     case OperandMemorySemantics: return SPV_OPERAND_TYPE_MEMORY_SEMANTICS;
     case OperandMemoryAccess:
-      // This case does not occur in Rev 31.
+      // This case does not occur in the table for SPIR-V 0.99 Rev 32.
       // We expect that it will become SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS,
       // and we can remove the special casing above for memory operation
       // instructions.