platform/upstream/SPIRV-Tools.git
9 years agoMove spv*TableGet() functions out of libspirv.h.
Lei Zhang [Wed, 11 Nov 2015 17:14:36 +0000 (12:14 -0500)]
Move spv*TableGet() functions out of libspirv.h.

This is a part of the effort to clean up libspirv.h.

9 years agoRemove table parameters from API functions.
Lei Zhang [Wed, 11 Nov 2015 16:33:26 +0000 (11:33 -0500)]
Remove table parameters from API functions.

Opcode, operand, and external instruction tables are no longer
passed in as parameters to spvTextToBinary(), spvBinaryToText(),
and spvValidate().

9 years agoFixed permissions
Andrew Woloszyn [Wed, 11 Nov 2015 17:06:46 +0000 (12:06 -0500)]
Fixed permissions

9 years agoFixed warnings on windows and constness of spv_binary.
Andrew Woloszyn [Wed, 11 Nov 2015 16:05:07 +0000 (11:05 -0500)]
Fixed warnings on windows and constness of spv_binary.

Replaced uint64_t with size_t in the places that make sense and
added spv_const_binary{,_t} to allow the interface to accept non
modifiable spirv where appropriate.

9 years agoGet magic number and version from spirv.h.
Lei Zhang [Wed, 11 Nov 2015 15:17:16 +0000 (10:17 -0500)]
Get magic number and version from spirv.h.

This is a part of the effort to clean up libspirv.h.

9 years agoDisassembler support for OpSpecConstantOp
David Neto [Wed, 11 Nov 2015 07:45:45 +0000 (02:45 -0500)]
Disassembler support for OpSpecConstantOp

Document the fact that we use names for extended instructions
and OpSpecConstantOp opcode operands.

9 years agoAssembler support for OpSpecConstantOp
David Neto [Wed, 11 Nov 2015 06:56:49 +0000 (01:56 -0500)]
Assembler support for OpSpecConstantOp

Adds SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER.

9 years agoFix Windows build errors.
David Neto [Wed, 11 Nov 2015 14:44:23 +0000 (09:44 -0500)]
Fix Windows build errors.

- uint64_t != size_t sometimes
- don't use C99 runtime sized arrays

9 years agoFix description of NaN encoding.
David Neto [Tue, 10 Nov 2015 21:04:30 +0000 (16:04 -0500)]
Fix description of NaN encoding.

9 years agoEnable round trip tests for OpSwitch
David Neto [Tue, 10 Nov 2015 20:43:12 +0000 (15:43 -0500)]
Enable round trip tests for OpSwitch

9 years agoOptional typed literal number should be concrete in BinaryParser.
Lei Zhang [Tue, 10 Nov 2015 19:29:35 +0000 (14:29 -0500)]
Optional typed literal number should be concrete in BinaryParser.

9 years agoUpdate readme: binary parser refactor; non-32-bit literals
David Neto [Tue, 10 Nov 2015 19:14:21 +0000 (14:14 -0500)]
Update readme: binary parser refactor; non-32-bit literals

9 years agosyntax.md: Describe hex floats and their use.
David Neto [Tue, 10 Nov 2015 19:46:35 +0000 (14:46 -0500)]
syntax.md: Describe hex floats and their use.

9 years agoFix handling of OpExtInstImport
David Neto [Mon, 9 Nov 2015 23:55:42 +0000 (18:55 -0500)]
Fix handling of OpExtInstImport

The assembler tracks mapping of extended instruction import Id
to extended instruction type.

Adds a few new ways to fail.

9 years agoAssembler supports hex float constants.
David Neto [Fri, 6 Nov 2015 23:08:49 +0000 (18:08 -0500)]
Assembler supports hex float constants.

The bit pattern for a hex float is preserved through
assembly and disassembly.

You can use a hex float to express Inf and any kind of NaN
in a portable way.

9 years agoPrint OpConstant values according to type.
David Neto [Fri, 6 Nov 2015 16:23:57 +0000 (11:23 -0500)]
Print OpConstant values according to type.

Zero and normal floating point values are printed with enough
enough digits to reproduce all the bits exactly.
Other float values (subnormal, infinity, and NaN) are printed
as hex floats.

