diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-05-04 14:06:54 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-05-04 17:34:16 -0700 |
| commit | 5b1c0d922c1061706ae1673333fcfb1d8fdd4602 (patch) | |
| tree | 4df989a3854adeaad833ad1c9970c972a77918b4 /lib/std/fmt/parse_float | |
| parent | 259f784241fb44e0a1b570daaf31ba2b9f164106 (diff) | |
| download | zig-5b1c0d922c1061706ae1673333fcfb1d8fdd4602.tar.gz zig-5b1c0d922c1061706ae1673333fcfb1d8fdd4602.zip | |
stage2: improve semantics of atomic operations
ZIR instructions updated: atomic_load, atomic_rmw, atomic_store, cmpxchg
These no longer construct a pointer type as the result location. This
solves a TODO that was preventing the pointer from possibly being
volatile, as well as properly handling allowzero and addrspace.
It also allows the pointer to be over-aligned, which may be needed
depending on the target. As a consequence, the element type needs to be
communicated in the ZIR. This is done by strategically making one of the
operands be ResultLoc.ty instead of ResultLoc.coerced_ty if possible, or
otherwise explicitly adding elem_type into the ZIR encoding, such as in
the case of atomic_load.
The pointer type of atomic operations is now checked in Sema by coercing
it to an expected pointer type, that maybe over-aligned according to
target requirements.
Together with the previous commit, Zig now has smaller alignment for
large integers, depending on the target, and yet still has type safety
for atomic operations that specially require higher alignment.
Diffstat (limited to 'lib/std/fmt/parse_float')
0 files changed, 0 insertions, 0 deletions
