aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv/Assembler.zig
AgeCommit message (Collapse)Author
2025-08-04spirv: define and use extended instruction set opcodesAli Cheraghi
2025-08-03Watch: do not fail when file is removedAli Cheraghi
before this we would get a crash
2025-08-02spirv: refactorAli Cheraghi
2025-07-14spirv: snake-case the specAli Cheraghi
2025-05-21spirv: error when execution mode is set more than onceAli Cheraghi
2025-03-19spirv: Assemble OpTypeRuntimeArray.dan
2025-03-17spirv: lower more types in assemblerAli Cheraghi
2025-03-05Remove uses of deprecated callconv aliasesLinus Groh
2025-02-18spirv: extend supported `c` constraint valuesAli Cheraghi
2025-02-18spirv: ziggify and remove unknown spirv featuresAli Cheraghi
`OpCapability` and `OpExtension` now can also be emitted from inline assembly
2024-11-08spirv: assembler hacky constant placeholdersRobin Voetter
2024-11-08spirv: track global OpVariables properly in assemblerRobin Voetter
Also cleans up the assembler a bit in general.
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-04-06spirv: yeet cacheRobin Voetter
2024-04-06spirv: remove cache usage from assemblerRobin Voetter
2024-04-06spirv: remove cache usage for typesRobin Voetter
2024-04-06spirv: implement `@mulWithOverflow`Ali Chraghi
2024-04-06spirv: OpExtInstImport in assemblerAli Chraghi
2024-03-18spirv: update assembler with new specRobin Voetter
2024-02-05spirv: support enum integer values in AssemblerAli Chraghi
2023-10-23Revert "Revert "Merge pull request #17657 from Snektron/spirv-recursive-ptrs""Robin Voetter
This reverts commit 9f0359d78f9facc38418e32b0e8c1bf6f99f0d26 in an attempt to make the tests pass again. The CI failure from that merge should be unrelated to this commit.
2023-10-22Revert "Merge pull request #17657 from Snektron/spirv-recursive-ptrs"Andrew Kelley
This reverts commit b822e841cda0adabe3fec260ff51c18508f7ee32, reversing changes made to 0c99ba1eab63865592bb084feb271cd4e4b0357e. This caused a CI failure when it landed in master branch.
2023-10-21spirv: self-referential pointers via new fwd_ptr_typeRobin Voetter
Its a little ugly but it works.
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-30spirv: translate remaining typesRobin Voetter
2023-04-09spirv: Do not generate the Alignment attribute on pointers for nowRobin Voetter
It seems that some implementations may have problems with these right now, like Intel and Rusticl. In theory, these attributes should be superficial on the pointer type, as alignment guarantees are also added via the alignment option of the OpLoad and OpStore instructions. Therefore, get rid of them for now.
2023-04-09spirv: deny global OpVariable in inline asmRobin Voetter
This feature requires to be integrated with the mechanism that orders the global variables, and that is not yet in place.
2023-04-09spirv: deny OpEntryPoint in asmRobin Voetter
Kernels should be exported by marking the kernel using callconv(.Kernel) and exporting it as a regular function.
2023-04-09spirv: emit interface variables for entry pointsRobin Voetter
Also actually implement generating the OpEntryPoint instructions.
2023-04-09spirv: introduce type/value representationsRobin Voetter
There are two main ways in which a value can be stored: "Direct", as it will be operated on as an immediate value, and "indirect", as it is stored in memory. Some types need a different representation here: Bools, for example, are opaque in SPIR-V, and so these need to have a different representation in memory. The bool operations are not easily interchangable with integer operations, though, so they need to be OpTypeBool as immediate value.
2023-04-09spirv: make IdResultType and IdRef weak aliases of IdResultRobin Voetter
Previously they were strong aliases, but as these types are used quite intermittendly it resulted in a lot of toRef() calls. Removing them improves readability a bit.
2023-04-09spirv: improve storage efficiency for integer and float typesRobin Voetter
In practice there are only a few variations of these types allowed, so it kind-of makes sense to write them all out. Because the types are hashed this does not actually save all that many bytes in the long run, though. Perhaps some of these types should be pre-registered?
2023-04-09spirv: make Type.Ref strongerRobin Voetter
Making Type.Ref an unbounded enum rather than a simple integer ensures that we don't accidently confuse this token for another type.
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2022-11-23spirv: assemblerRobin Voetter
spirv: introduce SpvModule.Fn to generate function code into spirv: assembler error message setup spirv: runtime spec info spirv: inline assembly tokenizer spirv: inline assembly lhs result/opcode parsing spirv: forgot to fmt spirv: tokenize opcodes and assigned result-ids spirv: operand parsing setup spirv: assembler string literals spirv: assembler integer literals spirv: assembler value enums spirv: assembler bit masks spirv: update assembler to new asm air format spirv: target 1.5 for now Current vulkan sdk version (1.3.204) ships spirv tools targetting 1.5, and so these do not work with binaries targetting 1.6 yet. In the future, this version number should be decided by the target. spirv: store operands in flat arraylist. Instead of having dedicated Operand variants for variadic operands, just flatten them and store them in the normal inst.operands list. This is a little simpler, but is not easily decodable in the operand data representation. spirv: parse variadic assembly operands spirv: improve assembler result-id tokenization spirv: begin instruction processing spirv: only remove decl if it was actually allocated spirv: work around weird miscompilation Seems like there are problems with switch in anonymous struct literals. spirv: begin resolving some types in assembler spirv: improve instruction processing spirv: rename some types + process OpTypeInt spirv: process OpTypeVector spirv: process OpTypeMatrix and OpTypeSampler spirv: add opcode class to spec, remove @exclude'd instructions spirv: process more type instructions spirv: OpTypeFunction spirv: OpTypeOpaque spirv: parse LiteralContextDependentNumber operands spirv: emit assembly instruction into right section spirv: parse OpPhi parameters spirv: inline assembly inputs spirv: also copy air types spirv: inline assembly outputs spirv: spir-v address spaces spirv: basic vector constants/types and shuffle spirv: assembler OpTypeImage spirv: some stuff spirv: remove spirv address spaces for now