Ali Cheraghi
f43f89a705
spirv: snake-case the spec
2025-07-14 15:16:17 +02:00
Ali Cheraghi
1df79ab895
remove spirv cpu arch
2025-06-23 06:03:03 +02:00
Jacob Young
917640810e
Target: pass and use locals by pointer instead of by value
...
This struct is larger than 256 bytes and code that copies it
consistently shows up in profiles of the compiler.
2025-06-19 11:45:06 -04:00
Alex Rønne Petersen
9d534790eb
std.Target: Introduce Cpu convenience functions for feature tests.
...
Before:
* std.Target.arm.featureSetHas(target.cpu.features, .has_v7)
* std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov })
* std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory })
After:
* target.cpu.has(.arm, .has_v7)
* target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov })
* target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
2025-06-05 06:12:00 +02:00
Ali Cheraghi
8fa54eb798
spirv: error when execution mode is set more than once
2025-05-21 13:01:21 +03:30
Ali Cheraghi
dacd70fbe4
spirv: super basic composite int support
2025-05-21 13:01:20 +03:30
Ali Cheraghi
0901328f12
spirv: write error value in an storage buffer
2025-05-21 12:57:40 +03:30
Ali Cheraghi
fca5f3602d
spirv: unroll all vector operations
2025-05-21 12:57:40 +03:30
Ali Cheraghi
ee06b2ce76
spirv: require int8/int16 capabilities
2025-03-18 07:05:50 +03:30
Ali Cheraghi
54c097f50d
spirv: packed struct init + field val access
2025-03-18 07:05:48 +03:30
Ali Cheraghi
50539a2447
spirv/target: arbitrary_precision_integers feature support
2025-03-17 21:56:17 +03:30
Ali Cheraghi
78ad866dd1
target: split addresses and physical_storage_buffer features
2025-03-17 21:56:17 +03:30
Robin Voetter
fe5a78691f
spirv: get rid of function_types cache
...
This deep hash map doesn't work
2025-02-24 20:58:13 +01:00
Ali Cheraghi
a0eec9ce9e
spirv: replace some unreachables with compile errors
2025-02-24 19:12:33 +01:00
Ali Cheraghi
d5e1cb3ea2
spirv: ziggify and remove unknown spirv features
...
`OpCapability` and `OpExtension` now can also be emitted from inline assembly
2025-02-18 18:08:47 +03:30
Ali Cheraghi
85169bbba2
spirv: respect cpu features
2025-02-18 18:07:48 +03:30
Ali Cheraghi
29e46633ce
spirv: cache more types & merge constructX functions
2025-02-18 18:07:48 +03:30
Ali Cheraghi
a1cb9563f6
spirv: Uniform/PushConstant variables
...
- Rename GPU address spaces to match with SPIR-V spec.
- Emit `Block` Decoration for Uniform/PushConstant variables.
- Don't emit `OpTypeForwardPointer` for non-opencl targets.
(there's still a false-positive about recursive structs)
Signed-off-by: Ali Cheraghi <alichraghi@proton.me >
2024-11-01 02:03:33 +03:30
Linus Groh
8588964972
Replace deprecated default initializations with decl literals
2024-09-12 16:01:23 +01:00
Robin Voetter
50a771a11e
spirv: add support for workItemId, workGroupId, workGroupSize
2024-06-16 01:00:13 +02:00
Robin Voetter
a3b1ba82f5
spirv: new vectorization helper
...
The old vectorization helper (WipElementWise) was clunky and a bit
annoying to use, and it wasn't really flexible enough.
This introduces a new vectorization helper, which uses Temporary and
Operation types to deduce a Vectorization to perform the operation
in a reasonably efficient manner. It removes the outer loop
required by WipElementWise so that implementations of AIR instructions
are cleaner. This helps with sanity when we start to introduce support
for composite integers.
airShift, convertToDirect, convertToIndirect, and normalize are initially
implemented using this new method.
2024-06-10 20:32:49 +02:00
Robin Voetter
3e388faecd
spirv: yeet cache
2024-04-06 13:37:40 +02:00
Robin Voetter
97a67762ba
spirv: remove cache usage for types
2024-04-06 13:37:39 +02:00
Robin Voetter
188922a544
spirv: remove cache usage for constants
2024-04-06 13:37:39 +02:00
Robin Voetter
42c7e752e1
spirv: id range helper
...
This allows us to more sanely allocate a continuous
range of result-ids, and avoids a bunch of nasty
casting code in a few places. Its currently not used
very often, but will be useful in the future.
2024-04-06 13:37:37 +02:00
Ali Chraghi
9785014938
spirv: OpExtInstImport in assembler
2024-04-06 08:52:38 +03:30
Ali Chraghi
0f75143c62
spirv: implement @divFloor, @floor and @mod
2024-04-06 08:50:02 +03:30
Robin Voetter
9b18125562
spirv: make generic globals invocation-local
2024-03-18 19:13:50 +01:00
Robin Voetter
e566158acf
spirv: make IdResult an enum
2024-03-18 19:13:49 +01:00
Ali Chraghi
23b7075656
spirv: add capability to compile with x86_64 backend
2024-02-15 17:28:15 +03:30
Ali Chraghi
44c31194e3
spirv: use extended instructions whenever possible
2024-02-15 17:25:44 +03:30
Ali Chraghi
37b0aa600a
spirv: make rusticl the primary testing implementation
2024-02-09 09:27:08 +03:30
Ali Chraghi
b41aad0193
spirv: emit vectors whenever we can
2024-02-05 11:55:14 +03:30
Ali Chraghi
afa7793351
spirv: basic shader support
2024-02-05 11:55:14 +03:30
Robin Voetter
255737ea57
spirv: fix memory leak in SpvModule
2023-11-24 01:11:14 +01:00
Robin Voetter
4bf27da6a6
Revert "Revert "Merge pull request #17657 from Snektron/spirv-recursive-ptrs""
...
This reverts commit 9f0359d78f in an attempt to
make the tests pass again. The CI failure from that merge should be unrelated
to this commit.
2023-10-23 06:27:12 -04:00
Andrew Kelley
9f0359d78f
Revert "Merge pull request #17657 from Snektron/spirv-recursive-ptrs"
...
This reverts commit b822e841cd , reversing
changes made to 0c99ba1eab .
This caused a CI failure when it landed in master branch.
2023-10-22 12:15:31 -07:00
Robin Voetter
6281ad91df
spirv: self-referential pointers via new fwd_ptr_type
...
Its a little ugly but it works.
2023-10-21 17:46:54 +02:00
Robin Voetter
0552e504d0
spirv: work around OpSource parsing issue in llvm-spirv
...
The Khronos SPIRV-LLVM translator does not parse OpSource correctly. This
was causing tests to fail and other mysterious issues.
These are resolved by only generating a single OpSource instruction for now,
which does not have the source file locations also.
See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2188
2023-10-15 17:07:39 +02:00
Robin Voetter
31ad2d72a7
spirv: use CacheString for source_file_names instead of []const u8
2023-10-15 13:59:26 +02:00
Robin Voetter
a3d77bdba9
spirv: get rid of SpvModule arena
2023-10-15 13:59:25 +02:00
Robin Voetter
572517376a
spirv: air dbg_var_val and dbg_var_ptr
2023-09-23 12:36:56 -07:00
Robin Voetter
b845c9d532
spirv: generate module initializer
2023-09-23 12:36:56 -07:00
Robin Voetter
b30cd67987
spirv: put global var initializers in functions
2023-09-23 12:36:44 -07:00
mlugg
f26dda2117
all: migrate code to new cast builtin syntax
...
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-24 16:56:39 -07:00
Eric Joldasov
50339f595a
all: zig fmt and rename "@XToY" to "@YFromX"
...
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me >
2023-06-19 12:34:42 -07:00
Andrew Kelley
275652f620
stage2: move opaque types to InternPool
2023-06-10 20:42:30 -07:00
Andrew Kelley
5e636643d2
stage2: move many Type encodings to InternPool
...
Notably, `vector`.
Additionally, all alternate encodings of `pointer`, `optional`, and
`array`.
2023-06-10 20:42:27 -07:00
Robin Voetter
3c4cc1eedb
spirv: eliminate remaining uses of emitConstant
2023-05-30 19:43:37 +02:00
Robin Voetter
0c41945a01
spirv: rename TypeConstantCache -> Cache
2023-05-30 19:43:37 +02:00