SPIRV-Tools/source
David Neto 78c3b43774 Use opcode operand definitions from SPIR-V specification generator.
The assembler and disassembler now use a dynamically adjusted
sequence of expected operand types.  (Internally, it is a deque,
for readability.)  Both parsers repeatedly pull an expected operand
type from the left of this pattern list, and try to match the next
input token against it.

The expected pattern is adjusted during the parse to accommodate:
- an extended instruction's expected operands, depending on the
  extended instruction's index.
- when an operand itself has operands
- to handle sequences of zero or more operands, or pairs of
  operands.  These are expanded lazily during the parse.

Adds spv::OperandClass from the SPIR-V specification generator.

Modifies spv_operand_desc_t:
 - adds hasResult, hasType, and operandClass array to the opcode
description type.
 - "wordCount" is replaced with "numTypes", which counts the number
   of entries in operandTypes.  And each of those describes a
   *logical* operand, including the type id for the instruction,
   and the result id for the instruction.  A logical operand could be
   variable-width, such as a literal string.

Adds opcode.inc, an automatically-generated table of operation
descriptions, with one line to describe each core instruction.
Externally, we have modified the SPIR-V spec doc generator to
emit this file.
(We have hacked this copy to use the old semantics for OpLine.)

Inside the assembler, parsing an operand may fail with new
error code SPV_FAIL_MATCH.  For an optional operand, this is not
fatal, but should trigger backtracking at a higher level.

The spvTextIsStartOfNewInst checks the case of the third letter
of what might be an opcode.  So now, "OpenCL" does not look like
an opcode name.

In assembly, the EntryPoint name field is mandatory, but can be
an empty string.

Adjust tests for changes to:
- OpSampedImage
- OpTypeSampler
2015-10-26 12:52:01 -04:00
..
binary.cpp Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
binary.h Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
diagnostic.cpp Code drop of the Codeplay spirv-tools source. 2015-05-22 18:26:19 +01:00
diagnostic.h Code drop of the Codeplay spirv-tools source. 2015-05-22 18:26:19 +01:00
ext_inst.cpp Add GLSL std450 extended instruction 72-80. 2015-10-26 12:52:01 -04:00
ext_inst.h Code drop of the Codeplay spirv-tools source. 2015-05-22 18:26:19 +01:00
opcode.cpp Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
opcode.h Support "<result-id> = <opcode> <operand>.." format. 2015-08-24 15:04:58 -04:00
opcode.inc Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
operand.cpp Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
operand.h Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
print.cpp Code drop of the Codeplay spirv-tools source. 2015-05-22 18:26:19 +01:00
print.h Code drop of the Codeplay spirv-tools source. 2015-05-22 18:26:19 +01:00
text.cpp Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
text.h Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
validate_id.cpp Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
validate.cpp Use opcode operand definitions from SPIR-V specification generator. 2015-10-26 12:52:01 -04:00
validate.h Code drop of the Codeplay spirv-tools source. 2015-05-22 18:26:19 +01:00