Fix a binary parse bug: Count partially filled words in a
typed literal number operand.

TODO: Assembler support for hex numbers, and therefore reading
infinities and NaNs.

9 years agoRemove canonical assembly format in syntax.md.
Lei Zhang [Fri, 6 Nov 2015 15:10:28 +0000 (10:10 -0500)]
Remove canonical assembly format in syntax.md.

9 years agoadvance() should check current string index is in bound.
Lei Zhang [Fri, 6 Nov 2015 20:09:04 +0000 (15:09 -0500)]
advance() should check current string index is in bound.

9 years agoRemove support for canonical assembly syntax format.
Lei Zhang [Thu, 5 Nov 2015 22:45:09 +0000 (17:45 -0500)]
Remove support for canonical assembly syntax format.

9 years agospv_operand_type_t cleanup.
David Neto [Wed, 4 Nov 2015 22:38:17 +0000 (17:38 -0500)]
spv_operand_type_t cleanup.

- Concrete operand types are never optional.
  Split them to make this so, e.g. add SPV_OPERAND_TYPE_IMAGE
  since there was SPV_OPERAND_TYPE_OPTIONAL_IMAGE.
  Similarly for SPV_OPERAND_TYPE_MEMORY_ACCESS.
  This entails duplicating two operand table entries.

- The above, plus some rearranging of enums, allows us to define
  first and last optional operand types, and first and last
  variable operand types.
  This lets us simplify the code for spvOperandIsOptional, and
  spvOperandIsVariable.

- Replace SPV_OPERAND_TYPE_MULTIWORD_LITERAL_NUMBER with the
  more accurately named SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER.
  Its special characteristic is that the type of the literal
  number is determined by some previous operand in the instruction.
  This is used for literals in OpSwitch, OpConstant, and OpSpecConstant.
  This lets us refactor operand parsing cases in the assembler.

- Remove the special required-thing-in-optional-tuple in favour of
  the corresponding concrete operand type:
        SPV_OPERAND_TYPE_ID_IN_OPTIONAL_TUPLE
    --> SPV_OPERAND_TYPE_ID
        SPV_OPERAND_TYPE_INTEGER_LITERAL_IN_OPTIONAL_TUPLE
    --> SPV_OPERAND_TYPE_INTEGER_LITERAL

- Constrain spvOpeandTypeStr to only have to work for non-variable
  operand types.  Add a test for this.

9 years agoRemove TODO: Strings are always little-endian
David Neto [Thu, 5 Nov 2015 22:37:48 +0000 (17:37 -0500)]
Remove TODO: Strings are always little-endian

SPIR-V strings are UTF-8 encoded, and always byte-addressed.

9 years agoRefactor the binary parser.
David Neto [Fri, 30 Oct 2015 20:06:15 +0000 (16:06 -0400)]
Refactor the binary parser.

The binary parser has a C API, described in binary.h.
Eventually we will make it public in libspirv.h.
The API is event-driven in the sense that a callback is called
when a valid header is parsed, and for each parsed instruction.

Classify some operand types as "concrete".  The binary parser uses
only concrete operand types to describe parsed instructions.

The old disassembler APIs are moved into disassemble.cpp

TODO: Add unit tests for spvBinaryParse.

9 years agoSlay "undeflow."
Dejan Mircevski [Tue, 3 Nov 2015 18:52:41 +0000 (13:52 -0500)]
Slay "undeflow."

9 years agoRefactor EncodeTestHelper() and DecodeTestHelper().
Dejan Mircevski [Tue, 3 Nov 2015 17:02:07 +0000 (12:02 -0500)]
Refactor EncodeTestHelper() and DecodeTestHelper().

9 years agoConsts before the type, not after
David Neto [Tue, 3 Nov 2015 16:26:15 +0000 (11:26 -0500)]
Consts before the type, not after

9 years agoA spv_binary_t points to const code words.
David Neto [Wed, 28 Oct 2015 17:50:32 +0000 (13:50 -0400)]
A spv_binary_t points to const code words.

9 years agoMove spvBinaryToText into new disassembler file.
David Neto [Tue, 27 Oct 2015 20:56:14 +0000 (16:56 -0400)]
Move spvBinaryToText into new disassembler file.

This begins the refactoring of the disassembler into
two parts: A binary decoder in binary.cpp, and an
event-driven converter to text in disassemble.cpp

9 years agoUse the syntax table for opcode to name mappings.
David Neto [Mon, 2 Nov 2015 21:03:12 +0000 (16:03 -0500)]
Use the syntax table for opcode to name mappings.

This method is more reliably complete.

9 years agoUpdated comment in SetBits.
Andrew Woloszyn [Mon, 2 Nov 2015 20:45:29 +0000 (15:45 -0500)]
Updated comment in SetBits.

It now mentions that it will fail if you try to set a bit that
does not exist.

9 years agoDiagnosticStream keeps a copy of the position.
David Neto [Wed, 28 Oct 2015 17:16:56 +0000 (13:16 -0400)]
DiagnosticStream keeps a copy of the position.

Don't store the pointer, as the underlying storage
could disappear.  This a bit more flexible and robust.

9 years agoAdded double tests to HexFloat
Andrew Woloszyn [Mon, 2 Nov 2015 20:19:18 +0000 (15:19 -0500)]
Added double tests to HexFloat

9 years agoEmpty assembly text compiles to no instructions.
David Neto [Mon, 2 Nov 2015 16:40:59 +0000 (11:40 -0500)]
Empty assembly text compiles to no instructions.

But it's still a valid module.

9 years agoConsolidate: spvOpcodeIsType into spvOpcodeGeneratesType
David Neto [Mon, 2 Nov 2015 19:59:02 +0000 (14:59 -0500)]
Consolidate: spvOpcodeIsType into spvOpcodeGeneratesType

And fix the spvOpcodeGeneratesType: OpTypeForwardPointer
does not generate a new type.

9 years agoRun clang-format to enforce Google style globally.
Lei Zhang [Mon, 2 Nov 2015 14:41:20 +0000 (09:41 -0500)]
Run clang-format to enforce Google style globally.

Note that we are more strict than Google style for one aspect:
pointer/reference indicators are adjacent to their types, not
their variables.

find . -name "*.h" -exec clang-format -i {} \;
find . -name "*.cpp" -exec clang-format -i {} \;

9 years agoUpdate readme: fix utf-8 tests, use spirv.h
David Neto [Mon, 2 Nov 2015 14:44:20 +0000 (09:44 -0500)]
Update readme: fix utf-8 tests, use spirv.h

9 years agoUpdated HexFloat parsing for windows.
Andrew Woloszyn [Mon, 2 Nov 2015 16:45:38 +0000 (11:45 -0500)]
Updated HexFloat parsing for windows.

It is valid for float values to be modified on copy if they are NaN,
so long as they remain the correct NaN. What this means is that
we can not rely on the float data-type for storing float values
if we want to retain bit patterns.

Added FloatProxy which stores data in an unsigned integer, and updated
the HexFloat template to deal with FloatProxy values instead.

9 years agoAdded HexFloat reading to HexFloat.
Andrew Woloszyn [Fri, 23 Oct 2015 17:26:02 +0000 (13:26 -0400)]
Added HexFloat reading to HexFloat.

This allows reading of hex-encoded floats.

9 years agoAdded HexFloat helper class to print out floating point numbers.
Andrew Woloszyn [Fri, 23 Oct 2015 17:23:19 +0000 (13:23 -0400)]
Added HexFloat helper class to print out floating point numbers.

TODO Add double tests before we actually use this.

9 years agoChanged SetBits to index from LSB and take a size.
Andrew Woloszyn [Thu, 29 Oct 2015 13:57:24 +0000 (09:57 -0400)]
Changed SetBits to index from LSB and take a size.

9 years agoUse spirv.h instead of spirv.hpp.
Lei Zhang [Wed, 28 Oct 2015 17:40:52 +0000 (13:40 -0400)]
Use spirv.h instead of spirv.hpp.

This is a part of the effort to make libspirv.h C-compatible.

9 years agoInclusion guards follow Google C++ style
David Neto [Tue, 27 Oct 2015 20:27:05 +0000 (16:27 -0400)]
Inclusion guards follow Google C++ style

Follow the scheme in
http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#The__define_Guard
except:
 - 'include/' is dropped from the guard token
 - 'source/' is dropped from the guard token

