Commit graph

2054 commits

Author SHA1 Message Date
Robin Voetter
631d1b63a8
spirv: fix shuffle properly 2024-02-04 19:09:32 +01:00
Robin Voetter
9641d2ebdb
spirv: vectorize max, min 2024-02-04 19:09:31 +01:00
Robin Voetter
9f0227a326
spirv: vectorize int_cast, trunc 2024-02-04 19:09:31 +01:00
Robin Voetter
408c117246
spirv: air is_(non_)null_ptr, optional_payload_ptr 2024-02-04 19:09:30 +01:00
Robin Voetter
7dfd403da1
spirv: air mul_add 2024-02-04 19:09:30 +01:00
Robin Voetter
345d6e280d
spirv: air int_from_bool 2024-02-04 19:09:29 +01:00
Robin Voetter
b67d983abd
spirv: vectorize add/sub overflow 2024-02-04 19:09:27 +01:00
Robin Voetter
761594e226
spirv: reduce, reduce_optimized 2024-02-04 19:09:27 +01:00
Robin Voetter
2f815853dc
spirv: shlWithOverflow 2024-02-04 19:09:26 +01:00
Robin Voetter
15cf5f88c1
spirv: vectors for air not 2024-02-04 19:09:25 +01:00
Robin Voetter
cb9e20da00
spirv: element-wise operation helper 2024-02-04 19:09:00 +01:00
Robin Voetter
747f4ae3f5
spirv: sh[rl](_exact)? 2024-02-04 19:08:59 +01:00
Pavel Verigo
a2ad8517ee
Sema: fix union init with zero size field 2024-01-30 12:20:23 +02:00
Veikka Tuominen
7d75c3d3b8 llvm: ensure returned undef is 0xaa bytes when runtime safety is enabled
Closes #13178
2024-01-29 17:35:07 -08:00
SuperAuguste
a479fd3132 Fix some comptime packed struct issues
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2024-01-29 13:09:17 -08:00
Andrew Kelley
f4f8036ec0
Merge pull request #18729 from Vexu/fixes
Fix some generic{Reader,Writer} related issues
2024-01-29 13:07:37 -08:00
Veikka Tuominen
f93a36c091 llvm: revert bad array access optimization
Closes #18723
2024-01-29 08:43:27 -08:00
Veikka Tuominen
78e982f7c3 llvm: fix alignment of array ptr when bitcasting vector
Closes #17996
2024-01-29 13:51:57 +02:00
Veikka Tuominen
281b2695c4 Value: expand canMutateComptimeVarState
Closes #17761
2024-01-29 13:48:45 +02:00
Veikka Tuominen
f782202910 Sema: do not emit @errorCast safety check when dest is adhoc inferred error set
Closes #17354
2024-01-29 13:48:45 +02:00
Meghan Denny
8a0429e885
test: add behavior coverage for global setter in function liveness 2024-01-26 15:26:37 +02:00
Veikka Tuominen
2e7d28dd0d Sema: replace uses of toUnsignedInt with toUnsignedIntAdvanced
During semantic analysis the value may be an unresolved lazy value
which makes using `toUnsignedInt` invalid.

Add assertions to detect similar issues in the future.

