[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: packed structures
- From: Andrew Gierth <andrew@...>
- Date: Mon, 11 Oct 2021 20:45:22 +0100
>>>>> "Roberto" == Roberto Ierusalimschy <firstname.lastname@example.org> writes:
Roberto> Hugo Gualandi came with the idea of using a packed structure
Roberto> to store Lua values. Intel CPUs (and it seems ARMs too) can
Roberto> work with unaligned data (or aligned with weaker boundaries)
Roberto> and, at least for some architectures, with very small (or even
Roberto> none) performance penalties.
While Intel cpus will usually read unaligned data without much penalty,
there are some issues with write/read operations on unaligned data.
Store forwarding (the ability to satisfy reads from within the write
buffers, rather than having to stall waiting for the write to retire)
demands specific alignment constraints, and the stalls can have a large
The issue of store-forwarding stalls was discussed a while back on the