platform/upstream/SPIRV-Tools.git
8 years agoCheck definitions appear in dominator of use
Umar Arshad [Wed, 13 Jul 2016 22:57:52 +0000 (18:57 -0400)]
Check definitions appear in dominator of use

Also address use and def of ID in same instruction

8 years agoRefactor IDs definition and use tracking
Umar Arshad [Fri, 8 Jul 2016 13:44:10 +0000 (09:44 -0400)]
Refactor IDs definition and use tracking

* Creates an ID class which manages definition and use of IDs
* Moved tracking code from validate.cpp to validate_id.cpp
* Rename and combine SsaPass and ProcessIds into IdPass
* Remove module dependency in Function

8 years agoFixes segfault for loops without back-edges
Umar Arshad [Fri, 22 Jul 2016 20:27:21 +0000 (16:27 -0400)]
Fixes segfault for loops without back-edges

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/270

8 years agoStart v2016.2.
Lei Zhang [Tue, 19 Jul 2016 19:04:43 +0000 (15:04 -0400)]
Start v2016.2.

8 years agoFinalize v2016.1.
Lei Zhang [Tue, 19 Jul 2016 19:03:52 +0000 (15:03 -0400)]
Finalize v2016.1.

8 years agoDisassembling: map IDs to friendly names.
David Neto [Fri, 8 Jul 2016 18:29:52 +0000 (14:29 -0400)]
Disassembling: map IDs to friendly names.

Add a FriendlyNameMapper to deduce friendly names for IDs based on
OpName, type structure, etc.

8 years agoTrack changes in SPIRV-Headers for SPIR-V 1.1 rev 2.
Lei Zhang [Mon, 18 Jul 2016 15:01:36 +0000 (11:01 -0400)]
Track changes in SPIRV-Headers for SPIR-V 1.1 rev 2.

* The `Input` StorageClass doesn't require the `Shader` capability
  anymore.
* The `Sampled1D` and `SampledBuffer` capabilities don't require
  the `Shader` capability anymore. So they do not indirectly
  depend on the `Matrix` capability. So are the `Image1D` and
  `ImageBuffer` capabilities, which depend on `Sampled1D` and
  `SampledBuffer`.

A new GLSL grammar file is uploaded for SPIR-V 1.1, but it's the
same as the existing one for SPIR-V 1.0.

Now tracking commit 3814effb879ab5a98a7b9288a4b4c7849d2bc8ac in
SPIRV-Headers.

8 years agoTurn off ClipDistance CullDistance cap checks for Vulkan
David Neto [Thu, 7 Jul 2016 21:03:22 +0000 (17:03 -0400)]
Turn off ClipDistance CullDistance cap checks for Vulkan

Turn them off until resolution of the debate over how they should be checked.
Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/261

8 years agoMention the steps to pull dependencies when building in README.
Lei Zhang [Thu, 7 Jul 2016 19:04:06 +0000 (15:04 -0400)]
Mention the steps to pull dependencies when building in README.

8 years agoTest v1.1 loop dependency support
David Neto [Tue, 5 Jul 2016 14:21:21 +0000 (10:21 -0400)]
Test v1.1 loop dependency support

For DependencyInfinite and DependencyLength, test
that they don't require a capability to be turned on.
Also, that they are assembled, binary parsed, and disassembled
correctly.

8 years agoStart v2016.1-dev
David Neto [Mon, 4 Jul 2016 19:13:08 +0000 (15:13 -0400)]
Start v2016.1-dev

8 years agoFinalize v2016.0
David Neto [Thu, 2 Jun 2016 19:29:13 +0000 (15:29 -0400)]
Finalize v2016.0

8 years agoDRY file writing code in tools.
Lei Zhang [Thu, 30 Jun 2016 19:44:36 +0000 (15:44 -0400)]
DRY file writing code in tools.

8 years agoDRY file reading code in tools.
Lei Zhang [Thu, 30 Jun 2016 18:24:04 +0000 (14:24 -0400)]
DRY file reading code in tools.

8 years agoRework CMake configuration for tools.
Lei Zhang [Thu, 30 Jun 2016 17:56:34 +0000 (13:56 -0400)]
Rework CMake configuration for tools.

