| Age | Commit message (Collapse) | Author |
|
|
|
|
|
I was too greedy
|
|
|
|
|
|
closes #10445
|
|
|
|
zig fmt now replaces c_void with anyopaque to make updating
code easy.
|
|
While the SysV ABI is not that complicated, LLVM does not allow us
direct access to enforce it. By mimicking the IR generated by clang,
we can trick LLVM into doing the right thing. This involves two main
additions:
1. `AGG` ABI class
This is not part of the spec, but since we have to track class per
eightbyte and not per struct, the current enum is not enough. I
considered adding multiple classes like: `INTEGER_INTEGER`,
`INTEGER_SSE`, `SSE_INTEGER`. However, all of those cases would trigger
the same code path so it's simpler to collapse into one. This class is
only used on SysV.
2. LLVM C ABI type
Clang uses different types in C ABI function signatures than the
original structs passed in, and does conversion. For example, this
struct: `{ i8, i8, float }` would use `{ i16, float }` at ABI boundaries.
When passed as an argument, it is instead split into two arguments `i16`
and `float`. Therefore, for every struct that passes ABI boundaries we
need to keep track of its corresponding ABI type. Here are some more
examples:
```
| Struct | ABI equivalent |
| { i8, i8, i8, i8 } | i32 |
| { float, float } | double |
| { float, i32, i8 } | { float, i64 } |
```
Then, we must update function calls, returns, parameter lists and inits
to properly convert back and forth as needed.
|
|
Take into account the increased number of parameters when flattening a
structure into one or more SSE registers.
Fixes #9061
|
|
Conflicts:
* doc/langref.html.in
* lib/std/enums.zig
* lib/std/fmt.zig
* lib/std/hash/auto_hash.zig
* lib/std/math.zig
* lib/std/mem.zig
* lib/std/meta.zig
* test/behavior/alignof.zig
* test/behavior/bitcast.zig
* test/behavior/bugs/1421.zig
* test/behavior/cast.zig
* test/behavior/ptrcast.zig
* test/behavior/type_info.zig
* test/behavior/vector.zig
Master branch added `try` to a bunch of testing function calls, and some
lines also had changed how to refer to the native architecture and other
`@import("builtin")` stuff.
|
|
|
|
|
|
Initial bringup for Linux/Thumb2
|
|
|
|
There are some small problems here and there, mostly due to the pointers
having the lsb set and disrupting the fn alignment tests and the
`@FrameSize` implementation.
|
|
Pointer types need an extra indirection layer during the generation of
the function prototype for inline asm blocks.
Closes #3606
|
|
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
|
|
|
|
|
|
The code would previously assume every function would start at addresses
being multiples of 16, this is not true beside some specific cases.
Moreover LLVM picks different alignment values depending on whether it's
trying to generate dense or fast code.
Let's use the minimum guaranteed alignment as base value, computed
according to how big the opcodes are.
The alignment of function pointers is always 1, a safe value that won't
cause any error at runtime. Note that this was already the case before
this commit, here we're making this choice explicit.
Let the 'alignment' field for TypeInfo of fn types reflect the ABI
alignment used by the compiler, make this field behave similarly to the
'alignment' one for pointers.
|
|
Closes #8603
|
|
Closes #7951
Closes #8574
|
|
Ensure everything's ok at comptime and runtime.
|
|
Happy LLVM 12 Release Day.
Please note that the llvm 12 tag does not include the latest commit in
the release/12.x branch, which is in fact a bug fix for a regression
that is causing a failure in Zig's test suite.
Zig master branch is tracking release/12.x, and will be enabling the
test that is fixed by that commit.
|
|
The code initializes twice `t` instead of `t1`, leaving the latter
uninitialized. The problem manifested itself by corrupting the LSBs of
the result in unpredictable ways.
|
|
|
|
|
|
stage1: allow async and resume inside nosuspend blocks
|
|
|
|
Beside handling NaNs and other non-numeric values better we finally
offer the same pair of testing predicates in math and testing.
|
|
|
|
|
|
- issue fixed in llvmorg-12.0.0-rc3
closes #8130
|
|
|
|
Syncing with master branch because I want to re-run
update_clang_options.zig in the llvm12 branch.
|
|
- consolidate into single code block
See #8130
See #8131
|
|
See #8130
|
|
These were temporarily disabled in
dd973fb365dbbe11ce5beac8b4889bfab3fddc4d and we forgot re-enable
them until now.
|
|
|
|
|
|
Type coercion for pointers to anon literals
|
|
Related: #4917
|
|
Allow variable captures on multi-prong switch arms
|
|
|
|
|
|
No functional changes, remove some dead code.
|
|
Handle the multi-prong case as we do with range cases.
Closes #7188
|
|
|
|
|