unaligned load/store (was: Re: Keeping other stuff with addresses)

Liste des GroupesRevenir à c arch 
Sujet : unaligned load/store (was: Re: Keeping other stuff with addresses)
De : jonathan (at) *nospam* gold.bkis-orchard.net (Jonathan Thornburg)
Groupes : comp.arch
Date : 22. Dec 2024, 00:22:35
Autres entêtes
Message-ID : <lsp0tqFs7aoU1@mid.individual.net>
References : 1 2 3 4 5 6 7
MitchAlsup1 <mitchalsup@aol.com> wrote:
FORTRAN COMMON blocks require misaligned accesses to double precision
data.
R E Q U I R E in that it is neither optional nor wise to emulate with
exceptions. It is just barely tolerable using LD/ST Left/Right
instructions
out of the compiler.
 
I, personally, went through enough PAIN with misalignment, that over
time my mood swung from "aligned only" to "completely misaligned"::
a) because there is no performant* SW workaround
b) it is SO easy to fix in HW.
c) once fixed in HW, any SW burden is so small as to be barely
..measurable.

I'm not so sure (b) is true.  Some cases are moderately easy to handle
in hardware (e.g., misaligned loads that stay within a single L1 D-cache
line), but some cases are harder (e.g., misaligned writes that cross L1
D-cache line boundaries) and might need a microcode trap (awkward if the
design wasn't otherwise using microcode).  And some cases are even harder
(e.g., misaligned writes crossing L1 D-cache line boundaries where the
two lines are owned by different CPUs in a cache-coherent multiprocessor)
and might need a millicode trap.  And some cases may require going all the
way up to the OS (e.g., misaligned writes that cross virtual-memory-page
boundaries where one page is ok but the other is non-resident).

So, allowing this in the architecture has several costs:
* extra hardware implementation effort to make sure the "hardware" cases
  don't cost an extra gate delay or two on some critical path
* extra complexity and debugging time in hardware and in system software
  (think about writing and *debugging* and *verifying* microcode/millicode
  trap handlers for all those messy write-crossing-cache/page-boundary
  cases, especially their interactions with multiprocessor cache coherency)
* this extra effort means a longer design time and/or greater design cost,
  and hence (so long as the state-of-the-art of competing systems is still
  steadily improving with time) that means a net lower price/performance
  relative to competing systems

And, because of the traps and their overheads (which will likely differ
significantly across different implementations of the same architecture,
e.g., different multiprocessor cache-coherency protocols), any code that
actually *uses* unaligned accesses -- especially unaligned writes -- isn't
performance-portable unless the actual dynamic frequency of unaligned
operations is very low.

So yes, allowing unaligned access does help "dusty deck" Fortran code...
but it comes at a significant cost.

--
-- "Jonathan Thornburg [remove -color to reply]" <jt.bhbkis@gmail-pink.com>
   on the west coast of Canada
   "the stock market can remain irrational a lot longer than you can
   remain solvent" or (probably the correct original wording) "markets
   can remain irrational a lot longer than you and I can remain solvent"
         -- A. Gary Shilling (often misattributed to John Maynard Keynes)


Date Sujet#  Auteur
28 Nov 24 * What is an N-bit machine?91John Dallman
28 Nov 24 +* Re: What is an N-bit machine?67Michael S
30 Nov 24 i`* Re: What is an N-bit machine?66John Levine
30 Nov 24 i +* Re: What is an N-bit machine?11Stephen Fuld
30 Nov 24 i i`* Re: What is an N-bit machine?10John Levine
30 Nov 24 i i +* Re: What is an N-bit machine?2Michael S
1 Dec 24 i i i`- Re: What is an N-bit machine?1Paul A. Clayton
1 Dec 24 i i `* Re: What is an N-bit machine?7MitchAlsup1
1 Dec 24 i i  +* Re: What is an N-bit machine?2Thomas Koenig
1 Dec 24 i i  i`- Re: What is an N-bit machine?1Anton Ertl
2 Dec 24 i i  `* Re: What is an N-bit machine?4Terje Mathisen
3 Dec 24 i i   +* Re: What is an N-bit machine?2Brian G. Lucas
3 Dec 24 i i   i`- Re: What is an N-bit machine?1Stephen Fuld
15 Dec 24 i i   `- Re: What is an N-bit machine?1Waldek Hebisch
30 Nov 24 i `* Keeping other stuff with addresses (was: What is an N-bit machine?)54Anton Ertl
30 Nov 24 i  +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)22Anton Ertl
30 Nov 24 i  i`* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)21Thomas Koenig
30 Nov 24 i  i `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)20Anton Ertl
30 Nov 24 i  i  `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)19Michael S
30 Nov 24 i  i   `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)18Anton Ertl
30 Nov 24 i  i    +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)12Michael S
1 Dec 24 i  i    i`* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)11Anton Ertl
1 Dec 24 i  i    i `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)10Thomas Koenig
1 Dec 24 i  i    i  +* Re: Keeping other stuff with addresses4David Schultz
1 Dec 24 i  i    i  i`* Re: Keeping other stuff with addresses3Thomas Koenig
4 Dec 24 i  i    i  i `* Re: Keeping other stuff with addresses2MitchAlsup1
4 Dec 24 i  i    i  i  `- Re: Keeping other stuff with addresses1John Levine
1 Dec 24 i  i    i  `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)5Tim Rentsch
1 Dec 24 i  i    i   +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)3Thomas Koenig
1 Dec 24 i  i    i   i+- Re: Keeping other stuff with addresses (was: What is an N-bit machine?)1Michael S
1 Dec 24 i  i    i   i`- Re: Keeping other stuff with addresses (was: What is an N-bit machine?)1Brett
2 Dec 24 i  i    i   `- Re: Keeping other stuff with addresses1Terje Mathisen
30 Nov 24 i  i    +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)3John Levine
1 Dec 24 i  i    i`* What is an N-bit machine?2Anton Ertl
16 Dec23:39 i  i    i `- Re: What is an N-bit machine?1Waldek Hebisch
1 Dec 24 i  i    `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)2Thomas Koenig
1 Dec 24 i  i     `- Re: Keeping other stuff with addresses (was: What is an N-bit machine?)1Anton Ertl
1 Dec 24 i  +- Re: Keeping other stuff with addresses (was: What is an N-bit machine?)1Anton Ertl
2 Dec 24 i  +* Re: Keeping other stuff with addresses28Chris M. Thomasson
2 Dec 24 i  i`* Re: Keeping other stuff with addresses27MitchAlsup1
2 Dec 24 i  i `* Re: Keeping other stuff with addresses26Chris M. Thomasson
3 Dec 24 i  i  `* Re: Keeping other stuff with addresses25Chris M. Thomasson
3 Dec 24 i  i   `* Re: Keeping other stuff with addresses24Stefan Monnier
3 Dec 24 i  i    +* Re: Keeping other stuff with addresses21John Levine
3 Dec 24 i  i    i+* Re: Keeping other stuff with addresses18Stefan Monnier
4 Dec 24 i  i    ii`* Re: Keeping other stuff with addresses17John Levine
4 Dec 24 i  i    ii `* Re: Keeping other stuff with addresses16Stefan Monnier
4 Dec 24 i  i    ii  +* Re: Keeping other stuff with addresses13MitchAlsup1
4 Dec 24 i  i    ii  i+- Re: Keeping other stuff with addresses1Thomas Koenig
4 Dec 24 i  i    ii  i+* Re: Keeping other stuff with addresses3Stefan Monnier
4 Dec 24 i  i    ii  ii+- Re: Keeping other stuff with addresses1MitchAlsup1
5 Dec 24 i  i    ii  ii`- Re: Keeping other stuff with addresses1Keith Thompson
5 Dec 24 i  i    ii  i+- Re: bytes, Keeping other stuff with addresses1John Levine
22 Dec00:22 i  i    ii  i`* unaligned load/store (was: Re: Keeping other stuff with addresses)7Jonathan Thornburg
22 Dec02:27 i  i    ii  i +* Re: unaligned load/store5MitchAlsup1
22 Dec11:01 i  i    ii  i i+* Re: unaligned load/store3Thomas Koenig
22 Dec12:06 i  i    ii  i ii+- Re: unaligned load/store1Anton Ertl
22 Dec12:42 i  i    ii  i ii`- Re: unaligned load/store1John Dallman
22 Dec22:04 i  i    ii  i i`- Re: unaligned load/store1Thomas Koenig
22 Dec11:33 i  i    ii  i `- Re: unaligned load/store (was: Re: Keeping other stuff with addresses)1Anton Ertl
4 Dec 24 i  i    ii  `* Re: bits and bytes, Keeping other stuff with addresses2John Levine
4 Dec 24 i  i    ii   `- Re: bits and bytes, Keeping other stuff with addresses1Stefan Monnier
3 Dec 24 i  i    i`* Re: Keeping other stuff with addresses2MitchAlsup1
4 Dec 24 i  i    i `- Re: Keeping other stuff with addresses1Chris M. Thomasson
4 Dec 24 i  i    `* Re: Keeping other stuff with addresses2Chris M. Thomasson
4 Dec 24 i  i     `- Re: Keeping other stuff with addresses1Stefan Monnier
4 Dec 24 i  `* Re: Keeping other stuff with addresses2Keith Thompson
4 Dec 24 i   `- Re: Keeping other stuff with addresses1MitchAlsup1
28 Nov 24 +* Re: What is an N-bit machine?18Thomas Koenig
28 Nov 24 i+* Re: What is an N-bit machine?2MitchAlsup1
28 Nov 24 ii`- Re: What is an N-bit machine?1Brett
28 Nov 24 i`* Re: What is an N-bit machine?15Lawrence D'Oliveiro
29 Nov 24 i `* Re: What is an N-bit machine?14John Dallman
29 Nov 24 i  +* Re: What is an N-bit machine?9Lynn Wheeler
29 Nov 24 i  i+- Re: What is an N-bit machine?1John Dallman
29 Nov 24 i  i`* IBM and Amdahl history (Re: What is an N-bit machine?)7Anton Ertl
29 Nov 24 i  i +- Re: IBM and Amdahl history (Re: What is an N-bit machine?)1Lynn Wheeler
29 Nov 24 i  i +- Re: IBM and Amdahl history (Re: What is an N-bit machine?)1Lynn Wheeler
29 Nov 24 i  i `* Re: IBM and Amdahl history (Re: What is an N-bit machine?)4Lawrence D'Oliveiro
30 Nov 24 i  i  `* Re: IBM and Amdahl history (Re: What is an N-bit machine?)3Anton Ertl
1 Dec 24 i  i   +- Re: IBM and Amdahl history (Re: What is an N-bit machine?)1John Dallman
1 Dec 24 i  i   `- Re: IBM and Amdahl history (Re: What is an N-bit machine?)1Lawrence D'Oliveiro
29 Nov 24 i  `* Re: What is an N-bit machine?4Lawrence D'Oliveiro
30 Nov 24 i   +- Re: What is an N-bit machine?1Brett
30 Nov 24 i   +- Re: market power, What is an N-bit machine?1John Levine
30 Nov 24 i   `- Re: What is an N-bit machine?1Lynn Wheeler
28 Nov 24 +- Re: What is an N-bit machine?1MitchAlsup1
28 Nov 24 +- Re: What is an N-bit machine?1Lynn Wheeler
29 Nov 24 `* Re: What is an N-bit machine?3Anton Ertl
29 Nov 24  +- Re: What is an N-bit machine?1Thomas Koenig
22 Dec22:37  `- Re: What is an N-bit machine?1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal