summaryrefslogtreecommitdiff
path: root/source/comp
AgeCommit message (Collapse)AuthorFilesLines
2018-08-07Simplify MoveToFront (#1806)dan sinclair2-4/+5
This CL removes the templating from the MoveToFront code as all non-test code uses uint32_t as the variable.
2018-08-07Fix readbility/braces warnings (#1804)dan sinclair1-1/+1
2018-08-03Cleanup includes. (#1795)dan sinclair3-26/+31
This Cl cleans up the include paths to be relative to the top level directory. Various include-what-you-use fixes have been added.
2018-08-03Rewrite include guards (#1793)dan sinclair2-6/+6
This CL rewrites the include guards to make PRESUBMIT.py include guard check happy.
2018-08-01Remove std::deque in favour of std::vector. (#1755)dan sinclair1-1/+1
This CL removes the two deque's from ValidationState and converts them into std::vectors. In order to maintain the stability of instructions we walk over the binary and counter the instructions and functions in the ValidationState constructor and reserve the required number of items in the module_functions_ and ordered_instructions_ vectors. Issue #1176.
2018-07-11Move validation files to val/ directory (#1692)dan sinclair1-1/+1
This CL moves the various validate files into the val/ directory with the rest of the validation infrastructure. This matches how opt/ is setup with the passes with the infrastructure.
2018-07-09Move the validation code into the val:: namespace (#1682)dan sinclair1-12/+12
This CL moves the validation code to the val:: namespace. This makes it clearer which instance of the Instruction and other classes are being referred too.
2018-07-07Change libspirv to spvtools namespace (#1678)dan sinclair1-13/+9
This CL changes all of the libspirv namespace code to spvtools to match the rest of the code base.
2018-07-06Move utils/ to spvtools::utilsdan sinclair2-15/+15
Currently the utils/ folder uses both spvutils:: and spvtools::utils. This CL changes the namespace to consistenly be spvtools::utils to match the rest of the codebase.
2018-07-06Move comp code into comp namespacedan sinclair3-2/+7
This CL moves the code in the comp/ directories into the comp namespace.
2018-06-19[val] Add extra context to error messages. (#1600)dan sinclair1-47/+28
[val] Add extra context to error messages. This CL extends the error messages produced by the validator to output the disassembly of the errored line. The validation_id messages have also been updated to print the line number of the error instead of the word number. Note, the error number is from the start of the SPIR-V, it does not include any headers printed in the disassembled code. Fixes #670, #1581
2017-12-18Remove concept of FIRST_CONCRETE_* operand typesDavid Neto1-2/+1
2017-12-14Refactor include of latest spir-v header versionsAndrey Tuganov2-4/+4
2017-11-27Re-format source tree - NFC.Diego Novillo1-1/+2
Re-formatted the source tree with the command: $ /usr/bin/clang-format -style=file -i \ $(find include source tools test utils -name '*.cpp' -or -name '*.h') This required a fix to source/val/decoration.h. It was not including spirv.h, which broke builds when the #include headers were re-ordered by clang-format.
2017-11-23Test for pollution of the global namespaceDavid Neto1-0/+1
Works on Linux only for now. That's a good start. Move ValidateBinaryUsingContextAndValidationState into anonymous namespace in source/validate.cpp.
2017-11-23Move SetContextMessageConsumer into libspirv namespaceDavid Neto1-2/+2
Avoid polluting the global namespace.
2017-11-21Add new compression algorithm and modelsAndrey Tuganov2-203/+383
Add new "short descriptor" algorithm to MARK-V codec. Add three shader compression models: lite - fast, poor compression mid - balanced max - best compression
2017-11-08Re-format files in source, source/opt, source/util, source/val and tools.Diego Novillo3-433/+320
NFC. This just makes sure every file is formatted following the formatting definition in .clang-format. Re-formatted with: $ clang-format -i $(find source tools include -name '*.cpp') $ clang-format -i $(find source tools include -name '*.h')
2017-10-28Compression: removed 'presumed index' featureAndrey Tuganov1-66/+1
The feature used to improve compression of const integers which were presumed to be indices. Now obsolete as descriptor-based compression does this in a more generalized way.
2017-10-23Refactored compression debuggerAndrey Tuganov2-57/+118
Markv codec now receives two optional callbacks: LogConsumer for internal codec logging DebugConsumer for testing if encoding->decoding produces the original results.
2017-10-12Refactored MARK-V APIAndrey Tuganov7-14960/+341
- switched from C to C++ - moved MARK-V model creation from backend to frontend - The same MARK-V model object can be used to encode/decode multiple files - Added MARK-V model factory (currently only one option) - Added --validate option to spirv-markv (run validation while encoding/decoding)
2017-09-26Detach MARK-V from the validatorAndrey Tuganov1-128/+157
MARK-V codec was previously dependent on the validation state. Now it doesn't need the validator to function, but can still optionally create it and validate every instruction once it's decoded.
2017-09-25Add SPIRV_SPIRV_COMPRESSION option to cmakeAndrey Tuganov1-16/+19
The option is off by default. cmake -DSPIRV_BUILD_COMPRESSION=ON .. enables the compression lib, executable, and test build. Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/834
2017-09-20Updated markv_autogenAndrey Tuganov4-1205/+11829
- now includes a table of all descriptors with coding scheme (improves performance by 5% by allowing to avoid creation of move-to-front sequences which will never be used) - increased the size of markv_autogen.inc, clang doesn't seem to have the long compilation time problem now (probably was inadvertently fixed by using Huffman codec serialization)
2017-09-08Add new checks to validate arithmetics passAndrey Tuganov1-1/+3
New operations: - OpDot - OpVectorTimesScalar - OpMatrixTimesScalar - OpVectorTimesMatrix - OpMatrixTimesVector - OpMatrixTimesMatrix - OpOuterProduct
2017-09-06Update MARK-V to version 1.01Andrey Tuganov5-449/+6020
Includes: - Multi-sequence move-to-front - Coding by id descriptor - Statistical coding of non-id words - Joint coding of opcode and num_operands Removed explicit form Huffman codec constructor - The standard use case for it is to be constructed from initializer list. Using serialization for Huffman codecs
2017-07-13Fix Visual Studio size_t cast compiler warningLenny Komow1-1/+1
Visual Studio was complaining about possible loss of data on 64-bit builds, due to an implicit cast from size_t to int. This changes the data to use an int with no cast.
2017-07-04MARK-V decoder supports extended instructionsAndrey Tuganov1-7/+44
2017-07-04Define variable to skip installationd3x0r1-4/+6
If this is used as a static library in another project, this does not need to be installed, and otherwise will just clutter the application's install. To use, define SKIP_SPIRV_TOOLS_INSTALL which internally defines ENABLE_SPIRV_TOOLS_INSTALL to control installation. Also include GNUInstallDirs to get standard output 'lib' directory which is sometimes 'lib64' and not 'lib'
2017-07-04Convert pattern stack from deque to vector, and share itChris Forbes1-6/+7
Also move various vector::reserve calls to State ctor Negligible perf benefit, but more tidy.
2017-06-30Added compression tool tools/spirv-markv. Work in progress.Andrey Tuganov2-0/+1550
Command line application is located at tools/spirv-markv API at include/spirv-tools/markv.h At the moment only very basic compression is implemented, mostly varint. Scope of supported SPIR-V opcodes is also limited. Using a simple move-to-front implementation instead of encoding mapped ids. Work in progress: - Does not cover all of SPIR-V - Does not promise compatibility of compression/decompression across different versions of the code.