9 years agoMove endian utilities to their own file.
David Neto [Tue, 27 Oct 2015 20:14:40 +0000 (16:14 -0400)]
Move endian utilities to their own file.

9 years agoHide spvBinaryHeaderSet with its only client.
David Neto [Tue, 27 Oct 2015 19:51:34 +0000 (15:51 -0400)]
Hide spvBinaryHeaderSet with its only client.

Also rename it to SetHeader since it's not part of the "binary"
API.

9 years agoMove AssemblyGrammar into its own source files
David Neto [Tue, 27 Oct 2015 19:31:10 +0000 (15:31 -0400)]
Move AssemblyGrammar into its own source files

9 years agoAdd DISABLED failing test for ext inst import confusion
David Neto [Fri, 16 Oct 2015 18:26:40 +0000 (14:26 -0400)]
Add DISABLED failing test for ext inst import confusion

Currently, the assembler does not track external import
IDs when there are two or more.

TODO(dneto): Fix this functionality.

9 years agoUse basic_string<char> for the UTF-8 test string
David Neto [Tue, 27 Oct 2015 15:10:29 +0000 (11:10 -0400)]
Use basic_string<char> for the UTF-8 test string

This is an attempt to fix the unit tests on DeveloperStudio 2013.
Currently, the size of the earth_africa string is reported as 2
on Windows.  But I think that may be 2 16-bit characters.

9 years agoUpdate to latest registered generator enums
David Neto [Mon, 26 Oct 2015 19:43:12 +0000 (15:43 -0400)]
Update to latest registered generator enums

The registry is at:
https://www.khronos.org/registry/spir-v/api/spir-v.xml

9 years agoAdded set_bits<> to bitutils.
Andrew Woloszyn [Fri, 23 Oct 2015 13:53:58 +0000 (09:53 -0400)]
Added set_bits<> to bitutils.

This allows us to get a constant with the given bits set at
compile-time. This is needed for a future patch for HexFloat.

9 years agoTest cleanup: remove useless std::string constructor
David Neto [Thu, 22 Oct 2015 17:24:41 +0000 (13:24 -0400)]
Test cleanup: remove useless std::string constructor

9 years agoUse typedef instead of using in libspirv.h.
Lei Zhang [Wed, 21 Oct 2015 14:22:05 +0000 (10:22 -0400)]
Use typedef instead of using in libspirv.h.

The header file should be compatible with pre-C++11 code.

9 years agoMerge branch 'google-asm-dis-oct-25' into 'master'
Kenneth Benzie [Tue, 27 Oct 2015 10:14:44 +0000 (06:14 -0400)]
Merge branch 'google-asm-dis-oct-25' into 'master'

Google assembler disassembler catchup to oct 25

Catches up with the google branch through 2015-10-25:

* SPIR-V 0.99 Rev32
   * Core instructions, enumerants, and capabilities
* GLSL std450 extended instructions supported
* OpenCL extended instruction supported, version 1.0 Revision 1

See readme.md for missing features and known bugs, e.g.
* Fix disassembler support for non-32 bit numeric literals
* Fix: Assembler can't use extended instructions from two different imports
  in the same module
* TODO: 16-bit floating point literals

See merge request !10

9 years agoFix readme: this is not the 'google' branch
David Neto [Mon, 26 Oct 2015 16:57:40 +0000 (12:57 -0400)]
Fix readme: this is not the 'google' branch

9 years agoFix GMOCK directory in CMakeLists.txt.
Dejan Mircevski [Wed, 21 Oct 2015 13:26:54 +0000 (09:26 -0400)]
Fix GMOCK directory in CMakeLists.txt.

9 years agoFixed typo in utf8 string literal
Andrew Woloszyn [Tue, 20 Oct 2015 14:32:09 +0000 (10:32 -0400)]
Fixed typo in utf8 string literal

9 years agoFixed UTF-8 encoding issues on windows.
Andrew Woloszyn [Tue, 20 Oct 2015 13:12:32 +0000 (09:12 -0400)]
Fixed UTF-8 encoding issues on windows.

Also cleaned up some warnings related to implicit size_t/uint64_t
conversions.

