Re: unaligned load/store

Liste des GroupesRevenir à c arch 
Sujet : Re: unaligned load/store
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.arch
Date : 23. Dec 2024, 04:41:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vkam5u$11jv1$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 12/22/2024 2:01 AM, Thomas Koenig wrote:
MitchAlsup1 <mitchalsup@aol.com> schrieb:
On Sat, 21 Dec 2024 23:22:35 +0000, Jonathan Thornburg wrote:
 
Any competent programmer will ALIGN his data to the extend possible
there is no reason to penalize {Compiler, assembler, linker, ld.so,...}
just because you want to take 5 days out of design.
 These days, the competence of many programmers can be called into
question :-)
 ABIs, however, generally require natural alignment for types, so
the point is somehwat moot, at least where user code is concerned.
Consider
 typedef struct
{
   unsigned char a;
   unsigned long b;
} mytype;
 unsigned long add (mytype *x)
{
   return x->a + x->b;
}
 which gets translated into
          ldub    r2,[r1]
         ldd     r1,[r1,8]
         add     r1,r1,r2
         ret
 so the cost for the tool chain is already spent (or is spent
again and again if people use structs like the above).  I think
the VAX was the last major architecture which specified unaligned
struct access.
 
On Sat, 21 Dec 2024 23:22:35 +0000, Jonathan Thornburg wrote:
 
So yes, allowing unaligned access does help "dusty deck" Fortran code...
but it comes at a significant cost.
 Fortran compilers, even on machines which allow misalignment, use
ABIs which specify alignment for COMMON blocks, in violation of
the Fortran standard.  They usually have a flag for when the
user actually needs to have no padding.
 Code which which would not work with padding would have to be dusty
indeed (fossilized?) if it used COMMON blocks that way.  It would
never have run on early RISCs, so it would likely have had a time
of non-use in the 1990s when RISCs ruled in price/performance
after mainframes and the VAX fell behind.
One point, using unaligned access on an x86 with a LOCK prefixed instruction will trigger a bus lock. Think of a word that straddles two l2 cache lines.

Date Sujet#  Auteur
28 Nov 24 * What is an N-bit machine?107John Dallman
28 Nov 24 +* Re: What is an N-bit machine?83Michael S
30 Nov 24 i`* Re: What is an N-bit machine?82John 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
30 Nov 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?)70Anton Ertl
30 Nov 24 i  +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)32Anton Ertl
30 Nov 24 i  i`* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)31Thomas Koenig
30 Nov 24 i  i `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)30Anton Ertl
30 Nov 24 i  i  `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)29Michael S
30 Nov 24 i  i   `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)28Anton Ertl
30 Nov 24 i  i    +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)22Michael S
1 Dec 24 i  i    i`* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)21Anton Ertl
1 Dec 24 i  i    i `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)20Thomas 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?)15Tim Rentsch
1 Dec 24 i  i    i   +* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)12Thomas 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
31 Dec 24 i  i    i   i`* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)9Tim Rentsch
1 Jan 25 i  i    i   i `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)8Thomas Koenig
2 Jan 25 i  i    i   i  `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)7Tim Rentsch
2 Jan 25 i  i    i   i   `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)6Thomas Koenig
8 Jan 25 i  i    i   i    `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)5Tim Rentsch
8 Jan 25 i  i    i   i     `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)4Thomas Koenig
28 Jan 25 i  i    i   i      `* Re: Keeping other stuff with addresses (was: What is an N-bit machine?)3Tim Rentsch
28 Jan 25 i  i    i   i       `* Re: Keeping other stuff with addresses2David Brown
2 Feb 25 i  i    i   i        `- Re: Keeping other stuff with addresses1Thomas Koenig
2 Dec 24 i  i    i   `* Re: Keeping other stuff with addresses2Terje Mathisen
31 Dec 24 i  i    i    `- Re: Keeping other stuff with addresses1Tim Rentsch
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 Dec 24 i  i    i `- Re: What is an N-bit machine?1Waldek Hebisch
30 Nov 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 addresses34Chris M. Thomasson
2 Dec 24 i  i`* Re: Keeping other stuff with addresses33MitchAlsup1
2 Dec 24 i  i `* Re: Keeping other stuff with addresses32Chris M. Thomasson
3 Dec 24 i  i  `* Re: Keeping other stuff with addresses31Chris M. Thomasson
3 Dec 24 i  i   `* Re: Keeping other stuff with addresses30Stefan Monnier
3 Dec 24 i  i    +* Re: Keeping other stuff with addresses27John Levine
3 Dec 24 i  i    i+* Re: Keeping other stuff with addresses24Stefan Monnier
4 Dec 24 i  i    ii`* Re: Keeping other stuff with addresses23John Levine
4 Dec 24 i  i    ii `* Re: Keeping other stuff with addresses22Stefan Monnier
4 Dec 24 i  i    ii  +* Re: Keeping other stuff with addresses19MitchAlsup1
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 Dec 24 i  i    ii  i`* unaligned load/store (was: Re: Keeping other stuff with addresses)13Jonathan Thornburg
22 Dec 24 i  i    ii  i +* Re: unaligned load/store11MitchAlsup1
22 Dec 24 i  i    ii  i i+* Re: unaligned load/store4Thomas Koenig
22 Dec 24 i  i    ii  i ii+- Re: unaligned load/store1Anton Ertl
22 Dec 24 i  i    ii  i ii+- Re: unaligned load/store1John Dallman
23 Dec 24 i  i    ii  i ii`- Re: unaligned load/store1Chris M. Thomasson
22 Dec 24 i  i    ii  i i`* Re: unaligned load/store6Thomas Koenig
23 Dec 24 i  i    ii  i i +- Re: unaligned load/store1MitchAlsup1
26 Dec 24 i  i    ii  i i `* Re: unaligned load/store4Stefan Monnier
26 Dec 24 i  i    ii  i i  +- Re: unaligned load/store1George Neuner
26 Dec 24 i  i    ii  i i  `* Re: unaligned load/store2MitchAlsup1
26 Dec 24 i  i    ii  i i   `- Re: unaligned load/store1Chris M. Thomasson
22 Dec 24 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
28 Nov 24 i `* Re: What is an N-bit machine?14John Dallman
28 Nov 24 i  +* Re: What is an N-bit machine?9Lynn Wheeler
28 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
30 Nov 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

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal