Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Performance of unaligned memory-accesses Date: Sun, 11 Aug 2019 10:59:43 +1200 Lines: 23 Message-ID: References: <2tm3F.2462684$ng1.1031546@fx36.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 96Jpze6nCofbxhniJqxiiQq8M22yNp2MM1W4hrqUHmDtxjX8+K Cancel-Lock: sha1:PecyntJU7LVvwpEDBglvrZo8vH0= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.c++:67540 On 11/08/2019 09:32, David Brown wrote: > On 10/08/2019 17:25, Bonita Montero wrote: >>> Bart /is/ right.  Lots of processors don't support unaligned access, >>> and  compilers for them will usually still have some type of "packed" >>> struct  solution. >> >> Yes, they generate the correct code and let the rest depend on the CPU >> or the OS (trapping). > > You've given no evidence to suggest that any OS emulates unaligned > access. It might well be that some OS's do, for compatibility with > binaries for related processors - but your "proof by repeated assertion" > is getting tedious. > > No compiler would /ever/ rely on trapping and emulation for handling > unaligned accesses to packed objects - that would be absurdly inefficient. Solaris SPARC? https://blogs.oracle.com/d/on-misaligned-memory-accesses -- Ian.