Commit Graph

5034 Commits

Author SHA1 Message Date
Andrew Kelley ef761c2cbc Merge pull request #13360 from topolarity/comptime-bool-binops
Make `x and false` and `x or true` comptime-known
2022-10-30 22:11:44 -04:00
Jacob Young a77d89afe3 behavior: enable fixed cbe tests 2022-10-30 15:38:50 -04:00
Cody Tapscott ca332f57f7 stage2: Make x and false/x or true comptime-known
Same as preceding change, but for stage2.
2022-10-30 12:38:08 -07:00
Andrew Kelley 17df35025b CI: disable failing C backend test
See #13357
2022-10-30 03:21:18 -07:00
Andrew Kelley 5f5a20ebaf Merge pull request #13093 from jacobly0/backend-fixes
C backend fixes
2022-10-29 23:06:59 -04:00
Andrew Kelley 28dc208f65 Merge pull request #13082 from g-w1/unnamed-decls-and-relocs-p9
Plan9: Fix The Backend
2022-10-29 17:45:00 -04:00
Jacob Young 48a2783969 cbe: implement optional slice representation change 2022-10-29 05:58:41 -04:00
Andrew Kelley c36eb4ede9 Merge pull request #13221 from topolarity/packed-mem
Introduce `std.mem.readPackedInt` and improve bitcasting of packed memory layouts
2022-10-28 21:15:16 -04:00
Evan Haas c616141241 translate-c: Better support for division in macros
Perform C-style arithmetic conversions on operands to division operator
in macros

Closes #13162
2022-10-28 17:59:32 -04:00
Cody Tapscott 40b7792a4c Enable bitcast test now that #13214 is resolved. 2022-10-28 12:41:15 -07:00
Cody Tapscott 3295fee911 stage2: Use mem.readPackedInt etc. for packed bitcasts
Packed memory has a well-defined layout that doesn't require
conversion from an integer to read from. Let's use it :-)

This change means that for bitcasting to/from a packed value that
is N layers deep, we no longer have to create N temporary big-ints
and perform N copies.

Other miscellaneous improvements:
  - Adds support for casting to packed enums and vectors
  - Fixes bitcasting to/from vectors outside of a packed struct
  - Adds a fast path for bitcasting <= u/i64
  - Fixes bug when bitcasting f80 which would clear following fields

This also changes the bitcast memory layout of exotic integers on
big-endian systems to match what's empirically observed on our targets.
Technically, this layout is not guaranteed by LLVM so we should probably
ban bitcasts that reveal these padding bits, but for now this is an
improvement.
2022-10-28 08:41:04 -07:00
Veikka Tuominen 6fc71835c3 value: properly hash null_value pointer
Closes #13325
2022-10-28 13:31:16 +03:00
Veikka Tuominen c3b85e4e2f Sema: further enhance explanation of why expr is evaluated at comptime 2022-10-28 13:31:16 +03:00
Andrew Kelley c389f8800b Merge pull request #13290 from Vexu/generic-deletion-mitigation
Mitigate generic deletion bug
2022-10-28 01:04:00 -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
InKryption bc72ae5e4e Sema: Prevent coercion from tuple pointer to mutable slice.
Also fix some stdlib code affected by this.

Co-authored by: topolarity <topolarity@tapscott.me>
2022-10-27 22:00:47 -04:00
Veikka Tuominen d03c47bf85 Sema: use runtime_value instead of creating allocs 2022-10-27 21:08:25 -04:00
Veikka Tuominen 648d34d8ea Sema: coerce zero-bit generic args are coerced properly
Closes #13307
2022-10-27 13:40:20 +03:00
Veikka Tuominen b937a04560 Sema: check coerceInMemoryAllowed earlier in resolvePeerTypes
Closes #13310
2022-10-27 01:31:18 +03:00
Veikka Tuominen d9fe5ba7f8 Sema: add error for too big packed struct 2022-10-27 01:31:18 +03:00
Veikka Tuominen 4ac8ec4c5c AstGen: fix refing inferred allocs
Closes  #13285
2022-10-27 01:31:18 +03:00
Veikka Tuominen 4fc944dde8 translate-c: fix redefinition of label on left recursive comma operator
Closes #13239
2022-10-27 01:31:18 +03:00
Veikka Tuominen 78a7bb108a llvm: handle namespace like packed structs
Closes #13159
Closes #13188
2022-10-27 01:31:18 +03:00
Veikka Tuominen dd437ae399 stage2: optimize size of optional slices 2022-10-27 01:31:17 +03:00
Veikka Tuominen b12a5cea75 remove test case triggering generic deletion bug
This test should be restored once the underlying issue is resolved (with the typo fixed).
2022-10-27 01:31:05 +03:00
Hadrien Dorio 9db293492b make a .rsp file for zig clang
same as std.build.LibExeObjStep.make() for `zig build-exe`
closes #12419
2022-10-26 23:50:51 +02:00
Luuk de Gram 2f41109cc4 test/link: add Wasm linker tests for features
Adds a test for inferring features based on a different object file.
Also provides a test case where cpu features are explicitly set on
a library where the end result will output said target features.
2022-10-25 20:48:08 +02:00
Jacob Young e20d2b3151 cbe: fix floating point builtins 2022-10-25 07:02:06 -04:00
Jacob Young 3d22327b23 cbe: enable test fixed by #13296 2022-10-25 05:43:00 -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 e470cf361f cbe: update test cases 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 15df64ade8 std: add cbe hacks to more targets
These are needed because clang doesn't support anything in naked
functions, not even assembly register inputs.
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 8b6a3ba74e cbe: fix typedef declaration order 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
Jacob Young b48417aed2 cbe: misc fixes 2022-10-25 05:11:29 -04:00
Jacob Young 1dd4a6102f cbe: implement global assembly 2022-10-25 05:11:29 -04:00
Jacob Young e8bda9eb3a cbe: implement ptr slice ptr 2022-10-25 05:11:29 -04:00
Jacob Young 87d432328e cbe: implement aggregate_init of struct 2022-10-25 05:11:29 -04:00
Jacob Young feb8f81cd9 cbe: canonicalize types that have the same C type when emitting typedefs 2022-10-25 05:11:29 -04:00
Jacob Young 5eafc10bf4 cbe: fix global access fix 2022-10-25 05:11:29 -04:00
Jacob Young c126a1018e cbe: implement more asm features 2022-10-25 05:11:28 -04:00
Jacob Young a12535f501 cbe: fix global access 2022-10-25 05:11:28 -04:00
Jacob Young f399dd107a cbe: implement tag name 2022-10-25 05:11:28 -04:00