Closes #18624
2024-01-20 12:21:05 -08:00
Meghan Denny
46d592e485 do not enforce function parameters to be marked comptime if only called at comptime 2024-01-19 15:31:18 -08:00
David Rubin
100efcf8d3
return optional state to zirPtrCastNoDest 2024-01-19 21:25:05 +02:00
Andrew Kelley
ca8c6dd4d6
Merge pull request #18569 from dweiller/17944-followup
17944 followup
2024-01-15 22:59:33 -08:00
dweiller
a219c9faaa test/behavior: fix test type check for multi-ptr slice
The original test was checking the types of irrelevant slices, the test
is for slicing of multi-pointers _without_ an end value, but the types
of slices with an end value were being checked.
2024-01-15 20:55:01 +11:00
dweiller
8108c9f4d2 test/behavior: replace all 'comptime expect' with 'comptime assert' 2024-01-15 20:55:01 +11:00
Jacob Young
03ed3f56cf Sema: fix @extern decls
Closes #18550
2024-01-15 07:39:05 +01:00
dweiller
8afafa717f sema: allow slicing *T with comptime known [0..1] 2024-01-14 17:26:45 -08:00
Andrew Kelley
30688c341b LLVM: fix lowering of extern anyopaque
closes #18461
2024-01-11 01:00:49 -08:00
dweiller
69ab687156 test: add tests for switch_block_err_union 2024-01-09 14:42:12 +11:00
Andrew Kelley
3176fdc0b9
Merge pull request #18470 from castholm/typeInfo-sentinels
Make `@typeInfo` return null-terminated strings
2024-01-07 22:28:24 -08:00
Veikka Tuominen
faeb0ef032 llvm: optional slices cannot be passed in parts when they allowzero
Closes #18428
2024-01-08 06:57:06 +02:00
Carl Åstholm
92458094c8 Fix failing type reifications 2024-01-07 16:27:50 +01:00
Veikka Tuominen
804cee3b93 categorize behavior/bugs/<issueno>.zig tests 2024-01-06 16:49:41 -08:00
Carl Åstholm
501a2350ab sema: Prevent reifying non-empty union with empty tag type 2024-01-04 22:38:31 +02:00
Andrew Kelley
9a16085093
Merge pull request #18376 from amp-59/shl_exact_comptime_int_to_shl
Sema: Updated `zirShl` to compute `shl_exact` with `comptime_int` LHS using `shl`
2024-01-04 04:19:26 -08:00
Andrew Kelley
fc79b22a98
Merge pull request #17431 from castholm/expectEqual
Update `std.testing.expectEqual` and friends to use peer type resolution
2024-01-03 23:55:59 -08:00
Andrew Kelley
52ebba6bdf @shlExact fixups
* Add clarification in langref
* move test case to behavior tests
2024-01-04 00:44:44 -07:00
Andrew Kelley
a9337bef2d
Merge pull request #18431 from jacobly0/cbe-extern
cbe: fix non-msvc externs and exports
2024-01-03 12:57:01 -08:00
Carl Åstholm
85869f8225 Correct expected/actual parameter order of some assertions 2024-01-03 21:20:49 +01:00
Carl Åstholm
d7b36503ca Remove some @as coercions from assertions
These are some spurious fixes to help illustrate the improved ergonomics of the `expectEqual` change. It is by no means complete.
2024-01-03 21:20:48 +01:00
Carl Åstholm
4c1da0912a Fix compile errors from the expectEqual change 2024-01-03 21:20:48 +01:00
xdBronch
d03649ec2f add missing resolveStructFieldInits 2024-01-03 11:05:25 +02:00
Jacob Young
047d6d996e cbe: fix non-msvc externs and exports
Closes #17817
2024-01-03 02:52:25 -05:00
Jacob Young
98b633ff17 Reapply "Merge pull request #17824 from kcbanner/fixup_msvc_fmax"
This reverts commit 2b58978360.
2024-01-03 02:41:21 -05:00
Andrew Kelley
289ae45c1b
Merge pull request #18160 from ziglang/std-build-module
Move many settings from being per-Compilation to being per-Module
2024-01-02 14:11:27 -08:00
arbrk1
024540de15
Liveness: fix branch operands becoming aliased 2024-01-02 12:08:26 +02:00
Andrew Kelley
142471fcc4 zig build system: change target, compilation, and module APIs
Introduce the concept of "target query" and "resolved target". A target
query is what the user specifies, with some things left to default. A
resolved target has the default things discovered and populated.
In the future, std.zig.CrossTarget will be rename to std.Target.Query.
Introduces `std.Build.resolveTargetQuery` to get from one to the other.

The concept of `main_mod_path` is gone, no longer supported. You have to
put the root source file at the module root now.

* remove deprecated API
* update build.zig for the breaking API changes in this branch
* move std.Build.Step.Compile.BuildId to std.zig.BuildId
* add more options to std.Build.ExecutableOptions, std.Build.ObjectOptions,
  std.Build.SharedLibraryOptions, std.Build.StaticLibraryOptions, and
  std.Build.TestOptions.
* remove `std.Build.constructCMacro`. There is no use for this API.
* deprecate `std.Build.Step.Compile.defineCMacro`. Instead,
  `std.Build.Module.addCMacro` is provided.
  - remove `std.Build.Step.Compile.defineCMacroRaw`.
* deprecate `std.Build.Step.Compile.linkFrameworkNeeded`
  - use `std.Build.Module.linkFramework`
* deprecate `std.Build.Step.Compile.linkFrameworkWeak`
  - use `std.Build.Module.linkFramework`
* move more logic into `std.Build.Module`
* allow `target` and `optimize` to be `null` when creating a Module.
  Along with other fields, those unspecified options will be inherited
  from parent `Module` when inserted into an import table.
* the `target` field of `addExecutable` is now required. pass `b.host`
  to get the host target.
2024-01-01 17:51:18 -07:00
Andrew Kelley
2b58978360 Revert "Merge pull request #17824 from kcbanner/fixup_msvc_fmax"
This reverts commit 7161ed79c4, reversing
changes made to 3f2a65594e.

Unfortunately, this sat in the PR queue too long and the merge broke the
zig1.wasm bootstrap process.
2024-01-01 17:49:57 -07:00