diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-02 19:11:51 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-02 19:11:51 -0700 |
| commit | 97d7fddfb78d17132749cae59fea36fe661bf642 (patch) | |
| tree | 5b01a32f9ee35e6cef838cffb5058e5f0f777229 /lib/libc/include/aarch64-linux-gnu | |
| parent | 43d364afef7f0609f9d897c7ff129ba6b9b3cab0 (diff) | |
| download | zig-97d7fddfb78d17132749cae59fea36fe661bf642.tar.gz zig-97d7fddfb78d17132749cae59fea36fe661bf642.zip | |
stage2: progress towards basic structs
Introduce `ResultLoc.none_or_ref` which is used by field access
expressions to avoid unnecessary loads when the field access itself
will do the load. This turns:
```zig
p.y - p.x - p.x
```
from
```zir
%14 = load(%4) node_offset:8:12
%15 = field_val(%14, "y") node_offset:8:13
%16 = load(%4) node_offset:8:18
%17 = field_val(%16, "x") node_offset:8:19
%18 = sub(%15, %17) node_offset:8:16
%19 = load(%4) node_offset:8:24
%20 = field_val(%19, "x") node_offset:8:25
```
to
```zir
%14 = field_val(%4, "y") node_offset:8:13
%15 = field_val(%4, "x") node_offset:8:19
%16 = sub(%14, %15) node_offset:8:16
%17 = field_val(%4, "x") node_offset:8:25
```
Much more compact. This requires `Sema.zirFieldVal` to support both
pointers and non-pointers.
C backend: Implement typedefs for struct types, as well as the following
TZIR instructions:
* mul
* mulwrap
* addwrap
* subwrap
* ref
* struct_field_ptr
Note that add, addwrap, sub, subwrap, mul, mulwrap instructions are all
incorrect currently and need to be updated to properly handle wrapping
and non wrapping for signed and unsigned.
C backend: change indentation delta to 1, to make the output smaller and
to process fewer bytes.
I promise I will add a test case as soon as I fix those warnings that
are being printed for my test case.
Diffstat (limited to 'lib/libc/include/aarch64-linux-gnu')
0 files changed, 0 insertions, 0 deletions