8 years agoAdd the spirv-opt command line tool.
Lei Zhang [Wed, 29 Jun 2016 20:16:03 +0000 (16:16 -0400)]
Add the spirv-opt command line tool.

8 years agoAdd Pass, PassManager, and StripDebugInfoPass.
Lei Zhang [Tue, 28 Jun 2016 18:58:17 +0000 (14:58 -0400)]
Add Pass, PassManager, and StripDebugInfoPass.

8 years agoAvoid capability checks on ID values. They are not literals
David Neto [Tue, 28 Jun 2016 21:25:28 +0000 (17:25 -0400)]
Avoid capability checks on ID values. They are not literals

Works around issue 248 by weakening the test:
https://github.com/KhronosGroup/SPIRV-Tools/issues/248

The validator should try to track (32-bit) constant values, and then
for capability checks on IDs, check the referenced value, not the
raw ID number.

8 years agoAdd tests for the cpp interface.
Lei Zhang [Tue, 28 Jun 2016 17:24:10 +0000 (13:24 -0400)]
Add tests for the cpp interface.

8 years agoPromote ir namespace and create draft libspirv.{h|c}pp.
Lei Zhang [Tue, 28 Jun 2016 14:23:13 +0000 (10:23 -0400)]
Promote ir namespace and create draft libspirv.{h|c}pp.

8 years agoAdd IrBuilder for constructing SPIR-V in-memory representation.
Lei Zhang [Sun, 22 May 2016 18:17:39 +0000 (14:17 -0400)]
Add IrBuilder for constructing SPIR-V in-memory representation.

8 years agoAdd an option to spvBinaryToText() to ignore header output.
Lei Zhang [Mon, 27 Jun 2016 19:06:41 +0000 (15:06 -0400)]
Add an option to spvBinaryToText() to ignore header output.

8 years agoFix several violations of the style guide
Umar Arshad [Sat, 25 Jun 2016 03:45:25 +0000 (23:45 -0400)]
Fix several violations of the style guide

8 years agoAdd classes for representing SPIR-V language constructs in memory.
Lei Zhang [Sun, 22 May 2016 18:11:24 +0000 (14:11 -0400)]
Add classes for representing SPIR-V language constructs in memory.

8 years agoTravis CI: bump OS X and XCode version.
Lei Zhang [Fri, 24 Jun 2016 19:48:34 +0000 (15:48 -0400)]
Travis CI: bump OS X and XCode version.

8 years agoUse pseudo entry and pseudo exit blocks for dominance.
David Neto [Fri, 24 Jun 2016 06:14:16 +0000 (02:14 -0400)]
Use pseudo entry and pseudo exit blocks for dominance.

For dominance calculations we use an "augmented" CFG
where we always add a pseudo-entry node that is the predecessor
in the augmented CFG to any nodes that have no predecessors in the
regular CFG.  Similarly, we add a pseudo-exit node that is the
predecessor in the augmented CFG that is a successor to any
node that has no successors in the regular CFG.

Pseudo entry and exit blocks live in the Function object.

Fixes a subtle problem where we were implicitly creating
the block_details for the pseudo-exit node since it didn't
appear in the idoms map, and yet we referenced it.  In such a case the
contents of the block details could be garbage, or zero-initialized.
That sometimes caused incorrect calculation of immediate dominators
and post-dominators.  For example, on a debug build where the details
could be zero-initialized, the dominator of an unreachable block would
be given as the pseudo-exit node.  Bizarre.

Also, enforce the rule that you must have an OpFunctionEnd to close off
the last function.

8 years agoUse arguments for add_spvtools_unittest.
Lei Zhang [Tue, 21 Jun 2016 22:29:36 +0000 (18:29 -0400)]
Use arguments for add_spvtools_unittest.

8 years agoAppveyor: Pull SPIRV-Headers for building and update README link.
Lei Zhang [Wed, 22 Jun 2016 14:53:41 +0000 (10:53 -0400)]
Appveyor: Pull SPIRV-Headers for building and update README link.

8 years agoValidator structured flow checks: back-edge, constructs
Umar Arshad [Sat, 4 Jun 2016 01:24:24 +0000 (21:24 -0400)]
Validator structured flow checks: back-edge, constructs

