Lei Zhang [Thu, 14 Apr 2016 18:05:53 +0000 (14:05 -0400)]
Use SPIR-V headers from the KhronosGroup/SPIRV-Headers repo.
David Neto [Fri, 10 Jun 2016 12:43:12 +0000 (08:43 -0400)]
std::function needs <functional>. Fixes Android build
David Neto [Fri, 10 Jun 2016 10:41:20 +0000 (06:41 -0400)]
Avoid copy of work list argument: make it const ref
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.
Umar Arshad [Thu, 9 Jun 2016 19:51:39 +0000 (15:51 -0400)]
Fix diagnostic message for layout errors
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.
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
Dejan Mircevski [Sat, 4 Jun 2016 01:46:19 +0000 (21:46 -0400)]
Avoid accessing invalid iterator.
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
David Neto [Thu, 2 Jun 2016 19:32:28 +0000 (15:32 -0400)]
Fix CHANGES file version parsing. -dev is optional
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. :(
Umar Arshad [Wed, 16 Mar 2016 21:20:02 +0000 (17:20 -0400)]
Control Flow Graph Validation
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.
Lei Zhang [Thu, 26 May 2016 01:01:54 +0000 (21:01 -0400)]
Travis CI: Use ctest to run all the tests.
Lei Zhang [Tue, 17 May 2016 13:02:45 +0000 (09:02 -0400)]
Add Appveyor configuration for Windows build.
Dejan Mircevski [Fri, 13 May 2016 02:06:28 +0000 (22:06 -0400)]
Test ABGR in both 1.0 and 1.1.
Dejan Mircevski [Wed, 11 May 2016 19:21:10 +0000 (15:21 -0400)]
Remove needless include dir for spirv-dis.
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.
Dejan Mircevski [Wed, 11 May 2016 16:40:59 +0000 (12:40 -0400)]
Test OpModuleProcessed.
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.
Dejan Mircevski [Tue, 10 May 2016 21:02:41 +0000 (17:02 -0400)]
Test SpecId validation.
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.
Dejan Mircevski [Tue, 10 May 2016 03:15:46 +0000 (23:15 -0400)]
Add tests for MaxByteOffset.
Jamie Madill [Fri, 29 Apr 2016 18:36:00 +0000 (14:36 -0400)]
Add PipeStorage tests.
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'
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
Dejan Mircevski [Wed, 27 Apr 2016 20:22:15 +0000 (16:22 -0400)]
Add v1.1 tests for OpLoopMerge.
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.
Dejan Mircevski [Wed, 27 Apr 2016 21:04:37 +0000 (17:04 -0400)]
Add basic Initializer/Finalizer tests.
Lei Zhang [Wed, 27 Apr 2016 20:47:13 +0000 (16:47 -0400)]
Use a single definition of ARRAY_SIZE to simplify code.
Dejan Mircevski [Wed, 27 Apr 2016 19:41:58 +0000 (15:41 -0400)]
Add OpSizeOf tests.
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.
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.
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.
Dejan Mircevski [Fri, 22 Apr 2016 18:56:07 +0000 (14:56 -0400)]
Make grammar-generation fail if over 64 capabilities.
Dejan Mircevski [Fri, 22 Apr 2016 18:05:55 +0000 (14:05 -0400)]
Eliminate kCapabilitiesMin/Max.
Dejan Mircevski [Fri, 22 Apr 2016 17:35:15 +0000 (13:35 -0400)]
Turn module_capabilities_ into a spv_capability_mask_t.
Dejan Mircevski [Thu, 21 Apr 2016 21:16:32 +0000 (17:16 -0400)]
Bump kCapabilitiesMaxValue for v1.1.
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.
Lei Zhang [Thu, 21 Apr 2016 19:50:23 +0000 (15:50 -0400)]
Avoid going out of bound in advanceLine() and refine comments.
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.
Dejan Mircevski [Tue, 19 Apr 2016 20:53:47 +0000 (16:53 -0400)]
Mention 1.1 support in the README.
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.
Lei Zhang [Mon, 18 Apr 2016 20:48:33 +0000 (16:48 -0400)]
Fix wrong grammar .inc file dependency introduced by copy-paste.
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().
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.
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.
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().
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.
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.
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.
Lei Zhang [Thu, 14 Apr 2016 18:10:35 +0000 (14:10 -0400)]
Use footnotes for links in README.md.
Lei Zhang [Wed, 13 Apr 2016 15:50:27 +0000 (11:50 -0400)]
Grammar update: OpPhi now uses PairIdRefIdRef as the last operand.
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.
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.
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.
Lei Zhang [Fri, 8 Apr 2016 14:31:51 +0000 (10:31 -0400)]
Allow to only build certain grammar tables.
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.
Dejan Mircevski [Mon, 4 Apr 2016 20:05:31 +0000 (16:05 -0400)]
Fix MSVC error C2797.
Lei Zhang [Mon, 4 Apr 2016 18:30:56 +0000 (14:30 -0400)]
Use JSON grammar files to generate extended instruction sets.
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.
Dejan Mircevski [Mon, 4 Apr 2016 19:55:05 +0000 (15:55 -0400)]
Fix validation of array length.
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.
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>
Eric Engestrom [Sat, 2 Apr 2016 21:54:59 +0000 (22:54 +0100)]
Fix spelling mistakes
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!
Dejan Mircevski [Fri, 1 Apr 2016 04:47:02 +0000 (00:47 -0400)]
Handle CRLF in assembly text.
Dejan Mircevski [Thu, 31 Mar 2016 16:16:51 +0000 (12:16 -0400)]
Add a target environment to spvContextCreate().
Run clang-format.
David Neto [Tue, 29 Mar 2016 18:49:05 +0000 (14:49 -0400)]
OpExecutionMode only takes a single ExecutionMode
Previously, the grammar allowed many execution modes for a single
OpExecutionMode instruction.
Removes the variable- and optional- execution mode operand type
enum values.
Issue found by antiagainst@
Lei Zhang [Tue, 29 Mar 2016 13:47:23 +0000 (09:47 -0400)]
Capability fix: ImageReadWrite & ImageMipmap require ImageBasic.
Andrew Woloszyn [Fri, 18 Mar 2016 18:13:16 +0000 (14:13 -0400)]
Make everything compile cleanly with -Wpedantic.
This makes SPIRV_WARN_EVERYTHING compile cleanly.
David Neto [Thu, 17 Mar 2016 18:04:32 +0000 (14:04 -0400)]
Support both -h, --help on spirv-as, spirv-val
The spirv-dis command already supports both.
Lei Zhang [Thu, 17 Mar 2016 19:20:22 +0000 (15:20 -0400)]
Travis CI: update test binary location and return correct status.
Lei Zhang [Thu, 17 Mar 2016 02:43:31 +0000 (22:43 -0400)]
Split CMakeLists.txt into smaller ones.
Lei Zhang [Wed, 16 Mar 2016 18:05:37 +0000 (14:05 -0400)]
Travis CI: add configuration for testing on Mac OS X.
David Neto [Mon, 29 Feb 2016 06:01:04 +0000 (01:01 -0500)]
Support Linux-to-Windows cross comiple via MinGW
For MinGW compile, statically link the C++ runtime
Change-Id: Ic58d1e47a814a265fd91edd7082e938ffc87f0c9
Lei Zhang [Tue, 15 Mar 2016 20:52:40 +0000 (16:52 -0400)]
Change the interface for getWord().
* It's redundant to provide two mutable spv_position to getWord().
* getWord() should take string pointer by the style guide.
Lei Zhang [Wed, 16 Mar 2016 18:54:47 +0000 (14:54 -0400)]
Travis CI: use Ubuntu 14.04 (Trusty) as the Linux environment.
Dejan Mircevski [Tue, 15 Mar 2016 19:16:40 +0000 (15:16 -0400)]
Remove AssemblyContext::getWord().
Fixes #152.
Daniel Robertson [Mon, 14 Mar 2016 12:41:32 +0000 (08:41 -0400)]
Add patchlevel to CMake requirement
Lei Zhang [Fri, 11 Mar 2016 20:24:41 +0000 (15:24 -0500)]
Return str in describe() as said by the blurb.
Lei Zhang [Fri, 11 Mar 2016 20:03:04 +0000 (15:03 -0500)]
Fix the corner case in version generation script.
When the given directory is not inside the SPIRV-Tools project,
describe() returns a str instance instead of bytes instance
in Python3, which will case problem when calling decode() on it.
Andrew Woloszyn [Mon, 7 Mar 2016 20:55:44 +0000 (15:55 -0500)]
Fixed float->int16 conversion warnings in VS2013.
Lei Zhang [Mon, 7 Mar 2016 18:44:09 +0000 (13:44 -0500)]
Add comments to explain why calling decode().
Lei Zhang [Sun, 6 Mar 2016 18:00:58 +0000 (13:00 -0500)]
Run pyformat with -s 4 --force_quote_type=single.
Lei Zhang [Sun, 6 Mar 2016 16:44:21 +0000 (11:44 -0500)]
Imporve compatibility with Python3.
* Use print_function from __future__ to tackle the print syntax
change.
* In Python3 str and bytes are no longer the same thing. Need
proper decode.
Florian Ziesche [Tue, 1 Mar 2016 18:56:14 +0000 (19:56 +0100)]
Don't check kernel entry-point signatures.
Recognize SpvOpInBoundsPtrAccessChain and SpvOpPtrAccessChain as opcodes
returning a pointer.
* spvOpcodeIsPointer: recognize SpvOpInBoundsPtrAccessChain and SpvOpPtrAccessChain as opcodes returning a pointer
* isValid<SpvOpEntryPoint>: don't check kernel function signatures (these don't have to be 'void main(void)')
* added tests for kernel OpEntryPoint, OpInBoundsPtrAccessChain and OpPtrAccessChain, as well as facilities to actually test kernel/OpenCL SPIR-V
* fixed pow and pown specification (both should take 2 parameters), spec bug reported at https://www.khronos.org/bugzilla/show_bug.cgi?id=1469
* use ASSERT_TRUE instead of ASSERT_EQ
* added pow and pown test (pow(val, 2.0f) and pown(val, 3))
Revert " * fixed pow and pown specification (both should take 2 parameters), spec bug reported at https://www.khronos.org/bugzilla/show_bug.cgi?id=1469"
This reverts commit
c3d5a87e73334b25aa4278964eea6d1c7625cd81.
Revert " * added pow and pown test (pow(val, 2.0f) and pown(val, 3))"
This reverts commit
7624aec720a51dc212704dc92eff6ae3634d2d6c.
Dejan Mircevski [Tue, 1 Mar 2016 15:17:18 +0000 (10:17 -0500)]
Make libspirv.h more C friendly.
In C, `#include <stdbool.h>` so `bool` is recognized.
Add a `typedef` for `spv_context_t`.
Lei Zhang [Fri, 26 Feb 2016 20:38:42 +0000 (15:38 -0500)]
Remove stale code.
Lei Zhang [Thu, 25 Feb 2016 21:11:16 +0000 (16:11 -0500)]
Fix issues reported by cppcheck.
Remove code not being used, add explicit to constructors, and
add missing fields in constructors.
Andrew Woloszyn [Wed, 24 Feb 2016 20:26:05 +0000 (15:26 -0500)]
Added missing <cstdint> in bitutils.
This was breaking MSVC2013.
David Neto [Wed, 24 Feb 2016 17:41:29 +0000 (12:41 -0500)]
If no tag in the repo, then show the commit hash
Andrew Woloszyn [Wed, 24 Feb 2016 15:11:07 +0000 (10:11 -0500)]
Actually find the python executable before use.
Also change PYTHON_EXE to PYTHON_EXECUTABLE to match what
the cmake documentation says.
David Neto [Tue, 23 Feb 2016 22:58:31 +0000 (17:58 -0500)]
Use subprocess.Popen, hoping for Windows portability
Replaces use of subprocess.check_output
Lei Zhang [Mon, 22 Feb 2016 20:25:50 +0000 (15:25 -0500)]
Remove spv_validate_options_t and change tests accrodingly.
Users always want to run all the checks. The spv_validate_options_t
mechanism, which provides little benefits to users, complicates the
internal implementation and also makes the tests exercise different
paths as users do.
Right now the tests are more like integration tests instead of
unit tests, which should be our next refactoring aim.
qining [Mon, 22 Feb 2016 21:07:19 +0000 (16:07 -0500)]
Implement --version for spirv-tools
'spirv-as --version', 'spirv-dis --version' and 'spirv-val --version'
will display version information.
Lei Zhang [Mon, 22 Feb 2016 22:17:25 +0000 (17:17 -0500)]
getWord() should not go beyond the end of the source text.
This addresses Bug #126 where EOL is missing at the end of
source file.
David Neto [Mon, 22 Feb 2016 21:43:53 +0000 (16:43 -0500)]
spirv-val help says it's a work in progress.
Lei Zhang [Fri, 19 Feb 2016 15:15:17 +0000 (10:15 -0500)]
Avoid closing stdin and stdout.
Lei Zhang [Thu, 18 Feb 2016 23:04:11 +0000 (18:04 -0500)]
Fix command line option errors in val.
* There is no -capability.
* -rules is missing.
* -id by default is turned off.
* Add -all.