87 Commits

Author SHA1 Message Date
Benjamin Jurk
4b5351bc0d
update deprecated ArrayListUnmanaged usage (#25958) 2025-11-20 14:46:23 -08:00
kbz_8
c603d27f90
Fixing SPIR-V header generator magic + Adding Zig compiler version to SPIR-V OpSource (#25435)
* fixing Zig generator magic in SPIR-V header; adding zig compiler version to SPIR-V OpSource

* Update src/codegen/spirv/Module.zig

Co-authored-by: rpkak <67059904+rpkak@users.noreply.github.com>

---------

Co-authored-by: rpkak <67059904+rpkak@users.noreply.github.com>
2025-11-04 04:40:29 +00:00
GasInfinity
104c272ae5
feat: init x86_16 arch via CBE 2025-10-27 11:19:51 +01:00
Andrew Kelley
749f10af49 std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
Ali Cheraghi
bed99e1ecd
spirv: remove prune_unused ISel 2025-08-09 13:27:04 +03:30
Ali Cheraghi
cd4b03c5ed
spirv: define and use extended instruction set opcodes 2025-08-04 07:05:00 +03:30
Ali Cheraghi
246e1de554
Watch: do not fail when file is removed
before this we would get a crash
2025-08-03 13:16:49 +03:30
Ali Cheraghi
31de2c873f
spirv: refactor 2025-08-02 04:16:01 +03:30
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 9f0359d78f9facc38418e32b0e8c1bf6f99f0d26 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 b822e841cda0adabe3fec260ff51c18508f7ee32, reversing
changes made to 0c99ba1eab63865592bb084feb271cd4e4b0357e.

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