Skip structured control flow chekcs for non-shader capability.

Fix infinite loop in dominator algorithm when there's an
unreachable block.

8 years agoIgnore Vim swap files.
Lei Zhang [Tue, 21 Jun 2016 21:27:27 +0000 (17:27 -0400)]
Ignore Vim swap files.

8 years agoFix ExtInst parsing: no IdRef* at end
David Neto [Tue, 14 Jun 2016 20:41:27 +0000 (16:41 -0400)]
Fix ExtInst parsing: no IdRef* at end

The operands following the extended instruction literal
number are determined by the extended instruction itself.
So drop the zero-or-more IdRef pattern at the end of OpExtInst.

It's arguable whether this should actually be a grammar fix.  I've
chosen to patch this in SPIRV-Tools instead of in the grammar file.

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/233

Also fix two test cases for OpenCL extended instructions.  These
errors of supplying too many operands are now detected.

8 years agoFix OpenCL pow and pown arguments
David Neto [Tue, 14 Jun 2016 15:45:35 +0000 (11:45 -0400)]
Fix OpenCL pow and pown arguments

Spec fix appeared in SPIR-V 1.0 Rev 2:
https://www.khronos.org/registry/spir-v/specs/1.0/OpenCL.ExtendedInstructionSet.100.html#_changes_from_version_1_0_revision_1

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/143

8 years agoIn physical addressing, functions can return pointers
David Neto [Mon, 13 Jun 2016 21:26:09 +0000 (17:26 -0400)]
In physical addressing, functions can return pointers

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/229

8 years agoUse SPIR-V headers from the KhronosGroup/SPIRV-Headers repo.
Lei Zhang [Thu, 14 Apr 2016 18:05:53 +0000 (14:05 -0400)]
Use SPIR-V headers from the KhronosGroup/SPIRV-Headers repo.

8 years agostd::function needs <functional>. Fixes Android build
David Neto [Fri, 10 Jun 2016 12:43:12 +0000 (08:43 -0400)]
std::function needs <functional>. Fixes Android build

8 years agoAvoid copy of work list argument: make it const ref
David Neto [Fri, 10 Jun 2016 10:41:20 +0000 (06:41 -0400)]
Avoid copy of work list argument: make it const ref

8 years agoRefactor depth first traversal to be more generic
Umar Arshad [Sat, 4 Jun 2016 01:14:22 +0000 (21:14 -0400)]
Refactor depth first traversal to be more generic

Refactor the way the post order vector is created. This new method
will allow for the extraction of backedges and create the post order
vector in one pass.

8 years agoFix diagnostic message for layout errors
Umar Arshad [Thu, 9 Jun 2016 19:51:39 +0000 (15:51 -0400)]
Fix diagnostic message for layout errors

8 years agoSplit validate_types file into multiple classes
Umar Arshad [Thu, 2 Jun 2016 22:51:05 +0000 (18:51 -0400)]
Split validate_types file into multiple classes

Creates separate files for the ValidationState, Function and
BasicBlock classes.

8 years agoRemove redundant in_block function from Function
Umar Arshad [Wed, 1 Jun 2016 22:22:57 +0000 (18:22 -0400)]
Remove redundant in_block function from Function

Same test can be done through the get_current_block function

8 years agoAvoid accessing invalid iterator.
Dejan Mircevski [Sat, 4 Jun 2016 01:46:19 +0000 (21:46 -0400)]
Avoid accessing invalid iterator.

8 years agoAdditional CFG tests
Umar Arshad [Wed, 1 Jun 2016 22:05:28 +0000 (18:05 -0400)]
Additional CFG tests

* Empty function
* Single block loops
* Nested loops
* Nested selection

8 years agoFix CHANGES file version parsing. -dev is optional
David Neto [Thu, 2 Jun 2016 19:32:28 +0000 (15:32 -0400)]
Fix CHANGES file version parsing. -dev is optional

8 years agoMake googletest regexes portable.
Dejan Mircevski [Thu, 2 Jun 2016 17:13:04 +0000 (13:13 -0400)]
Make googletest regexes portable.

