4 Commits

Author SHA1 Message Date
Andres-Salamanca
b02787d33f
[CIR] Fix alignment when lowering set/get bitfield operations (#148999)
This PR fixes incorrect alignment when lowering `set` and `getBitField`
operations to LLVM IR. The issue occurred because during lowering, the
function was being called with an alignment of 0, which caused it to
default to the alignment of the packed member. For example, if the
bitfield was packed inside a `u64i`, it would use an alignment of 8.
With this change, the generated code now matches what the classic
codegen produces.
In the assembly format, I changed to be similar to how it's done in
loadOp. If there's a better approach, please feel free to point it out.
2025-07-18 16:13:34 -05:00
Andres-Salamanca
3d08a40959
[CIR] Upstream new SetBitfieldOp for handling C and C++ struct bitfields (#147609)
This PR upstreams the `set_bitfield` operation used to assign values to
bitfield members in C and C++ struct types.
Handling of AAPCS-specific volatile bitfield semantics will be addressed
in a future PR.
2025-07-10 15:16:29 -05:00
Andres-Salamanca
717899ce86
[CIR] Upstream get_bitfield operation to load bit-field members from structs (#145971)
This PR adds support for loading bit-field members from structs using
the `get_bitfield` operation.
It enables retrieving the address of the bitfield-packed member but does
**not** yet support volatile bitfields this will be addressed in a
future PR.
2025-07-02 18:05:19 -05:00
Andres-Salamanca
f4d31cdee3
[CIR] Add bitfield offset calculation for big-endian targets (#145067)
This PR updates the bitfield offset calculation to correctly handle
big-endian architectures.
2025-06-23 14:20:26 -05:00