| Deutsch English Français Italiano |
|
<2025Feb3.075550@mips.complang.tuwien.ac.at> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: Re: Cost of handling misaligned access Date: Mon, 03 Feb 2025 06:55:50 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 32 Message-ID: <2025Feb3.075550@mips.complang.tuwien.ac.at> References: <5lNnP.1313925$2xE6.991023@fx18.iad> <vnosj6$t5o0$1@dont-email.me> Injection-Date: Mon, 03 Feb 2025 08:04:19 +0100 (CET) Injection-Info: dont-email.me; posting-host="108bde89ec56b4d2f11c428d43289119"; logging-data="1212360"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lXDf6cZ6/ZDmR045V7qaM" Cancel-Lock: sha1:NmcWqlCdrscSpikDlv4cGCTsd5Y= X-newsreader: xrn 10.11 Bytes: 2314 BGB <cr88192@gmail.com> writes: >On 2/2/2025 10:45 AM, EricP wrote: >> Digging deeper with performance counters reveals executing each unaligned >> load instruction results in ~505 executed instructions. P550 almost >> certainly doesn’t have hardware support for unaligned accesses. >> Rather, it’s likely raising a fault and letting an operating system >> handler emulate it in software." >> > >An emulation fault, or something similarly nasty... > > >At that point, even turning any potentially unaligned load or store into >a runtime call is likely to be a lot cheaper. There are lots of potentially unaligned loads and stores. There are very few actually unaligned loads and stores: On Linux-Alpha every unaligned access is logged by default, and the number of unaligned-access entries in the logs of our machines was relatively small (on average a few per day). So trapping actual unaligned accesses was faster than replacing potential unaligned accesses with code sequences that synthesize the unaligned access from aligned accesses. Of course, if the cost of unaligned accesses is that high, you will avoid them in cases like block copies where cheap unaligned accesses would otherwise be beneficial. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>