On Windows, test::MatchesRegex() doesn't support brackets.  On Linux, \d
doesn't work. :(

8 years agoControl Flow Graph Validation
Umar Arshad [Wed, 16 Mar 2016 21:20:02 +0000 (17:20 -0400)]
Control Flow Graph Validation

8 years agoCreate a function for adding unittests in CMake.
Lei Zhang [Sun, 22 May 2016 17:48:08 +0000 (13:48 -0400)]
Create a function for adding unittests in CMake.

Also remove unnecessary main() function for unittests.

8 years agoTravis CI: Use ctest to run all the tests.
Lei Zhang [Thu, 26 May 2016 01:01:54 +0000 (21:01 -0400)]
Travis CI: Use ctest to run all the tests.

8 years agoAdd Appveyor configuration for Windows build.
Lei Zhang [Tue, 17 May 2016 13:02:45 +0000 (09:02 -0400)]
Add Appveyor configuration for Windows build.

8 years agoTest ABGR in both 1.0 and 1.1.
Dejan Mircevski [Fri, 13 May 2016 02:06:28 +0000 (22:06 -0400)]
Test ABGR in both 1.0 and 1.1.

8 years agoRemove needless include dir for spirv-dis.
Dejan Mircevski [Wed, 11 May 2016 19:21:10 +0000 (15:21 -0400)]
Remove needless include dir for spirv-dis.

8 years agoTest ABGR image channel order.
Dejan Mircevski [Wed, 11 May 2016 17:12:59 +0000 (13:12 -0400)]
Test ABGR image channel order.

Update include/spirv/spirv.h from SPIRV-Headers.

8 years agoTest OpModuleProcessed.
Dejan Mircevski [Wed, 11 May 2016 16:40:59 +0000 (12:40 -0400)]
Test OpModuleProcessed.

8 years agoRemove done TODOs in OpNameTest.
Dejan Mircevski [Wed, 11 May 2016 14:34:27 +0000 (10:34 -0400)]
Remove done TODOs in OpNameTest.

Simplify the instantiation by using Values() instead of ValuesIn().

Run clang-format.

8 years agoTest SpecId validation.
Dejan Mircevski [Tue, 10 May 2016 21:02:41 +0000 (17:02 -0400)]
Test SpecId validation.

8 years agoAdd --target-env.
Dejan Mircevski [Wed, 11 May 2016 13:48:52 +0000 (09:48 -0400)]
Add --target-env.

commit 7648187c344cfc7847607acb2a6fa5606a3d10c1
Author: Dejan Mircevski <deki@google.com>
Date:   Thu Apr 21 15:44:07 2016 -0400

    Turn --vulkan into --target-env.

8 years agoAdd tests for MaxByteOffset.
Dejan Mircevski [Tue, 10 May 2016 03:15:46 +0000 (23:15 -0400)]
Add tests for MaxByteOffset.

8 years agoAdd PipeStorage tests.
Jamie Madill [Fri, 29 Apr 2016 18:36:00 +0000 (14:36 -0400)]
Add PipeStorage tests.

8 years agoFix several warnings exposed in MSVS 2015.
Jamie Madill [Fri, 29 Apr 2016 18:36:00 +0000 (14:36 -0400)]
Fix several warnings exposed in MSVS 2015.

diagnostic.cpp:
- unreachable code

operand.cpp
- conversion between int and uint32_t
- unreachable code

hex_float.h:
- conversion from 'const int' to 'unsigned int'
- unreachable code

validate_id.cpp
- forcing value to bool 'true' or 'false'

validate_types.cpp:
- forcing value to bool 'true' or 'false'