9 years agoAdded type tracking to the disassembler.
Andrew Woloszyn [Fri, 16 Oct 2015 19:11:00 +0000 (15:11 -0400)]
Added type tracking to the disassembler.

TODO: Actually use the tracked types to make sure that we print out
values correctly.

9 years agoUpdate readme: Support OpenCL, UTF-8 literal strings
David Neto [Fri, 16 Oct 2015 18:44:40 +0000 (14:44 -0400)]
Update readme: Support OpenCL, UTF-8 literal strings

9 years agoRemaining tests for OpenCL extended instructions.
David Neto [Thu, 15 Oct 2015 18:15:34 +0000 (14:15 -0400)]
Remaining tests for OpenCL extended instructions.

9 years agoAdd operand type for extension instruction number
David Neto [Thu, 15 Oct 2015 19:22:06 +0000 (15:22 -0400)]
Add operand type for extension instruction number

This is required to support extended instructions that
have literal numbers as operands.  An example is OpenCL's
vloadn.

The previous code in the assembler assumed that *any* literal
number argument in any part of an OpExtInst must be the name
of the extended instruction.  That's true only for the first
literal number argument.

9 years agoUse literal integers for OpenCL extended instructions.
David Neto [Fri, 16 Oct 2015 18:16:00 +0000 (14:16 -0400)]
Use literal integers for OpenCL extended instructions.

9 years agoAdd OpenCL extended instructions.
David Neto [Wed, 14 Oct 2015 21:02:11 +0000 (17:02 -0400)]
Add OpenCL extended instructions.

Versions 1.2, 2.0, and 2.1 all use the same
extended instruction list.

Updated the source code patch for the SPIR-V doc generator,
so it can both generate the core syntax table, and also the
OpenCL extended instructions table.

Tested the Math and Common functions.
TODO: test the remaining entries.

9 years agoSome minor clean-ups to binary.{h,cpp}.
Andrew Woloszyn [Fri, 16 Oct 2015 14:23:42 +0000 (10:23 -0400)]
Some minor clean-ups to binary.{h,cpp}.

Removed spvBinaryDecodeOpcode and spvBinaryDecodeOperand from the public
interface since they were only ever used in binary.cpp.

Replaced the usage of spv_operand_table_t and it's ilk with the
AssemblyGrammar to reduce the number of passed parameters.

Fixed typo in comment.

9 years agoEnforce suitable literal number operands to be unsigned integers.
Lei Zhang [Wed, 14 Oct 2015 21:02:39 +0000 (17:02 -0400)]
Enforce suitable literal number operands to be unsigned integers.

Except for OpConstant and OpSpecConstant, all other literal number
operands are indeed unsigned integers. So,

* Rename all *LITERAL_NUMBER* operand types to *LITERAL_INTEGER*.
* Expect unsigned integers for *LITERAL_INTEGER* operands.
* Keep MULITPLE_WORD_LITERAL untouched since it is only used by
  OpConstant and OpSpecConstant.

And we want to provide the capability to specify floating-point
numbers after !<integer> in the alternate parsing mode. So,
OPTIONAL_LITERAL_NUMBER is reserved for OPTIONAL_CIV.

9 years agoGit ignore compile_commands.json in root directory.
David Neto [Fri, 16 Oct 2015 15:15:04 +0000 (11:15 -0400)]
Git ignore compile_commands.json in root directory.

Useful for standalone development of SPIR-V Tools with
Ninja and YouCompleteMe.

9 years agoUse normal string instead of raw string for simple strings.
Lei Zhang [Fri, 16 Oct 2015 14:05:46 +0000 (10:05 -0400)]
Use normal string instead of raw string for simple strings.

9 years agoSimplify methods for compilation failure in test framework.
Lei Zhang [Thu, 15 Oct 2015 19:20:45 +0000 (15:20 -0400)]
Simplify methods for compilation failure in test framework.

Remove  CompileWithFormatFailure() and make CompileFailure() accept
a default argument.

9 years agoUse SPIRV_PERF=1 when performance tuning.
David Neto [Thu, 15 Oct 2015 20:43:14 +0000 (16:43 -0400)]
Use SPIRV_PERF=1 when performance tuning.

It tells the compiler to keep frame pointers, so you have good
call stacks in your profiles.

