Re: Unaligned access trade-offs for SFrame FRE layout

Rainer Orth <[email protected]> Sun, 14 Sep 2025 16:39:44 +0200
Newsgroups org.kernel.vger.linux-toolchains
Message-ID <[email protected]>
Hi Jan,

> On 12.09.2025 19:34, Indu Bhagat via Binutils wrote:
>> TL;DR: Thinking and experimenting a bit on the possible approaches for 
>> avoiding unaligned accesses in the SFrame FRE layout (in SFrame V3), I 
>> am not convinced that avoiding unaligned accesses for performance is 
>> worth it.  IMO, forsaking compactness for avoiding unaligned accesses is 
>> not a good trade off for SFrame.
>> 
>> Problem Statement
>> On architectures such as x86_64, AArch64, and s390x, unaligned memory 
>> accesses are handled transparently by the hardware but incur a 
>> performance penalty.
>
> As you say in a reply, may incur. However, shouldn't we also consider
> possible ports of SFrame to architectures which don't handle this as
> transparently? Off the top of my head I don't, for example, recall
> whether RISC-V requires unaligned accesses to be handled transparently
> by the hardware.

look for STRICT_ALIGNMENT in the GCC sources in gcc/config.  While
several are embedded targets, there's also sparc in that list.

Getting SIGBUS on SPARC is a good reality check for code that doesn't
take that into accout.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University