Dejan Mircevski [Fri, 9 Oct 2015 15:06:10 +0000 (11:06 -0400)]
Negative test for SourceLanguage.
Also, use "class" instead of "type" in the coverage CSV.
David Neto [Thu, 8 Oct 2015 19:20:25 +0000 (15:20 -0400)]
Accept long UTF-8 Literal Strings
David Neto [Tue, 6 Oct 2015 20:22:00 +0000 (16:22 -0400)]
Support strings with up to 65535 chars, and null.
Move the definition of spv_instruction_t to an internal
header file, since it now depends on C++ and is not
used by the external interface.
Use a std::vector<uint32_t> in spv_instruction_t
instead of a fixed size array.
David Neto [Wed, 7 Oct 2015 14:11:39 +0000 (10:11 -0400)]
Remove stale TODO. Fix use of OpCode to 'instruction'
David Neto [Tue, 6 Oct 2015 18:35:43 +0000 (14:35 -0400)]
Update readme: capabilities are up to date
David Neto [Fri, 2 Oct 2015 20:09:43 +0000 (16:09 -0400)]
Define spv_capability_mask_t for readability.
David Neto [Mon, 5 Oct 2015 13:55:23 +0000 (09:55 -0400)]
Test capabilities for enums sections 3.21-3.31
Fixes dependencies among capabilities. (The table should store
the mask of capabilites, not the capability enum.)
Remove the old spot check test for capabilities of enums.
David Neto [Fri, 2 Oct 2015 21:10:10 +0000 (17:10 -0400)]
Fix capabilities for enums in Rev32, sec 3.3-3.20
David Neto [Thu, 1 Oct 2015 20:58:17 +0000 (16:58 -0400)]
Move AutoText and EnumCase into spvtest namespace
Also fix using declaration order.
Also put a few tests into the anonymous namespace.
David Neto [Thu, 1 Oct 2015 21:28:56 +0000 (17:28 -0400)]
Update readme: Finish assembler !<integer> support
Also internal cleanups and additional tests.
Dejan Mircevski [Fri, 2 Oct 2015 05:35:19 +0000 (01:35 -0400)]
Test operand-table capabilities.
David Neto [Thu, 1 Oct 2015 20:43:08 +0000 (16:43 -0400)]
Add TODO for fixing endianness testing.
Currently it uses a union, a write to one field, and read from
another of a different type.
Moves the endianness-determining macro close to the variable
it references.
David Neto [Thu, 1 Oct 2015 17:46:38 +0000 (13:46 -0400)]
Test SPV_CAPABILITY_AS_MASK macro
David Neto [Thu, 1 Oct 2015 15:24:11 +0000 (11:24 -0400)]
Use 3-arg MakeInstruction to reduce logic in tests
Avoids open-coded vector inserts and two variables in various
tests. Should improve readability.
Dejan Mircevski [Thu, 1 Oct 2015 13:43:05 +0000 (09:43 -0400)]
Test opcode table capability entries.
Dejan Mircevski [Wed, 30 Sep 2015 20:42:34 +0000 (16:42 -0400)]
Make capabilities a bitfield in opcode/operand tables.
Dejan Mircevski [Wed, 30 Sep 2015 14:35:26 +0000 (10:35 -0400)]
Create spv_language_capabilities_t and widen capabilities fields.
If this is acceptable, I'll do a wholesale switch of operand and opcode
definitions to capability bitfields.
David Neto [Wed, 30 Sep 2015 15:44:34 +0000 (11:44 -0400)]
Add assembler test for OpEnqueueKernel.
Adds a form of spvtest::MakeInstruction which takes two vectors
of operands. That leads to simpler test code.
We can clean up some other test code, in another CL.
Dejan Mircevski [Wed, 30 Sep 2015 13:49:00 +0000 (09:49 -0400)]
Clarify !<integer> parsing.
Implement some outstanding feedback from
Ic29c5a4a8178a62a5a1acad13d02f19cc1307097:
- use "token" instead of "word" when referring to assembly text
- specify how the numbers are parsed
Add a test for negative numbers.
Dejan Mircevski [Tue, 29 Sep 2015 21:58:37 +0000 (17:58 -0400)]
Try to fix the Android build.
Dejan Mircevski [Tue, 29 Sep 2015 21:07:21 +0000 (17:07 -0400)]
Detect overflow in !<integer>.
David Neto [Tue, 29 Sep 2015 18:22:02 +0000 (14:22 -0400)]
Add a .csv showing test coverage for operand class
It shows which spv::OperandClass values are used in
the syntax table in source/opcode.inc, and what tests
exercise those operand types.
Dejan Mircevski [Tue, 29 Sep 2015 14:38:18 +0000 (10:38 -0400)]
Simplify (and test) the alternate-parsing pattern.
David Neto [Mon, 28 Sep 2015 19:02:21 +0000 (15:02 -0400)]
Assembly test for OpSwitch
Removes old weak and fragile tests for OpSwitch.
Adds spvtest::TextToBinaryTest::CompileWithFormatFailure
David Neto [Mon, 28 Sep 2015 20:00:42 +0000 (16:00 -0400)]
Assembly failure cases for OpMemoryBarrier
Fully tests OperandMemorySemantics from the syntax table.
David Neto [Mon, 28 Sep 2015 20:14:28 +0000 (16:14 -0400)]
Assembler failing cases for OpCapability
David Neto [Mon, 28 Sep 2015 19:33:49 +0000 (15:33 -0400)]
Document non-use of certain operand types
Operand class enum values not used in the syntax table:
- Image channel order: only used to describe a return value
- Image channel type: only used to describe a return value
- "Image operands": used to make a section in the spec
to describe values used to construct an optional image id,
but does not itself appear in the syntax table.
Removes some TODOs from opcode.cpp.
Andrew Woloszyn [Thu, 24 Sep 2015 14:26:51 +0000 (10:26 -0400)]
Refactored dynamic and static state out of text processing.
This reduces the number of arguments required to be passed
to every single function. This is in preparation for adding
id tracking.
Dejan Mircevski [Tue, 29 Sep 2015 14:56:32 +0000 (10:56 -0400)]
Run clang-format.
Dejan Mircevski [Mon, 28 Sep 2015 21:04:39 +0000 (17:04 -0400)]
Implement alternate-parsing mode for !<integer>.
David Neto [Mon, 28 Sep 2015 20:47:21 +0000 (16:47 -0400)]
Readme: capabilities for instructions are ok
Capabilities for enumerants may be out of date.
Andrew Woloszyn [Mon, 28 Sep 2015 15:09:23 +0000 (11:09 -0400)]
Updated syntax.md to remove references to % numerical ids.
Dejan Mircevski [Mon, 28 Sep 2015 19:13:15 +0000 (15:13 -0400)]
Remove isIdType(), which is now dead code.
David Neto [Mon, 28 Sep 2015 18:40:10 +0000 (14:40 -0400)]
Test bad 2nd target to OpGroupMemberDecorate
David Neto [Mon, 28 Sep 2015 18:09:29 +0000 (14:09 -0400)]
Assembly test for OpGroupMemberDecorate
Provides test coverage for OperandVariableIdLiteral
from the syntax table in the file 'opcode.inc'.
Dejan Mircevski [Mon, 28 Sep 2015 15:51:32 +0000 (11:51 -0400)]
Uncomment some !<integer> tests.
David Neto [Mon, 28 Sep 2015 15:37:57 +0000 (11:37 -0400)]
Cleanup: Use EnumCase in OpDecorateSimpleTest
David Neto [Mon, 28 Sep 2015 15:22:23 +0000 (11:22 -0400)]
Cleanup: Use EnumCase for ExecutionMode test
David Neto [Mon, 28 Sep 2015 14:56:16 +0000 (10:56 -0400)]
Assembler test for optional operands of OpSource
These are the first tests to cover OperandOptionalId
and OperandOptionalLiteralString from the grammar in
opcode.inc
David Neto [Fri, 25 Sep 2015 18:23:29 +0000 (14:23 -0400)]
Remove SPV_OPERAND_TYPE_LITERAL
All uses of OptionalLiteral by the SPIR-V spec are used
for literal numbers.
Also rename:
- SPV_OPERAND_TYPE_OPTIONAL_LITERAL to
SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER.
- SPV_OPERAND_TYPE_VARIABLE_LITERAL to
SPV_OPERAND_TYPE_VARIABLE_LITERAL_NUMBER.
- SPV_OPERAND_TYPE_VARIABLE_LITERAL_ID to
SPV_OPERAND_TYPE_VARIABLE_LITERAL_NUMBER_ID.
- SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL to
SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_NUMBER.
- SPV_OPERAND_TYPE_LITERAL_IN_OPTIONAL_TUPLE to
SPV_OPERAND_TYPE_LITERAL_NUMBER_IN_OPTIONAL_TUPLE.
David Neto [Fri, 25 Sep 2015 18:52:17 +0000 (14:52 -0400)]
Dissasembler test showing reordering of masks
David Neto [Fri, 25 Sep 2015 17:56:09 +0000 (13:56 -0400)]
Execution scope, memory semantics operands are IDs
They shouldn't be parsed or printed as masks.
David Neto [Fri, 25 Sep 2015 16:43:37 +0000 (12:43 -0400)]
Disassembler support for mask expressions.
David Neto [Thu, 24 Sep 2015 14:47:08 +0000 (10:47 -0400)]
Update Readme: Support Rev32; IDs never alias
David Neto [Fri, 25 Sep 2015 14:30:27 +0000 (10:30 -0400)]
Memory semantics Relaxed is a synonym for None
The disassembler should prefer to print Relaxed,
I think. (Untested.)
David Neto [Thu, 24 Sep 2015 21:11:15 +0000 (17:11 -0400)]
Assembler tests for remaining Debug instructions
OpString, OpName, OpMemberName, OpLine, OpNoLine,
OpSourceContinued.
David Neto [Thu, 24 Sep 2015 19:45:59 +0000 (15:45 -0400)]
Update core instruction syntax to Rev32
Many instructions added and a few changed structure.
Workarounds:
- Some operands can be enabled by either one of two
capabilities. The spv_operand_desc_t does not handle that
now. For now just select the first one.
Fixes to tests:
- OpLoopMerge now takes a mandatory continue target.
- OpTypePipe drops the type argument. Pipes are opaque.
- OpLine no longer takes a target ID argument.
The ID validator was fixed the OpLine and OpTypePipe
changes. Those were the only ID validator tests affected.
The patch to the spec doc generator was updated so it handles
the two-capability case, even if in an hacky way.
David Neto [Thu, 24 Sep 2015 21:10:35 +0000 (17:10 -0400)]
Assembler test TODOs for image instructions.
David Neto [Wed, 23 Sep 2015 18:59:27 +0000 (14:59 -0400)]
Assembler supports new decorations in Rev32
They are:
- NoContraction
- InputTargetIndex
- Alignment
Lei Zhang [Wed, 23 Sep 2015 21:09:01 +0000 (17:09 -0400)]
Rev32: Remove DepthAny and mark Xfb as requiring TransformFeedback.
David Neto [Wed, 23 Sep 2015 20:04:24 +0000 (16:04 -0400)]
Fix Capability dependencies on capabilities, Rev32
David Neto [Wed, 23 Sep 2015 19:44:02 +0000 (15:44 -0400)]
Assembler support for new capabilities in Rev32
David Neto [Wed, 23 Sep 2015 18:32:37 +0000 (14:32 -0400)]
Support Image operand MinLod
David Neto [Wed, 23 Sep 2015 19:35:27 +0000 (15:35 -0400)]
Assembler supports new builtins in Rev32
They are VertexIndex and InstanceIndex.
David Neto [Wed, 23 Sep 2015 19:38:59 +0000 (15:38 -0400)]
Assembler support for Nontemporal memory access
Lei Zhang [Wed, 23 Sep 2015 19:42:18 +0000 (15:42 -0400)]
Define two macros to simplify code for ExecutionMode operands.
David Neto [Wed, 23 Sep 2015 20:57:05 +0000 (16:57 -0400)]
Fix permissions on test/TextToBinary.Barrier.cpp
David Neto [Wed, 23 Sep 2015 14:30:06 +0000 (10:30 -0400)]
Support Dim InputTarget
David Neto [Wed, 23 Sep 2015 14:19:57 +0000 (10:19 -0400)]
Support StorageClass PushConstant
David Neto [Wed, 23 Sep 2015 14:16:39 +0000 (10:16 -0400)]
Support ExecutionMode IndependentForwardProgress
David Neto [Wed, 23 Sep 2015 14:07:17 +0000 (10:07 -0400)]
Assembler test for Memory Semantics enum
Enables mask expression parsing for Memory Semantics arguments,
e.g. on OpMemoryBarrier.
Andrew Woloszyn [Tue, 22 Sep 2015 19:50:33 +0000 (15:50 -0400)]
All values now represent symbolic names instead of mixed with numeric.
Also removed un-necessary heap-allocation of spv_named_id_table.
This removed the necessity to expose a function to create/destroy it
and simplified the interface.
Lei Zhang [Wed, 23 Sep 2015 15:11:05 +0000 (11:11 -0400)]
Remove executable file mode bits on source files.
David Neto [Tue, 22 Sep 2015 20:23:06 +0000 (16:23 -0400)]
Update to Rev32 headers. Part 1.
Just enough fixes to code make it build and pass tests.
Core changes:
- Fix spelling for: NoPerspective, NonWritable, NonReadable,
- Remove NoStaticUse, RelaxedMask
GLSL changes:
- Fixed spelling for: InverseSqrt, FaceForward, MatrixInverse,
SmoothStep, FindILsb, FindSMsb, FindUMsb
- Replace Mix with IMix and FMix
- Remove AddCarry, SubBorrow, MulExtended
Replace header OpenCLLib.h with OpenCL.std.h
TODO:
- Regenerate the core instruction syntax table (source/opcode.inc)
- Add test coverage for new enums and instructions.
Andrew Woloszyn [Tue, 22 Sep 2015 19:49:27 +0000 (15:49 -0400)]
Switched VecTypeHint to take a LiteralNumber instead of an ID
Andrew Woloszyn [Tue, 22 Sep 2015 15:54:48 +0000 (11:54 -0400)]
Removed duplicate code due to what looks like a merge issue
David Neto [Mon, 21 Sep 2015 21:16:45 +0000 (17:16 -0400)]
Cleanups for EnumCase
Make it a class, since it has non-trivial behaviour for converting
the enumerated value to a uint32_t value. (Comply with style guide.)
Merge EnumCaseWithOperands into EnumCase.
David Neto [Mon, 21 Sep 2015 15:36:44 +0000 (11:36 -0400)]
Put the test fixture into spvtest namespace.
All test utility code should go into the spvtest namespace.
Andrew Woloszyn [Fri, 18 Sep 2015 17:41:49 +0000 (13:41 -0400)]
Fix MSVC build for boolean opeartions on enums.
David Neto [Fri, 18 Sep 2015 17:34:58 +0000 (13:34 -0400)]
Fix the Supported Features section.
David Neto [Fri, 18 Sep 2015 15:34:25 +0000 (11:34 -0400)]
Readme: Assembler supports all of Rev31, for 32-bit code
Also say that we have fixed problems building with MSVC 2013.
Also document other recent changes.
David Neto [Fri, 18 Sep 2015 16:08:36 +0000 (12:08 -0400)]
Put const back on const char* in test case structs
Andrew Woloszyn [Fri, 18 Sep 2015 15:50:54 +0000 (11:50 -0400)]
A bunch of small fixes to build in MSVC2013.
Fixed an issue where some of the tests were testing
the wrong word with the wrong operation. (| != ||).
Coalesced the many versions of EnumCase into one.
Added a get_value() to EnumCase to convert to a uint32_t.
Replaces ASSERT_TRUE(pointer), with ASSERT_NE(nullptr, pointer),
so that we do not do implicit pointer->bool conversion.
Removed const from some test structs since gtest needs to be
able to swap them.
David Neto [Fri, 18 Sep 2015 15:19:18 +0000 (11:19 -0400)]
Assembler support for image operands from Rev31
Rev32 and later add many more image operands, and
rearrange their values.
Lei Zhang [Thu, 17 Sep 2015 22:24:53 +0000 (18:24 -0400)]
Let EncodeAndDecodeSuccessfully remove preamble comments.
Lei Zhang [Tue, 15 Sep 2015 17:36:21 +0000 (13:36 -0400)]
Clean up code for encoding literal operands.
David Neto [Thu, 17 Sep 2015 21:39:45 +0000 (17:39 -0400)]
Remove SPV_OPERAND_TYPE_VARIABLE_MEMORY_ACCESS
If a memory mask operand is present, it is a mask. The mask appears
only once, so just use SPV_OPERAND_TYPE_OPTIONAL_MEMORY_MASK.
The "variable literals" aspect comes into play as follows: if the
Aligned bit is set in the mask, then the parser will be made to
expect the alignment value as a literal number operand that follows
the mask. That is done through mask operand expansion.
David Neto [Thu, 17 Sep 2015 21:06:10 +0000 (17:06 -0400)]
Assembler: mask expressions where 1 bits imply operands
Properly support a memory access mask with a combination
of bits, including the Aligned bit. When the Aligned bit is
set, the parser should expect an alignment value literal operand.
David Neto [Thu, 17 Sep 2015 18:02:11 +0000 (14:02 -0400)]
Document the syntax of mask expressions
David Neto [Wed, 16 Sep 2015 22:32:54 +0000 (18:32 -0400)]
Assembler support for simple mask expressions
For example, support combining mask enums with "|",
such as "NotNaN|AllowRecip" for the fast math mode.
This is supported for mask values that don't modify the
expected operand pattern:
- fast math mode
- function control
- loop control
- selection control
TODO: disassembler support to print them as mask expressions.
David Neto [Wed, 16 Sep 2015 20:42:56 +0000 (16:42 -0400)]
Generalize spvOperandTableNameLookup to take string length.
This is preparation for parsing mask expressions.
Dejan Mircevski [Fri, 11 Sep 2015 19:03:54 +0000 (15:03 -0400)]
Forbid !<integer> preceding or succeeding '='.
David Neto [Wed, 16 Sep 2015 19:56:43 +0000 (15:56 -0400)]
Assembler test for Dim, ImageFormat enums.
Adds SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT, and the
translation tables for its values from the spv::ImageFormat values.
David Neto [Wed, 16 Sep 2015 20:16:22 +0000 (16:16 -0400)]
Document inability to use names from 3.12, 1.13
You can't use names from 3.12 Image Channel Order and
3.13 Image Channel Data Type since in the intstruction grammar,
they are only used as return values, but never named arguments
to instructions.
David Neto [Wed, 16 Sep 2015 19:29:02 +0000 (15:29 -0400)]
Use generalized EnumCase in AccessQualifier assembly tests
This is in preparation for coming tests that will also
use the templated EnumCase instead of making their
own structs.
Also reformat AccessQualifier test.
Dejan Mircevski [Fri, 11 Sep 2015 20:34:49 +0000 (16:34 -0400)]
Handle IDs among !<integer> operands.
David Neto [Tue, 15 Sep 2015 14:27:22 +0000 (10:27 -0400)]
Assembler test for SamplerAddressingMode, SamplerFilterMode
Uses OpConstantSampler instruction.
David Neto [Tue, 15 Sep 2015 20:41:38 +0000 (16:41 -0400)]
Assembler test for Storage Class enum values
This covers the storage classes in SPIR-V Rev31. Rev32 has more.
Lei Zhang [Mon, 14 Sep 2015 19:22:23 +0000 (15:22 -0400)]
Support multiple word literal numbers as constants.
Add a new operand type SPV_OPERAND_TYPE_MULTIWORD_LITERAL_NUMBER
to represent those operands that can expand into multiple words.
Now only OpConstant and OpSpecConstant have such kind of operand.
David Neto [Tue, 15 Sep 2015 13:48:10 +0000 (09:48 -0400)]
Update CHANGES and Future Work
David Neto [Mon, 14 Sep 2015 21:07:11 +0000 (17:07 -0400)]
Assembler test for ExecutionScope, with OpGroupIAdd
Use spvOperandTypeStr to generalize the error message
for failure to parse an ID.
Extend spvOperandTypeStr to cover SPV_OPERAND_TYPE_EXECUTION_SCOPE.
David Neto [Sat, 12 Sep 2015 02:35:04 +0000 (22:35 -0400)]
Assembler test for OpTypePipe
Covers all AccessQualifier enums.
In Rev32, OpTypePipe no longer has a type argument.
Added TODOs for this.
David Neto [Mon, 14 Sep 2015 19:08:48 +0000 (15:08 -0400)]
Assembler test for single-valued Memory Access flag.
David Neto [Mon, 14 Sep 2015 18:50:37 +0000 (14:50 -0400)]
Assembler test for single-valued FunctionControl mask
Fixed name of "Inline" enumerant.
Support for combinations of function control masks should come later.
Lei Zhang [Mon, 14 Sep 2015 19:26:12 +0000 (15:26 -0400)]
Remove useless variable.
David Neto [Mon, 14 Sep 2015 18:33:08 +0000 (14:33 -0400)]
Assembler test for single-valued LoopControl mask
Support for combining masks should come later.
David Neto [Mon, 14 Sep 2015 18:28:33 +0000 (14:28 -0400)]
Assembler test for single-valued SelectionControl mask
Support for combining masks should come later.
David Neto [Mon, 14 Sep 2015 17:56:45 +0000 (13:56 -0400)]
Clarify the syntax. Some named enumerants are unusable
You can't use a named enumerant if it's only meaningful
in an operand supplied as an ID to a target instruction.
The place where you'd use the name is something like an
OpConstant, but there's not enough context to bring those
names into scope, unless you're willing to tolerate
potential collisions.
Occurs for the names in:
- 3.25 Memory Semantics
- 3.27 Scope ID
- 3.29 Kernel Enqueue Flags
- 3.30 Kernel Profiling Info
Lei Zhang [Mon, 14 Sep 2015 16:26:15 +0000 (12:26 -0400)]
Simplify code for handling literals in disassembler.
David Neto [Mon, 14 Sep 2015 17:05:53 +0000 (13:05 -0400)]
Move the syntax description into its own file