Commit Graph

699 Commits

Author SHA1 Message Date
Umar Arshad
11437165d6 Fix diagnostic message for layout errors 2016-06-09 15:51:39 -04:00
Umar Arshad
90a4252aae Split validate_types file into multiple classes
Creates separate files for the ValidationState, Function and
BasicBlock classes.
2016-06-08 14:40:33 -04:00
Umar Arshad
00b72c2995 Remove redundant in_block function from Function
Same test can be done through the get_current_block function
2016-06-06 10:27:40 -04:00
Dejan Mircevski
c5fe6d9dc9 Avoid accessing invalid iterator. 2016-06-03 21:46:19 -04:00
Umar Arshad
f9903c8d36 Additional CFG tests
* Empty function
* Single block loops
* Nested loops
* Nested selection
2016-06-03 15:29:44 -04:00
David Neto
87125a19c6 Fix CHANGES file version parsing. -dev is optional 2016-06-02 15:32:28 -04:00
Dejan Mircevski
812fb7d798 Make googletest regexes portable.
On Windows, test::MatchesRegex() doesn't support brackets.  On Linux, \d
doesn't work. :(
2016-06-02 13:13:04 -04:00
Umar Arshad
0b9fd50d31 Control Flow Graph Validation 2016-06-02 12:11:52 -04:00
Lei Zhang
2ea7449c9c Create a function for adding unittests in CMake.
Also remove unnecessary main() function for unittests.
2016-05-30 10:28:56 -04:00
Lei Zhang
6a1e1ac7b9 Travis CI: Use ctest to run all the tests. 2016-05-25 21:02:47 -04:00
Lei Zhang
c7551e1f07 Add Appveyor configuration for Windows build. 2016-05-17 09:48:48 -04:00
Dejan Mircevski
0d512bbef5 Test ABGR in both 1.0 and 1.1. 2016-05-12 22:06:28 -04:00
Dejan Mircevski
7fdf56cbdc Remove needless include dir for spirv-dis. 2016-05-11 15:21:10 -04:00
Dejan Mircevski
faad7fea3d Test ABGR image channel order.
Update include/spirv/spirv.h from SPIRV-Headers.
2016-05-11 15:14:21 -04:00
Dejan Mircevski
6520ba93ac Test OpModuleProcessed. 2016-05-11 12:40:59 -04:00
Dejan Mircevski
10f1020560 Remove done TODOs in OpNameTest.
Simplify the instantiation by using Values() instead of ValuesIn().

Run clang-format.
2016-05-11 10:34:27 -04:00
Dejan Mircevski
a7c1265c38 Test SpecId validation. 2016-05-11 10:01:06 -04:00
Dejan Mircevski
2703039b44 Add --target-env.
commit 7648187c34
Author: Dejan Mircevski <deki@google.com>
Date:   Thu Apr 21 15:44:07 2016 -0400

    Turn --vulkan into --target-env.
2016-05-11 09:48:52 -04:00
Dejan Mircevski
4376856b1a Add tests for MaxByteOffset. 2016-05-10 22:46:27 -04:00
Jamie Madill
dc4c2ba7dc Add PipeStorage tests. 2016-05-09 13:54:05 -04:00
Jamie Madill
34cb0035fd 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'
2016-04-29 18:02:01 -04:00
Florian Ziesche
66fcb456c1 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
2016-04-29 14:55:05 -04:00
Dejan Mircevski
13877a3b0e Add v1.1 tests for OpLoopMerge. 2016-04-29 14:09:52 -04:00
Dejan Mircevski
3732d6cc21 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.
2016-04-29 13:40:01 -04:00
Dejan Mircevski
af701f8f6a Add basic Initializer/Finalizer tests. 2016-04-27 22:02:39 -04:00
Lei Zhang
ca1bf94c90 Use a single definition of ARRAY_SIZE to simplify code. 2016-04-27 17:05:24 -04:00
Dejan Mircevski
45d391b7b1 Add OpSizeOf tests. 2016-04-27 15:41:58 -04:00
Dejan Mircevski
da8222ee4e Refactor OpExecutionModeTest and apply it on v1.1.
Previously v1.1 testing was dead.
2016-04-26 13:03:28 -04:00
Dejan Mircevski
27d6008889 Refactor v1.1 tests and turn them on.
Previously, the "V11" text fixture was empty.
2016-04-26 12:16:00 -04:00
David Neto
9166854ac9 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.
2016-04-22 15:19:45 -04:00
Dejan Mircevski
776029fb71 Make grammar-generation fail if over 64 capabilities. 2016-04-22 14:56:07 -04:00
Dejan Mircevski
a9f36d0143 Eliminate kCapabilitiesMin/Max. 2016-04-22 14:05:55 -04:00
Dejan Mircevski
59436bb6b7 Turn module_capabilities_ into a spv_capability_mask_t. 2016-04-22 13:35:15 -04:00
Dejan Mircevski
549d78f77f Bump kCapabilitiesMaxValue for v1.1. 2016-04-21 17:27:24 -04:00
Dejan Mircevski
d3da705a22 Fix Windows build.
Replace `#ifdef 0` with comment inside a macro call.
2016-04-21 17:12:47 -04:00
Lei Zhang
f2cf719f50 Avoid going out of bound in advanceLine() and refine comments. 2016-04-21 16:08:51 -04:00
Dejan Mircevski
2ea54f5d1b 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.
2016-04-21 15:46:08 -04:00
Dejan Mircevski
2d975d54ae Mention 1.1 support in the README. 2016-04-20 12:58:59 -04:00
Dejan Mircevski
7b33485f6e 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.
2016-04-19 16:34:12 -04:00
Lei Zhang
d12a10d2dd Fix wrong grammar .inc file dependency introduced by copy-paste. 2016-04-18 16:48:33 -04:00
Lei Zhang
e94d6d18dd Rework CMake rules for building grammar tables.
Use add_custom_command() to generate all .inc files and manage
dependency with set_source_files_properties().
2016-04-18 15:50:43 -04:00
Derek Sollenberger
009c4358b5 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.
2016-04-18 11:43:24 -04:00
David Neto
552d319962 Make directories more safely.
Avoid a race on check-for-dir vs. make-dir
when running the inc-file generation script concurrently.
2016-04-18 10:46:15 -04:00
Dejan Mircevski
cb3c49ef82 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().
2016-04-18 10:45:57 -04:00
Dejan Mircevski
e26fdc6bd1 Mark SPIR-V grammar files as 1.0.
Factor the CMake generate_grammar_tables invocation into a function
parameterized on the version.
2016-04-18 10:00:01 -04:00
Lei Zhang
77d4e30eda GLSL grammar update.
* Add names to operands.
* Fix capability requirements for UnpackDouble2x32.
* Fix operands list error for NClamp.
2016-04-14 18:35:14 -04:00
John Kessenich
27d98e2954 Merge pull request #181 from antiagainst/readme
Use footnotes for links in README.md.
2016-04-14 13:09:09 -06:00
Lei Zhang
29ca6f9894 Use footnotes for links in README.md. 2016-04-14 14:13:28 -04:00
Lei Zhang
489786465a Grammar update: OpPhi now uses PairIdRefIdRef as the last operand. 2016-04-13 13:43:44 -04:00
Lei Zhang
11636fb100 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.
2016-04-13 13:43:44 -04:00