Andrew Kelley
afc5edabe0
Merge pull request #16287 from Snektron/amdgpu-panic-fix
...
Some amdgcn fixes
2023-07-01 22:04:06 -07:00
Andrew Kelley
309aacfc89
Merge pull request #16284 from Snektron/spirv-internpool-fixes
...
SPIR-V InternPool aftermath damage control
2023-07-01 14:21:04 -07:00
Robin Voetter
13c0624f23
llvm: cast optional null ptr representation to generic address space
...
The panic handler expects that this value is represented with the
generic address space, so cast the global to the generic address-
space before caching and returning the value.
2023-07-01 20:28:17 +02:00
Loris Cro
97a1b046ea
autodoc: fix scoring bug when matching full decl name
2023-07-01 17:38:18 +02:00
Emile Badenhorst
35a8e8a06c
Fixed Autodoc rendering of @truncate builtin ( #16263 )
...
* fixed autodoc rendering of @trucate builtin
* Changed to LHS for typeRef
* autodoc: fix typeref for `truncate`
---------
Co-authored-by: Loris Cro <kappaloris@gmail.com >
2023-07-01 16:43:17 +02:00
Robin Voetter
8eee392862
spirv: fix up todos & errors from intern pool changes
...
This replaces the implementation of constant() which one that
is directly based on the intern pool rather than the Zig type tag
too.
2023-07-01 14:27:12 +02:00
Jacob Young
f571438fc0
Unrevert "Sema: preserve extern struct field alignment"
...
This unreverts commit 1a2468abfc .
2023-06-30 23:24:52 -04:00
Jacob Young
2282c27885
Remerge pull request #15995 from mlugg/fix/union-field-ptr-align
...
Sema: copy pointer alignment to union field pointers
This is an unrevert of 43c98dc115 .
2023-06-30 23:23:26 -04:00
mlugg
730f2e0407
Sema: copy pointer alignment to struct field pointers
2023-06-30 23:23:03 -04:00
mlugg
5b594139d9
Sema: copy pointer alignment to union field pointers
...
This implements the semantics as discussed in today's compiler meeting,
where the alignment of pointers to fields of default-layout unions
cannot exceed the field's alignment.
Resolves : #15878
2023-06-30 23:23:01 -04:00
Evan Haas
0a6cd257b9
translate-c: Use @constCast and @volatileCast to remove CV-qualifiers
...
Instead of converting a pointer to an int and then back to a pointer.
2023-06-29 23:36:56 +03:00
Jacob Young
43c98dc115
Revert "Merge pull request #15995 from mlugg/fix/union-field-ptr-align"
...
This reverts commit 40cf3f7ae5 , reversing
changes made to d98147414d .
2023-06-29 00:23:19 -04:00
Jacob Young
1a2468abfc
Revert "Sema: preserve extern struct field alignment"
...
This reverts commit 4620972d08 .
2023-06-29 00:23:19 -04:00
Krzysztof Wolicki
0c1bfe271e
autodoc: Correct a comment about types from std.builtin
2023-06-28 19:03:24 +02:00
Krzysztof Wolicki
2984a75804
autodoc: Try to handle all InternPool.Index types good enough
2023-06-28 19:03:24 +02:00
Alex Kladov
4620972d08
Sema: preserve extern struct field alignment
...
In
extern struct { x: u32, y: u16 }
we actually know that y's alignment is `@alignOf(u32)`, and not just
`@alignOf(u16)`.
closes : #16134
2023-06-28 16:36:32 +02:00
910ad92e0e
ld: support -version-script
...
gettext uses this version and, surely enough, it is supported by lld
2023-06-28 09:32:10 +02:00
Krzysztof Wolicki
7f648c297e
autodoc: Added u0, i0 to correctly indexed types
2023-06-27 19:07:39 +02:00
Luuk de Gram
622c5f3200
Merge pull request #16207 from Luukdegram/wasi-threads
...
WASI: Implement experimental threading support
2023-06-27 18:28:26 +02:00
mlugg
ff37ccd298
Air: store interned values in Air.Inst.Ref
...
Previously, interned values were represented as AIR instructions using
the `interned` tag. Now, the AIR ref directly encodes the InternPool
index. The encoding works as follows:
* If the ref matches one of the static values, it corresponds to the same InternPool index.
* Otherwise, if the MSB is 0, the ref corresponds to an InternPool index.
* Otherwise, if the MSB is 1, the ref corresponds to an AIR instruction index (after removing the MSB).
Note that since most static InternPool indices are low values (the
exceptions being `.none` and `.var_args_param_type`), the first rule is
almost a nop.
2023-06-27 01:21:32 -07:00
Jacob Young
d881d841ed
Sema: use tmp_hack_arena as a temporary solution for lifetime issues
...
All of this code is expected to get rewritten anyway.
Closes #16216
2023-06-27 00:46:31 -07:00
Jacob Young
9343c31c38
Sema: fix @min/@max type resolution with all runtime args
...
Closes #16229
2023-06-26 18:46:25 -07:00
Ali Chraghi
6bd5479306
std.sort.block: add safety check for lessThan return value
2023-06-26 17:50:10 -07:00
mlugg
88284c124a
AstGen: fix result locations for elements of typed array init
...
Resolves : #16226
2023-06-26 16:20:33 -07:00
Luuk de Gram
87b8a0567b
default to single-threaded for WebAssembly
...
When targeting WebAssembly, we default to building a single-threaded build
as threads are still experimental. The user however can enable a multi-
threaded build by specifying '-fno-single-threaded'. It's a compile-error
to enable this flag, but not also enable shared-memory.
2023-06-26 20:00:58 +02:00
Luuk de Gram
062eb6f3c0
Compilation: allow threads for Wasm when shared-memory is enabled
...
When the user enabled the linker-feature 'shared-memory' we do not force
a singlethreaded build. The linker already verifies all other CPU features
required for threads are enabled. This is true for both WASI and
freestanding.
2023-06-26 20:00:57 +02:00
Luuk de Gram
3819371163
wasm-ld: implement --export-memory flag
...
This flag allows the user to force export the memory to the host
environment. This is useful when the memory is imported from the
host but must also be exported. This is (currently) required
to pass the memory validation for runtimes when using threads.
In this future this may become an error instead.
2023-06-26 20:00:57 +02:00
Jacob Young
c036f83fa0
Value: fix incorrect types returned from readFromMemory
2023-06-26 01:30:00 -07:00
jacobly0
cc2daae47e
Merge pull request #15771 from jacobly0/x86_64-behavior
...
x86_64: behavior
2023-06-26 02:45:48 -04:00
Andrew Kelley
40cf3f7ae5
Merge pull request #15995 from mlugg/fix/union-field-ptr-align
...
Sema: copy pointer alignment to union field pointers
2023-06-25 23:06:53 -07:00
Jacob Young
85902115d4
x86_64: cleanup @as invasion
2023-06-25 19:14:26 -04:00
Jacob Young
1a1930ec9b
x86_64: fix test failure
2023-06-25 19:14:03 -04:00
Jacob Young
0e15b6e973
x86_64: fix incorrect encoding table entries
...
This was found by downstream tests.
2023-06-25 19:14:03 -04:00
Jacob Young
b4b1ad475b
x86_64: truncate packed field value
2023-06-25 19:14:03 -04:00
Jacob Young
3f13987a76
x86_64: add missing padding to global unions
2023-06-25 19:14:03 -04:00
Jacob Young
e13aa915b2
x86_64: add error for saturating arithmetic
2023-06-25 19:14:03 -04:00
Jacob Young
5b74278510
x86_64: fix global pointers to packed struct fields
2023-06-25 19:14:03 -04:00
Jacob Young
9d0b8a27b6
x86_64: add unimplemented error for float @rem/@mod
2023-06-25 19:14:03 -04:00
Jacob Young
8d30cb3f22
x86_64: turn f80 operation crashes into errors
2023-06-25 19:14:03 -04:00
Jacob Young
b18a72ec35
x86_64: fix crash emitting a packed undefined u128
2023-06-25 19:14:03 -04:00
Jacob Young
054536f343
x86_64: fix unimplemented type crashes
2023-06-25 19:14:03 -04:00
Jacob Young
614c807702
x86_64: fix packed store crash
2023-06-25 19:14:03 -04:00
Eric Joldasov
0a868dacdd
std.cstr: deprecate namespace
...
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me >
2023-06-25 14:51:03 -07:00
Jakub Konka
852eb272bf
macho: add fixes to __eh_frame parsing emitted by Nix C++ compiler
2023-06-25 14:33:00 -07:00
Andrew Kelley
df389b62de
Merge pull request #16192 from mlugg/builtins-infer-dest-ty-fixes
...
Follow-up to cast builtin result type inference
2023-06-25 12:38:56 -07:00
Jacob Young
b9c4857ed6
AstGen: add source location to certain const initializers
...
Before:
assign_local_bad_coercion.zig:5:1: error: expected type 'u32', found 'u64'
export fn constEntry() u32 {
^~~~~~
assign_local_bad_coercion.zig:11:19: error: expected type 'u32', found 'u64'
var x: u32 = g();
~^~
After:
assign_local_bad_coercion.zig:6:21: error: expected type 'u32', found 'u64'
const x: u32 = g();
~^~
assign_local_bad_coercion.zig:11:19: error: expected type 'u32', found 'u64'
var x: u32 = g();
~^~
2023-06-25 12:00:48 -07:00
mlugg
80e493cb36
Sema: copy pointer alignment to struct field pointers
2023-06-25 14:13:52 +01:00
mlugg
2611d97fb0
Sema: copy pointer alignment to union field pointers
...
This implements the semantics as discussed in today's compiler meeting,
where the alignment of pointers to fields of default-layout unions
cannot exceed the field's alignment.
Resolves : #15878
2023-06-25 14:05:18 +01:00
mlugg
569ae762e1
compiler: allow cast builtins to coerce result to error union or optional
...
Also improves some error messages
2023-06-25 13:28:32 +01:00
mlugg
8afadee45a
AstGen: use usize as result type of for loop range operands
2023-06-25 13:28:31 +01:00