9 years agoAvoid strlen in a loop, for speed.
David Neto [Thu, 15 Oct 2015 20:40:04 +0000 (16:40 -0400)]
Avoid strlen in a loop, for speed.

9 years agoFix Android build: use std::numeric_limits<T>::max and friends
David Neto [Thu, 15 Oct 2015 18:34:07 +0000 (14:34 -0400)]
Fix Android build: use std::numeric_limits<T>::max and friends

UINT32_MAX and friends are not available.

9 years agoAdd disabled tests for disassembler literal emission
David Neto [Wed, 14 Oct 2015 18:40:24 +0000 (14:40 -0400)]
Add disabled tests for disassembler literal emission

Currently, negative numbers are printed as if they were
first statically cast to unsigned.

9 years agoAdded proper string escaping to the disassembler.
Andrew Woloszyn [Wed, 14 Oct 2015 18:18:43 +0000 (14:18 -0400)]
Added proper string escaping to the disassembler.

The disassembler now generates correct string when encountering
quotes and slashes.

9 years agoSPV_FAILED_MATCH error mutes DiagnosticStream.
David Neto [Wed, 14 Oct 2015 15:31:51 +0000 (11:31 -0400)]
SPV_FAILED_MATCH error mutes DiagnosticStream.

The DiagnosticStream will not emit the accumulated message
text if the error is SPV_FAILED_MATCH.

Change various interfaces to accept the intended error
code instead of a boolean "is_optional".  This allows
us to avoid repeating the following type of logic deep
inside helper methods:

  if (is_optional) return SPV_FAILED_MATCH;
  return diagnostic() << " message text ";

9 years agoRemoved un-needed comments and fixed merge issue.
Andrew Woloszyn [Wed, 14 Oct 2015 17:21:50 +0000 (13:21 -0400)]
Removed un-needed comments and fixed merge issue.

9 years agoUpdated string escaping in the assembler.
Andrew Woloszyn [Wed, 14 Oct 2015 16:44:19 +0000 (12:44 -0400)]
Updated string escaping in the assembler.

Strings are now escaped correctly when assembling.
TODO dissassembler support for strange strings (newlines for example).

9 years agoUpdate readme. Long instructions, literal number encoding
David Neto [Wed, 14 Oct 2015 16:18:41 +0000 (12:18 -0400)]
Update readme. Long instructions, literal number encoding

9 years agoAdd negative-coverage location to operand-class-test-coverage.csv.
Dejan Mircevski [Tue, 13 Oct 2015 21:35:15 +0000 (17:35 -0400)]
Add negative-coverage location to operand-class-test-coverage.csv.

9 years agoParse and encode literal integers to the right width
David Neto [Mon, 5 Oct 2015 17:28:46 +0000 (13:28 -0400)]
Parse and encode literal integers to the right width

Affects OpConstant, and OpSwitch.

Adds constant libspirv::kUnknownType for readability.

Adds tests for hexadecimal number parsing.

Updates syntax.md to describe hex parsing, including
sign extension.

9 years agoAdd AssemblyContext::parseNumber
David Neto [Tue, 13 Oct 2015 19:51:12 +0000 (15:51 -0400)]
Add AssemblyContext::parseNumber

It parses a text string for a value of a given target type.

9 years agoDiagnosticStream can convert to a stored error code
David Neto [Fri, 9 Oct 2015 19:48:09 +0000 (15:48 -0400)]
DiagnosticStream can convert to a stored error code

Use this to shorten error return code in the assembler.

For example, change this:

   if (error = something()) {
      diagnostic() << " Bad integer literal " << value;
      return SPV_ERROR_INVALID_VALUE;
   }

to this:

   if (error = something())
      return diagnostic() << " Bad integer literal " << value;

Also shorten code due to the fact that binaryEncodeU32 and
binaryCodeU64 can't fail (short of failure to expand a std::vector).

9 years agoNegative test for FunctionControl.
Dejan Mircevski [Tue, 13 Oct 2015 20:00:01 +0000 (16:00 -0400)]
Negative test for FunctionControl.

9 years agoNegative test for LoopControl.
Dejan Mircevski [Tue, 13 Oct 2015 19:53:46 +0000 (15:53 -0400)]
Negative test for LoopControl.

9 years agoNegative test for SelectionControl.
Dejan Mircevski [Tue, 13 Oct 2015 19:49:53 +0000 (15:49 -0400)]
Negative test for SelectionControl.

9 years agoNegative test for GroupOperation.
Dejan Mircevski [Tue, 13 Oct 2015 20:32:38 +0000 (16:32 -0400)]
Negative test for GroupOperation.

9 years agoNegative test for LinkageType.
Dejan Mircevski [Tue, 13 Oct 2015 19:22:01 +0000 (15:22 -0400)]
Negative test for LinkageType.

9 years agoNegative test for BuiltIn.
Dejan Mircevski [Tue, 13 Oct 2015 19:39:38 +0000 (15:39 -0400)]
Negative test for BuiltIn.

9 years agoNegative test for AccessQualifier.
Dejan Mircevski [Tue, 13 Oct 2015 19:25:31 +0000 (15:25 -0400)]
Negative test for AccessQualifier.

9 years agoNegative test for FuncParamAttr.
Dejan Mircevski [Tue, 13 Oct 2015 19:30:18 +0000 (15:30 -0400)]
Negative test for FuncParamAttr.

9 years agoNegative test for Decoration.
Dejan Mircevski [Tue, 13 Oct 2015 19:35:49 +0000 (15:35 -0400)]
Negative test for Decoration.

9 years agoNegative test for FPRoundingMode.
Dejan Mircevski [Tue, 13 Oct 2015 19:15:54 +0000 (15:15 -0400)]
Negative test for FPRoundingMode.

9 years agoNegative test for FPFastMathMode.
Dejan Mircevski [Tue, 13 Oct 2015 19:02:03 +0000 (15:02 -0400)]
Negative test for FPFastMathMode.

9 years agoNegative test for ImageFormat.
Dejan Mircevski [Tue, 13 Oct 2015 16:54:47 +0000 (12:54 -0400)]
Negative test for ImageFormat.

9 years agoMake compilation input strings const.
Dejan Mircevski [Tue, 13 Oct 2015 16:46:13 +0000 (12:46 -0400)]
Make compilation input strings const.

Also rerun clang-format.

9 years agoNegative test for SamplerFilterMode.
Dejan Mircevski [Tue, 13 Oct 2015 16:38:20 +0000 (12:38 -0400)]
Negative test for SamplerFilterMode.

9 years agoNegative test for SamplerAddressingMode.
Dejan Mircevski [Tue, 13 Oct 2015 15:51:11 +0000 (11:51 -0400)]
Negative test for SamplerAddressingMode.

9 years agoClarify handling of OperandImageOperands.
Dejan Mircevski [Tue, 13 Oct 2015 18:41:31 +0000 (14:41 -0400)]
Clarify handling of OperandImageOperands.

9 years agoNegative test for ImageOperands.
Dejan Mircevski [Tue, 13 Oct 2015 18:47:22 +0000 (14:47 -0400)]
Negative test for ImageOperands.

9 years agoNegative test for Dim.
Dejan Mircevski [Tue, 13 Oct 2015 15:46:09 +0000 (11:46 -0400)]
Negative test for Dim.

9 years agoTest OpTypeForwardPointer.
Dejan Mircevski [Fri, 9 Oct 2015 20:48:28 +0000 (16:48 -0400)]
Test OpTypeForwardPointer.

9 years agoAdded tracking to types and validated certain instructions.
Andrew Woloszyn [Tue, 29 Sep 2015 15:28:34 +0000 (11:28 -0400)]
Added tracking to types and validated certain instructions.

We need to know how to generate correct SPIRV for cases like
OpConstant %int64 42 since the current parser will encode the 42 as a
32-bit value incorrectly.

This change is the first of a pair. This one tracks types, and makes
sure that OpConstant and OpSpecConstant are only ever called with
Integer or Float types, and OpSwitch is only called with integer
generating values.

9 years agoRemove spv_opcode_flags_t and flags fields.
David Neto [Wed, 7 Oct 2015 20:58:38 +0000 (16:58 -0400)]
Remove spv_opcode_flags_t and flags fields.

The flags fields in both spv_opcode_desc_t and spv_operand_desc_t
are redundant with the capabilities mask field in the same
structure.