Robin Voetter
572517376a
spirv: air dbg_var_val and dbg_var_ptr
2023-09-23 12:36:56 -07:00
Robin Voetter
68c7fc5c59
spirv: fix blocks that return no value
2023-09-23 12:36:56 -07:00
Robin Voetter
63512192de
spirv: fix source line numbers
2023-09-23 12:36:56 -07:00
Robin Voetter
075584a4d7
spirv: enable passing tests
2023-09-23 12:36:56 -07:00
Robin Voetter
d9a8c779d8
spirv: constant elem ptr
2023-09-23 12:36:56 -07:00
Robin Voetter
a75300c8d8
spirv: air slice
2023-09-23 12:36:56 -07:00
Robin Voetter
8895025688
spirv: air wrap_errunion_payload
2023-09-23 12:36:56 -07:00
Robin Voetter
4f215a6d28
spirv: air unwrap_errunion_payload
2023-09-23 12:36:56 -07:00
Robin Voetter
48ab11639a
spirv: air is_err, is_non_err
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
5d844faf7c
spirv: air array_elem_val using hack
...
SPIR-V doesn't support true element indexing, so we probably
need to switch over to isByRef like in llvm for this to work
properly. Currently a temporary is used, which at least
seems to work.
2023-09-23 12:36:56 -07:00
Robin Voetter
26c279cca2
spirv: air aggregate_init for array
2023-09-23 12:36:56 -07:00
Robin Voetter
8d49b2ef4e
spirv: air array_to_slice
2023-09-23 12:36:56 -07:00
Robin Voetter
66b1f6c163
spirv: air sub_with_overflow
2023-09-23 12:36:56 -07:00
Robin Voetter
749307dbb2
spirv: air union_init
2023-09-23 12:36:56 -07:00
Robin Voetter
98046b4c3c
spirv: air set_union_tag + improve load()/store()
2023-09-23 12:36:56 -07:00
Robin Voetter
6f55a68964
spirv: air struct_field_ptr for unions
2023-09-23 12:36:56 -07:00
Robin Voetter
5dffbf32bf
spirv: air struct_field_val for unions
2023-09-23 12:36:56 -07:00
Robin Voetter
decdedf97d
spirv: add names to globals and initializers
2023-09-23 12:36:56 -07:00
Robin Voetter
924235a023
spirv: emit OpLogical(Not)Equal for comparing bools
2023-09-23 12:36:56 -07:00
Robin Voetter
c7c0517ac0
spirv: emit OpNot for arithmetic not
2023-09-23 12:36:56 -07:00
Robin Voetter
5141b4e05c
spirv: fix store of undef
2023-09-23 12:36:56 -07:00
Robin Voetter
a86c939857
spirv: also add Float64 by default
2023-09-23 12:36:56 -07:00
Robin Voetter
f16d1603ab
spirv: fix type_map use-after-realloc issues
2023-09-23 12:36:44 -07:00
Robin Voetter
42226fc1b7
spirv: make construct(Struct|Array) use the Function storage class
2023-09-23 12:36:44 -07:00
Robin Voetter
06d9e3b2eb
spirv: always emit unsigned integers
...
This is required for SPIR-V in Kernel mode. The Intel
implementation just didn't care about this fact.
2023-09-23 12:36:44 -07:00
Robin Voetter
18d0909ada
spirv: fixes
2023-09-23 12:36:44 -07:00
Robin Voetter
66036e6000
spirv: remove indirect constant lowering
...
It is stupid and I hate it.
2023-09-23 12:36:44 -07:00
Robin Voetter
b30cd67987
spirv: put global var initializers in functions
2023-09-23 12:36:44 -07:00
Robin Voetter
240f9d740d
spirv: lower union initialization at runtime
2023-09-23 12:36:44 -07:00
Robin Voetter
d06862b759
spirv: lower struct aggregate initialization at runtime
2023-09-23 12:36:44 -07:00
Robin Voetter
001d76a412
spirv: lower array aggregate at runtime
2023-09-23 12:36:44 -07:00
Robin Voetter
ae17831cc0
spirv: lower opt constants
2023-09-23 12:36:44 -07:00
Robin Voetter
3e2553c712
spirv: lower ptr constants
2023-09-23 12:36:44 -07:00
Robin Voetter
cc13864dfb
spirv: lower enum_tag constants
2023-09-23 12:36:44 -07:00
Robin Voetter
aeaaa953a0
spirv: assign type names to (error) unions
2023-09-23 12:36:44 -07:00
Robin Voetter
ece52640eb
spirv: construct error union at runtime
2023-09-23 12:36:44 -07:00
Robin Voetter
ced8a2c3a6
spirv: add type_map to map AIR types to SPIR-V types
...
This will help us both to make the implementation a little
more efficient by caching emission for certain types like structs,
and also allow us to attach extra information about types that we
can use while lowering without performing a search over the entire
type tree for some property.
2023-09-23 12:36:44 -07:00
Robin Voetter
79f7481575
spirv: disable failing tests
2023-09-23 12:36:44 -07:00
kcbanner
9f4649b197
codegen/sema: handle unions with unknown tags in more places
2023-09-23 14:34:01 -04:00
Ryan Liptak
865b2e259b
Fix reportRetryableWin32ResourceError
...
Follow up to https://github.com/ziglang/zig/pull/17069 .
This TODO being left in was a complete oversight.
Before, any 'retryable' error would hit:
error: thread 2920 panic: access of union field 'success' while field 'failure_retryable' is active
Now, it will be reported/handled properly:
C:\Users\Ryan\Programming\Zig\zig\test\standalone\windows_resources\res\zig.rc:1:1: error: FileNotFound
2023-09-23 11:01:02 -07:00
kcbanner
4e9f5f25c8
type: resolve packed union type layouts in bitSizeAdvanced
...
Before this change, packed structs containing packed unions could make it to codegen without having their layout resolved.
2023-09-23 13:22:22 -04:00
kcbanner
f2a24b48e1
sema: rework the comptime representation of comptime unions
...
When the tag is not known, it's set to `.none`. In this case, the value is either an
array of bytes (for extern unions) or an integer (for packed unions).
2023-09-23 13:05:04 -04:00
kcbanner
2fddd767ba
sema: add support for unions in readFromMemory and writeToMemory
2023-09-23 13:04:56 -04:00
Jakub Konka
ab8a5bfe83
elf: implement markLive for ZigModule
2023-09-23 17:17:20 +02:00
Jakub Konka
8960df0c01
elf: encapsulate logic for creating non-alloc shdrs in a helper
2023-09-23 17:17:18 +02:00
Jakub Konka
29ebd96818
elf: improve decl-to-section mapping logic
2023-09-23 17:15:41 +02:00
Jakub Konka
9f05cb318b
elf: put logic for allocating load segments in a helper
2023-09-23 17:14:27 +02:00
Jakub Konka
d9c5a26cfb
elf: add helper for calculating available VM size for phdr
2023-09-23 17:11:20 +02:00
mlugg
ce919ccf45
Sema: do not emit dbg_var_val and dbg_var_ptr instructions for comptime-only types
2023-09-23 14:45:59 +01:00