8 years agobitcast fixes
Florian Ziesche [Wed, 2 Mar 2016 21:17:54 +0000 (22:17 +0100)]
bitcast fixes

 * ValidationState_t and idUsage now store the addressing model and memory model of the SPIR-V module (this is necessary for certain instructions that need different checks depending on if the logical or physical addressing model is used)
 * removed SpvOpPtrAccessChain and SpvOpInBoundsPtrAccessChain from spvOpcodeIsPointer again as these are disallowed in logical addressing mode and only allowed in physical addressing mode (which doesn't use/need spvOpcodeIsPointer in the first place)
 * added SpvOpImageTexelPointer and SpvOpCopyObject to spvOpcodeIsPointer
 * OpLoad/OpStore now only check if the used pointer operand originated from a valid pointer producing opcode in logical addressing mode (as per 2.16.1)
 * moved bitcast pointer tests to the kernel / physical addressing model part (+cleanup)
 * renamed spvOpcodeIsPointer to spvOpcodeReturnsLogicalPointer to clarify this function is only meant to be used with the logical addressing model

8 years agoAdd v1.1 tests for OpLoopMerge.
Dejan Mircevski [Wed, 27 Apr 2016 20:22:15 +0000 (16:22 -0400)]
Add v1.1 tests for OpLoopMerge.

8 years agoAdd v1.1 capabilities validation.
Dejan Mircevski [Fri, 29 Apr 2016 17:40:01 +0000 (13:40 -0400)]
Add v1.1 capabilities validation.

Refactor the ValidateCapability test fixture.

Explain the meaning of test parameters.  Factor out methods for
convenience and readability.  DRY v1.0 and v1.1 tests.

8 years agoAdd basic Initializer/Finalizer tests.
Dejan Mircevski [Wed, 27 Apr 2016 21:04:37 +0000 (17:04 -0400)]
Add basic Initializer/Finalizer tests.

8 years agoUse a single definition of ARRAY_SIZE to simplify code.
Lei Zhang [Wed, 27 Apr 2016 20:47:13 +0000 (16:47 -0400)]
Use a single definition of ARRAY_SIZE to simplify code.

8 years agoAdd OpSizeOf tests.
Dejan Mircevski [Wed, 27 Apr 2016 19:41:58 +0000 (15:41 -0400)]
Add OpSizeOf tests.

8 years agoRefactor OpExecutionModeTest and apply it on v1.1.
Dejan Mircevski [Tue, 26 Apr 2016 17:03:28 +0000 (13:03 -0400)]
Refactor OpExecutionModeTest and apply it on v1.1.

Previously v1.1 testing was dead.

8 years agoRefactor v1.1 tests and turn them on.
Dejan Mircevski [Tue, 26 Apr 2016 16:16:00 +0000 (12:16 -0400)]
Refactor v1.1 tests and turn them on.

Previously, the "V11" text fixture was empty.

8 years agoAdd CHANGES file with high level software history
David Neto [Fri, 22 Apr 2016 00:50:11 +0000 (20:50 -0400)]
Add CHANGES file with high level software history

Add a high level version number for SPIRV-Tools, beginning
with v2016.0-dev.  The README describes the format of the
version number.

The high level version number is extracted from the CHANGES
file.  That works around:
 - stale-bait for when we don't add tags to the repository
 - our inability to add tags to the repository

Option --version causes spirv-as, spirv-dis, and spirv-val to
show the high level version number.

Add spvSoftwareVersionString to return the C-string for
the high level version number.

Add spvSoftwareVersionDetailsString() so that clients can get
more information if they want to.
Also allows us to clean up the uses in the tool executables files,
so now only one file includes build-version.inc.

Move the update-build-version logic to the only
CMakeLists file that needs it.

The update build version script takes a new argument
to name the output file.

8 years agoMake grammar-generation fail if over 64 capabilities.
Dejan Mircevski [Fri, 22 Apr 2016 18:56:07 +0000 (14:56 -0400)]
Make grammar-generation fail if over 64 capabilities.

8 years agoEliminate kCapabilitiesMin/Max.
Dejan Mircevski [Fri, 22 Apr 2016 18:05:55 +0000 (14:05 -0400)]
Eliminate kCapabilitiesMin/Max.

8 years agoTurn module_capabilities_ into a spv_capability_mask_t.
Dejan Mircevski [Fri, 22 Apr 2016 17:35:15 +0000 (13:35 -0400)]
Turn module_capabilities_ into a spv_capability_mask_t.

8 years agoBump kCapabilitiesMaxValue for v1.1.
Dejan Mircevski [Thu, 21 Apr 2016 21:16:32 +0000 (17:16 -0400)]
Bump kCapabilitiesMaxValue for v1.1.

8 years agoFix Windows build.
Dejan Mircevski [Thu, 21 Apr 2016 21:12:47 +0000 (17:12 -0400)]
Fix Windows build.

Replace `#ifdef 0` with comment inside a macro call.

8 years agoAvoid going out of bound in advanceLine() and refine comments.
Lei Zhang [Thu, 21 Apr 2016 19:50:23 +0000 (15:50 -0400)]
Avoid going out of bound in advanceLine() and refine comments.

8 years agoAdd tests for SubgroupDispatch.
Dejan Mircevski [Thu, 21 Apr 2016 19:46:08 +0000 (15:46 -0400)]
Add tests for SubgroupDispatch.

Introduced in v1.1, SubgroupDispatch adds the following:
- two new execution modes
- one new capability
- two new opcodes

Extend ValidateBase methods to take a spv_target_env.  Replace the
context_ member with ScopedContext inside the said methods.  Give
ScopedContext wider visibility by moving it outside
TextToBinaryTestBase.

8 years agoMention 1.1 support in the README.
Dejan Mircevski [Tue, 19 Apr 2016 20:53:47 +0000 (16:53 -0400)]
Mention 1.1 support in the README.

8 years agoFirst tests for SPIR-V v1.1.
Dejan Mircevski [Tue, 19 Apr 2016 02:25:35 +0000 (22:25 -0400)]
First tests for SPIR-V v1.1.

Add test for named-barrier instructions and capability.

Add spv_target_env as an optional argument to CompileSuccessfully() and
CompileFailure().  Currently defaults to UNIVERSAL_1_0, though that
could change in the future.

Make spv_context a local variable in test methods instead of a
TextToBinaryTestBase member.  Introduce ScopedContext to make temp
contexts easier.

8 years agoFix wrong grammar .inc file dependency introduced by copy-paste.
Lei Zhang [Mon, 18 Apr 2016 20:48:33 +0000 (16:48 -0400)]
Fix wrong grammar .inc file dependency introduced by copy-paste.

8 years agoRework CMake rules for building grammar tables.
Lei Zhang [Fri, 15 Apr 2016 16:51:55 +0000 (12:51 -0400)]
Rework CMake rules for building grammar tables.

Use add_custom_command() to generate all .inc files and manage
dependency with set_source_files_properties().

8 years agoUpdate cmake files to support Android as a build target.
Derek Sollenberger [Mon, 18 Apr 2016 14:59:47 +0000 (10:59 -0400)]
Update cmake files to support Android as a build target.

This enables cross-compiling to Android using scripts like
cmake-android that update the system name to reflect the build
target.

8 years agoMake directories more safely.
David Neto [Mon, 18 Apr 2016 14:32:49 +0000 (10:32 -0400)]
Make directories more safely.

Avoid a race on check-for-dir vs. make-dir
when running the inc-file generation script concurrently.

8 years agoAdd SPIR-V 1.1 grammar.
Dejan Mircevski [Thu, 7 Apr 2016 18:41:34 +0000 (14:41 -0400)]
Add SPIR-V 1.1 grammar.

Switch to SPIR-V 1.1 as default.
Introduce SPV_ENV_UNIVERSAL_1_1.
Add "1_0" to the internal variable names.
Add spv_target_env to spv*GetTable().

8 years agoMark SPIR-V grammar files as 1.0.
Dejan Mircevski [Thu, 7 Apr 2016 18:09:48 +0000 (14:09 -0400)]
Mark SPIR-V grammar files as 1.0.

Factor the CMake generate_grammar_tables invocation into a function
parameterized on the version.

8 years agoGLSL grammar update.
Lei Zhang [Thu, 14 Apr 2016 22:35:14 +0000 (18:35 -0400)]
GLSL grammar update.

* Add names to operands.
* Fix capability requirements for UnpackDouble2x32.
* Fix operands list error for NClamp.

8 years agoMerge pull request #181 from antiagainst/readme
John Kessenich [Thu, 14 Apr 2016 19:09:09 +0000 (13:09 -0600)]
Merge pull request #181 from antiagainst/readme

Use footnotes for links in README.md.

8 years agoUse footnotes for links in README.md.
Lei Zhang [Thu, 14 Apr 2016 18:10:35 +0000 (14:10 -0400)]
Use footnotes for links in README.md.

8 years agoGrammar update: OpPhi now uses PairIdRefIdRef as the last operand.
Lei Zhang [Wed, 13 Apr 2016 15:50:27 +0000 (11:50 -0400)]
Grammar update: OpPhi now uses PairIdRefIdRef as the last operand.

8 years agoUpdate the core grammar.
Lei Zhang [Tue, 12 Apr 2016 18:51:50 +0000 (14:51 -0400)]
Update the core grammar.

* IdType is renamed to IdResultType.
* version is splitted into major_version and minor_version.
* Seperate Scope and IdScope operand kinds. Same for MemorySemantics.

8 years agoMake paths to grammar output files
David Neto [Tue, 12 Apr 2016 20:09:13 +0000 (16:09 -0400)]
Make paths to grammar output files

The directory for a grammar output file will be created if
it doesn't already exist.

This is required to make the Android.mk build work.

8 years agoRemove revision from SPV_ENV_*.
Dejan Mircevski [Mon, 11 Apr 2016 19:31:00 +0000 (15:31 -0400)]
Remove revision from SPV_ENV_*.

Revisions proliferate quickly and we don't promise to retain extra
grammar copies for every historical one.

8 years agoAllow to only build certain grammar tables.
Lei Zhang [Fri, 8 Apr 2016 14:31:51 +0000 (10:31 -0400)]
Allow to only build certain grammar tables.

8 years agoRemove the outdated patch file.
Lei Zhang [Thu, 7 Apr 2016 19:09:31 +0000 (15:09 -0400)]
Remove the outdated patch file.

Now we use the JSON grammar and the generate_grammar_tables.py
script to maintain various info tables. That patch file will not
be needed anymore.

8 years agoFix MSVC error C2797.
Dejan Mircevski [Mon, 4 Apr 2016 20:05:31 +0000 (16:05 -0400)]
Fix MSVC error C2797.

8 years agoUse JSON grammar files to generate extended instruction sets.
Lei Zhang [Mon, 4 Apr 2016 18:30:56 +0000 (14:30 -0400)]
Use JSON grammar files to generate extended instruction sets.

8 years agoRname grammar.json to spirv.core.grammar.json and add version info.
Lei Zhang [Mon, 4 Apr 2016 18:03:35 +0000 (14:03 -0400)]
Rname grammar.json to spirv.core.grammar.json and add version info.

8 years agoFix validation of array length.
Dejan Mircevski [Mon, 4 Apr 2016 19:55:05 +0000 (15:55 -0400)]
Fix validation of array length.

8 years agoRemove dependency on SPIR-V headers in libspirv.h.
Lei Zhang [Thu, 31 Mar 2016 21:26:31 +0000 (17:26 -0400)]
Remove dependency on SPIR-V headers in libspirv.h.

For fulfilling this purpose, the |opcode| field in the
|spv_parsed_instruction_t| struct is changed to of type uint16_t.

Also add functions to query the information of a given SPIR-V
target environment.

8 years agoEnable linking against libSPIRV-Tools from linux shared libraries
Chris Forbes [Sun, 3 Apr 2016 22:21:35 +0000 (10:21 +1200)]
Enable linking against libSPIRV-Tools from linux shared libraries

Required for linking against libSPIRV-Tools from LVL's
libVkLayer_core_validation.so.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
8 years agoFix spelling mistakes
Eric Engestrom [Sat, 2 Apr 2016 21:54:59 +0000 (22:54 +0100)]
Fix spelling mistakes

8 years agoUse the JSON grammar file to generate various info tables.
Lei Zhang [Mon, 21 Mar 2016 20:36:14 +0000 (16:36 -0400)]
Use the JSON grammar file to generate various info tables.

This patch uses a Python script to parse the JSON grammar file to
generate the opcode table and operand kind tables.

Now we don't need to do the post-processing (from OperandClass
to spv_operand_type_t) and copying of the opcode info table is
not required anymore!

8 years agoHandle CRLF in assembly text.
Dejan Mircevski [Fri, 1 Apr 2016 04:47:02 +0000 (00:47 -0400)]
Handle CRLF in assembly text.