Commit Graph

1184 Commits

Author SHA1 Message Date
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
Luuk de Gram 66bcc55e01 llvm: mangle extern Wasm functions
When Wasm extern functions contain the same name, but have a
different module name such as `extern "a"` vs `extern "b"` LLVM will
currently resolve the two functions to the same symbol. By mangling
the name of the symbol, we ensure the functions are resolved
seperately. We mangle the name by applying <name>|<module> where
module is also known as the library name.
2022-11-01 15:05:09 +01: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
Andrew Kelley 1d1c7ae5de Merge pull request #13257 from topolarity/ctype-fixes
stage 2: Update `CType` size/alignment
2022-10-27 21:15:22 -04:00
Veikka Tuominen d03c47bf85 Sema: use runtime_value instead of creating allocs 2022-10-27 21:08:25 -04:00
Veikka Tuominen f3a3fb3d88 llvm: pass optional slices like regular slices 2022-10-27 01:31:18 +03:00
Veikka Tuominen 595ccecd88 llvm: do not return undefined pointers from array_to_slice 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
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
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
Jacob Young 40b5bb7161 cbe: fix loads and stores of 0-bit types 2022-10-25 05:11:28 -04:00
Jacob Young 962f33ee11 cbe: implement airUnionInit 2022-10-25 05:11:28 -04:00
Jacob Young 6a4266d62a cbe: fix infinite recursion on recursive types 2022-10-25 05:11:28 -04:00
Jacob Young 7c9a9a0fd4 cbe: cleanup code and fix cases test breakage 2022-10-25 05:11:28 -04:00
Jacob Young 525dcaecba behavior: enable stage2_c tests that are currently passing
Also fix C warnings triggered by these tests.
2022-10-25 05:11:28 -04:00
Jacob Young e875530f8f c: improve lowering of undef values
All remaining behavior test -Wall -Wextra warnings are unused (but set)
warnings.
2022-10-25 05:11:28 -04:00
Jacob Young 5ae3ac9c43 c: fix redefinition of typedef warnings
Closes #11651
2022-10-25 05:11:28 -04:00
Jacob Young f81651932a c: hacks to fix incompatible redeclaration of library function warnings 2022-10-25 05:11:28 -04:00
Jacob Young f8a8197caa c: fix incompatible pointer types warning 2022-10-25 05:11:28 -04:00
Jacob Young 3b501b2d81 c: cast NULL in advance to avoid comparison warnings 2022-10-25 05:11:28 -04:00