347 Commits

Author SHA1 Message Date
Veikka Tuominen
a67ea4a4ae cbe: include hash in tuple type name
Different (simple) tuple types do not necessarily print out as different strings.

This is issue would be caused by passing std.fmt.Formatter to std.fmt.format.
2022-11-30 15:14:33 +02:00
Veikka Tuominen
2dcac348e5 cbe: implement packed unions 2022-11-30 15:14:33 +02:00
Veikka Tuominen
1a1a5702ab cbe: correctly handle pointers to zero bit error union payloads 2022-11-30 15:14:33 +02:00
Veikka Tuominen
4def9c4a9b cbe: operand of address of operator must be an lvalue 2022-11-30 15:14:33 +02:00
Veikka Tuominen
6310186d52 cbe: cast pointer switch target to int 2022-11-30 15:14:33 +02:00
Veikka Tuominen
63ae7899ae cbe: ensure test and tagName function names are unique 2022-11-30 15:14:33 +02:00
Andrew Kelley
ceb0a632cf std.mem.Allocator: allow shrink to fail
closes #13535
2022-11-29 23:30:38 -07:00
Andrew Kelley
30eb2a1753
Merge pull request #13627 from Vexu/tuple-decls
Implement tuple type declarations
2022-11-25 18:06:09 -05:00
Andrew Kelley
8fe3d67c79 work around stage1 compile error 2022-11-23 12:21:45 -07:00
Veikka Tuominen
d5da2a6114 Sema: implement tuple declarations 2022-11-23 12:13:39 +02:00
Andrew Kelley
4ec27a4e25 C backend: implement vector reduce and overflow intrinsics 2022-11-22 23:33:58 -07:00
Jimmi Holst Christensen
adc3fafbc0 c backend: Output string literals for array init of bytes 2022-11-19 11:59:33 -05:00
Stevie Hryciw
04f3067a79 run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
Jacob Young
3ae04ed949 cbe: fix identifiers colliding with the short keyword 2022-11-16 01:26:37 -05:00
Jacob Young
a9c005e0e4 cbe: fixed tagged union initializers of a zero-bit field type
Fixes missing braces warnings on gcc 11.3.0.
2022-11-15 23:33:48 -05:00
Jacob Young
b82aec5a15 cbe: fix indexing with a zero-bit element type
Fixes void dereference warnings on gcc 11.3.0.
2022-11-15 23:33:48 -05:00
Jacob Young
b5b507a742 zig.h: match float comparison signatures from compiler rt 2022-11-15 23:33:48 -05:00
Jacob Young
f02b8a9cca cbe: fix padding bits after a bitcast 2022-11-02 23:00:10 -04:00
Jacob Young
085f6fd8f7 cbe: use wrapping for left shifts 2022-11-02 23:00:10 -04:00
Jacob Young
4537c1b8b6 cbe: fix crash rendering union with zero-bit tag 2022-11-02 21:42:40 -04:00
Jacob Young
fa46f9a3d7 cbe: fix extern 2022-11-02 21:42:40 -04:00
Jacob Young
37c104ade0 cbe: ignore comptime fields when generating tuple typedefs
This vastly reduces the amount of deduplication state we need to deal with.
2022-11-02 10:21:05 -04:00
Jacob Young
5f31070b8b cbe: hack around invalid Air
Can be changed to `!inst_ty.hisRuntimeBitsIgnoreComptime()` when the
"result location with inferred type ends up being pointer to comptime_int"
test stops producing Air containing a `bitcast(*comptime_int, ...)`.

See #13410
2022-11-02 10:20:31 -04:00
Jacob Young
d8635af1dc cbe: correctly implement volatile memset 2022-11-01 20:43:54 -04:00
Jacob Young
4d594090b1 cbe: incorrectly implement volatile memset
This will have to be replaced with manual volatile stores.
2022-11-01 20:39:06 -04:00
Jacob Young
09763435a8 cbe: support arrays in more places 2022-11-01 20:39:06 -04:00
Jacob Young
071404ff65 cbe: fix optional access 2022-11-01 20:39:05 -04:00
Jacob Young
8e52be1602 cbe: avoid emitting code for zero-bit field access 2022-11-01 20:38:52 -04:00
Jacob Young
fb8c08d4ac cbe: disambiguate struct typedefs with decl index 2022-11-01 20:38:52 -04:00
Jacob Young
91fe0b80a2 cbe: fix threadlocal 2022-11-01 20:38:51 -04:00
Jacob Young
ff83296256 cbe: fix gcc warnings 2022-10-31 21:01:47 -04:00
Jacob Young
b945d3eb90 cbe: improve support for non-native float types
* Fix _start on aarch64.
 * Add fallbacks when a float type is unsupported.

Fixes #13357
2022-10-31 20:18:15 -04:00
Jacob Young
48a2783969 cbe: implement optional slice representation change 2022-10-29 05:58:41 -04:00
Andrew Kelley
2991e4a454
Merge pull request #13288 from Vexu/opt-slice
Optimize size of optional slices (+ some fixes)
2022-10-27 22:09:17 -04:00
Veikka Tuominen
d03c47bf85 Sema: use runtime_value instead of creating allocs 2022-10-27 21:08:25 -04:00
Veikka Tuominen
dd437ae399 stage2: optimize size of optional slices 2022-10-27 01:31:17 +03:00
Jacob Young
e20d2b3151 cbe: fix floating point builtins 2022-10-25 07:02:06 -04:00
Jacob Young
94425fe46e cbe: improve floating point type support 2022-10-25 05:22:55 -04:00
Jacob Young
6021edd7ce cbe: add support for all float literals types 2022-10-25 05:22:55 -04:00
Jacob Young
54326cc554 cbe: implement field_parent_ptr 2022-10-25 05:11:29 -04:00
Jacob Young
361035fe7a cbe: implement cmp_lt_errors_len 2022-10-25 05:11:29 -04:00
Jacob Young
ab468d57e3 cbe: implement packed structs
Sometimes you have to break a test to make progress :)
2022-10-25 05:11:29 -04:00
Jacob Young
1bab854868 cbe: implement 128-bit and fix smaller integer builtins 2022-10-25 05:11:29 -04:00
Jacob Young
65a48df532 cbe: fix globals that reference functions
Global constant initializers can reference functions, so forward declare
the constants and initialize them later with the function definitions,
which guarantees that they appear after all declarations.
2022-10-25 05:11:29 -04:00
Jacob Young
8b6a3ba74e cbe: fix typedef declaration order 2022-10-25 05:11:29 -04:00
Jacob Young
3d90ee50ff cbe: allow immediate and register asm constraints in naked functions 2022-10-25 05:11:29 -04:00
Jacob Young
4fdac5f1c9 cbe: fix C syntax when rendering initializers 2022-10-25 05:11:29 -04:00
Jacob Young
4765294ca4 cbe: get enough things working to support basic programs
* Enable advanced start support.
 * Enable advanced test_runner support.
 * Zig Language Reference's Hello World now works.
2022-10-25 05:11:29 -04:00
Jacob Young
912b84bbad cbe: fix atomics 2022-10-25 05:11:29 -04:00
Jacob Young
6921b0a850 cbe: implement some float ops 2022-10-25 05:11:29 -04:00