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
Jacob Young
497329622a
c: fix nonscalar type cast warning
2022-10-25 05:11:28 -04:00
Jacob Young
72e2fc4c73
c: fix stage1 compatibility
2022-10-25 05:11:28 -04:00
Jacob Young
0092f6ed88
c: fix int literal warnings
2022-10-25 05:11:28 -04:00
Jacob Young
61bf43d790
c: fix switch on bool warning
2022-10-25 05:11:28 -04:00
Jacob Young
da939b032e
c: fix empty container warnings
2022-10-25 05:11:28 -04:00
Jacob Young
6f3654ad69
c: implement @errorName
2022-10-25 05:11:28 -04:00
Jacob Young
c8d0e71de6
c: fix mangling of error names
...
Closes #12751
2022-10-25 05:11:28 -04:00
Jacob Young
ab024d3524
c: fix undefined tests in ReleaseSafe
2022-10-25 05:11:28 -04:00
Cody Tapscott
724d753638
stage2: Add .save_err_return_trace_index AIR op
...
This is encoded as a primitive AIR instruction to resolve one corner
case: A function may include a `catch { ... }` or `else |err| { ... }`
block but not call any errorable fn. In that case, there is no error
return trace to save the index of and codegen needs to avoid
interacting with the non-existing error trace.
By using a primitive AIR op, we can depend on Liveness to mark this
unused in this corner case.
2022-10-21 10:44:20 -07:00
Robin Voetter
5d429b03e3
stage2: add @addrSpaceCast builtin
2022-10-12 20:36:12 +02:00
jacobly0
562ac8be48
codegen: add support for lowering .field_ptr on a slice
...
Closes #13068
2022-10-12 12:40:59 +03:00
Veikka Tuominen
d48af541c7
Sema: handle union and enum field order being different
...
Closes #12543
2022-08-21 12:51:40 +03:00
Veikka Tuominen
7c9979a02e
stage2: generate a switch for @errSetCast safety
2022-08-12 11:40:37 +03:00
Veikka Tuominen
0daa77bd63
stage2 cbe: correct airIsNull ptr operand check
2022-08-05 22:13:58 +03:00
Veikka Tuominen
f46d7304b1
stage2: add runtime safety for invalid enum values
2022-08-05 22:13:58 +03:00
Veikka Tuominen
d75fa86d70
stage2: implement @setFloatMode
2022-07-23 15:40:12 +03:00
Veikka Tuominen
ff7ec4efb5
Sema: bad union field access safety
2022-07-23 15:40:11 +03:00
Veikka Tuominen
03b1fbe50d
stage2: fix airIsErr when is_ptr == true
2022-07-22 21:07:55 +03:00
Andrew Kelley
6bc6e47b15
stage2: lower float negation explicitly
...
Rather than lowering float negation as `0.0 - x`.
* Add AIR instruction for float negation.
* Add compiler-rt functions for f128, f80 negation
closes #11853
2022-06-30 00:02:00 -07:00