• Re: Keeping other stuff with addresses

    From David Schultz@david.schultz@earthlink.net to comp.arch on Sun Dec 1 08:15:34 2024
    From Newsgroup: comp.arch

    On 12/1/24 8:03 AM, Thomas Koenig wrote:
    I think "ALU can add up to n-bit numbers" is a reasonable definition
    for an n-bit architecture, which also fits the 16-bit 68000.
    It does not fit the 360/30, or the Nova (but see de Castro's remark
    on the latter).
    Or the CDP1802. 8 bit accumulator and 1 bit ALU.
    --
    http://davesrocketworks.com
    David Schultz
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Thomas Koenig@tkoenig@netcologne.de to comp.arch on Sun Dec 1 14:40:33 2024
    From Newsgroup: comp.arch

    David Schultz <david.schultz@earthlink.net> schrieb:
    On 12/1/24 8:03 AM, Thomas Koenig wrote:
    I think "ALU can add up to n-bit numbers" is a reasonable definition
    for an n-bit architecture, which also fits the 16-bit 68000.
    It does not fit the 360/30, or the Nova (but see de Castro's remark
    on the latter).
    Or the CDP1802. 8 bit accumulator and 1 bit ALU.

    Or the PDP-8/S...
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From EricP@ThatWouldBeTelling@thevillage.com to comp.arch on Sun Dec 1 18:16:00 2024
    From Newsgroup: comp.arch

    Michael S wrote:
    On Sun, 1 Dec 2024 17:53:19 -0000 (UTC)
    Thomas Koenig <tkoenig@netcologne.de> wrote:

    Tim Rentsch <tr.17687@z991.linuxsc.com> schrieb:
    Thomas Koenig <tkoenig@netcologne.de> writes:

    I think "ALU can add up to n-bit numbers" is a reasonable
    definition for an n-bit architecture, which also fits the 16-bit
    68000. It does not fit the 360/30, or the Nova (but see de
    Castro's remark on the latter).
    To me, the phrase "n-bit architecture" should depend only on such
    characteristics as are defined by the architecture, and not depend
    on features of a particular implementation. The 360/30 has a 32-bit
    (or is it 64-bit?) architecture, but only an 8-bit implementation.

    If I may add a personal note, it's disappointing that postings in a
    group nominally devoted to computer architecture routinely ignore
    the distinction between architecture and implementation.
    I'm well aware of that distinction.

    On the other hand, I have right before me a book with the title
    "MC68000 16-BIT MICROPROCESSOR User's manual third edition", ISBN
    0-13-566695-3 (in paperback). One may argue that the authors
    of that book didn't know what they were writing about (since the
    68000 has a 32-bit ISA), but I would try to define the terms in
    such a way that this is also included.

    IMHO, the authors of the book are wrong. At least as long as were are
    talking about current meaning of the bitness. It is possible that 40
    years ago the word had different meaning. But I find more likely that
    it had no established meaning.

    This 1983 Byte article shows what Motorola were thinking at the time.

    Design Philosophy Behind Motorola's MC68000, Apr 1983, BYTE
    Thomas W. Starnes
    Motorola Inc., Microprocessor Division http://www.easy68k.com/paulrsm/doc/dpbm68k1.htm

    "Many criteria can qualify a processor as an 8-, 16-, or 32-bit device.
    A manufacturer might base its label on the width of the data bus,
    address bus, data sizes, internal data paths, arithmetic and logic
    unit (ALU), and/or fundamental operation code (op code). Generally,
    the data-bus size has determined the processor size, though perhaps
    the best choice would be based on the size of the op code.
    I'll talk a bit about these features and then show how the MC68000
    is both a 16- and 32-bit microprocessor.
    ...
    ...
    Conclusion

    Let's look back now at the MC68000 and see what parts of it might qualify
    it as a 16-bit device. The internal data ALU is 16 bits. It processes 32-bit addresses, though only 24 bits are brought off chip. The op code that tells
    the processor what operation to perform is 16 bits wide. The data bus is
    16 bits wide. The microprocessor will operate on either 8, 16, or 32 bits
    of data automatically. There are 16 general-purpose 32-bit-wide registers
    in the chip.

    The MC68000 is generally considered a 16-bit microprocessor, though it
    uses 32-bit addresses and contains 32-bit registers. It also can operate
    on 32 bits of data as easily as 8 and 16. Many users of the MC68000
    consider it a 32-bit just as much as a 16-bit processor."

    He doesn't mention that internally it has two 16-bit buses,
    one for address high & low, one for data high & low,
    plus two 16-bit arithmetic units for address calculations,
    plus one 16-bit arithmetic logic unit for data calculations.
    A 32-bit address calculation can be performed in one cycle concurrent with
    a 16-bit data calculation, or two cycles for a 32-bit data calculation.

    Note also that according to the Oral History of the 68000,
    when the 68000 was announced in 1978 they viewed
    their primary competition to be the 16-bit 8086 and Z8000.
    They also needed more that 16 address lines so 32 was most natural.

    Oral History Panel on the Development and Promotion of the Motorola 68000 https://archive.computerhistory.org/resources/access/text/2012/04/102658164-05-01-acc.pdf

    I call it a 32-bit architecture because that is its integer and address register size and it operates on up to 32-bit integer data types in a single instruction. (The 16-bit size of the instruction granules is a red herring
    as instructions take a variable number of granules.)




    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Sun Dec 1 15:22:14 2024
    From Newsgroup: comp.arch

    On 11/29/2024 10:28 PM, Anton Ertl wrote:
    John Levine <johnl@taugh.com> writes:
    S/360 had 24 bit addresses and 32 bit registers. When doing address arithmetic
    the high 8 bits of the register were ignored. That turned out to be a really bad
    decision since a few instructions and a lot of programming conventions stored
    other stuff in that high byte, causing severe pain a few years later when
    memories got bigger than 16 meg.

    The technique of putting stuff in unused bits of an address has its drawbacks, but it also has benefits, in particular type information is
    often stored there (even on architectures that do not ignore any
    bits). Of course AMD and Intel have the bad examples of S/360 and
    68000 in mind, and did not want to have anything to do with that
    during the first two decades of AMD64.

    Fwiw, stealing bits from pointers is a common practice in exotic
    lock-free algorithms. It's not portable at all, but comes in handy!



    The designers of ARM A64 could think beyond that and designed in the top-byte-ignore feature. Apparently this made AMD and Intel see the
    light:

    AMD added the upper-address ignore feature, which, when enabled,
    ignores the top 7 bits. One problem with this in the Linux kernel
    (and maybe other OSs) is that the Linux kernel expects the top bit to
    be set only for kernel addresses. Not sure how that works with ARMs
    top-byte ignore feature, which is supported since Linux 5.4 in 2019
    using the PR_SET_TAGGED_ADDR_CTRL option of the prctl() call.

    Intel added the linear address masking feature, with two variants:
    LAM_U57 ignores bits 57-62 (but not the MSB), allowing 6 bits for
    other uses; LAM_U48 ignores bits 48-62, allowing 15 bits for other
    uses. These variants require bit 63 to have the same value as bit
    56/47; another bit could be made available by ignoring bit 56/47 (the information is in bit 63 anyway), but Intel apparently decided that programmers don't need that extra bit.

    RISC-V has the pointer-masking extension, which ignores the top 7 bits
    (like AMD's upper-address ignore) or optionally 16 bits.

    See <https://muxup.com/2023q4/storing-data-in-pointers> and <https://lwn.net/Articles/902094/>.

    Concerning the kernel requirements, as someone who has implemented
    Prolog with tagging, having to untag on passing an address to the
    kernel would be only a minimal cost. Not having to unmask on every
    memory access would be quite useful. Having the top bit always be 0
    with the tags in the 6 bits below would not have been a restriction
    for us (we used 4-bit tags); OTOH, if one more bit was available,
    programmers would find good uses for it.

    These days I'd say the relevant N is the size of arithmetic registers but a >> lot of marketers appear to disagree with me.

    Which arithmetic registers on an Intel processor? The 64 bits of a
    GPR? The 128 bits of an XMM register? The 256 bits of a YMM
    register? The 512 bits of a ZMM register? Note that until recently,
    Intel sold you the same silicon either with only XMM or with XMM and
    YMM registers. They sell consumer CPUs with XMM, YMM, and ZMM
    registers, but more recent consumer and small-server CPUs have
    reverted to only supporting XMM and YMM registers.

    - anton

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mitchalsup@mitchalsup@aol.com (MitchAlsup1) to comp.arch on Mon Dec 2 01:26:42 2024
    From Newsgroup: comp.arch

    On Sun, 1 Dec 2024 23:22:14 +0000, Chris M. Thomasson wrote:

    On 11/29/2024 10:28 PM, Anton Ertl wrote:
    John Levine <johnl@taugh.com> writes:
    S/360 had 24 bit addresses and 32 bit registers. When doing address
    arithmetic
    the high 8 bits of the register were ignored. That turned out to be a
    really bad
    decision since a few instructions and a lot of programming conventions
    stored
    other stuff in that high byte, causing severe pain a few years later
    when
    memories got bigger than 16 meg.

    The technique of putting stuff in unused bits of an address has its
    drawbacks, but it also has benefits, in particular type information is
    often stored there (even on architectures that do not ignore any
    bits). Of course AMD and Intel have the bad examples of S/360 and
    68000 in mind, and did not want to have anything to do with that
    during the first two decades of AMD64.

    Fwiw, stealing bits from pointers is a common practice in exotic
    lock-free algorithms. It's not portable at all, but comes in handy!

    How are you going to write these algorithms when a pointer consumes
    all 64-bits of the register/memory container ?? VAS = 64-bits.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Sun Dec 1 20:12:42 2024
    From Newsgroup: comp.arch

    On 12/1/2024 5:26 PM, MitchAlsup1 wrote:
    On Sun, 1 Dec 2024 23:22:14 +0000, Chris M. Thomasson wrote:

    On 11/29/2024 10:28 PM, Anton Ertl wrote:
    John Levine <johnl@taugh.com> writes:
    S/360 had 24 bit addresses and 32 bit registers. When doing address
    arithmetic
    the high 8 bits of the register were ignored. That turned out to be a
    really bad
    decision since a few instructions and a lot of programming conventions >>>> stored
    other stuff in that high byte, causing severe pain a few years later
    when
    memories got bigger than 16 meg.

    The technique of putting stuff in unused bits of an address has its
    drawbacks, but it also has benefits, in particular type information is
    often stored there (even on architectures that do not ignore any
    bits).  Of course AMD and Intel have the bad examples of S/360 and
    68000 in mind, and did not want to have anything to do with that
    during the first two decades of AMD64.

    Fwiw, stealing bits from pointers is a common practice in exotic
    lock-free algorithms. It's not portable at all, but comes in handy!

    How are you going to write these algorithms when a pointer consumes
    all 64-bits of the register/memory container ?? VAS = 64-bits.

    You don't for they are not portable at all. However, on systems were we
    can steal some bits of a pointer value in C/C++, well, we can do it and
    create some interesting algorithms.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Terje Mathisen@terje.mathisen@tmsw.no to comp.arch on Mon Dec 2 17:10:50 2024
    From Newsgroup: comp.arch

    Tim Rentsch wrote:
    Thomas Koenig <tkoenig@netcologne.de> writes:

    I think "ALU can add up to n-bit numbers" is a reasonable definition
    for an n-bit architecture, which also fits the 16-bit 68000.
    It does not fit the 360/30, or the Nova (but see de Castro's remark
    on the latter).

    To me, the phrase "n-bit architecture" should depend only on such characteristics as are defined by the architecture, and not depend
    on features of a particular implementation. The 360/30 has a 32-bit
    (or is it 64-bit?) architecture, but only an 8-bit implementation.

    If I may add a personal note, it's disappointing that postings in a
    group nominally devoted to computer architecture routinely ignore
    the distinction between architecture and implementation. I don't
    mind comments about matters of implementation, but the constant
    blurring (or erasing) of the line between architecture and
    implementation often makes it nearly impossible to have a discussion
    just about architecture.

    I agree!

    The one exception which I personally find OK are discussions of what
    happens when an implementation is so bad that it effectively removes the architecture feature from programmer consideration.

    I.e. having architectural string/memcpy instructions that are much
    slower than sw implementations, for several decades.

    Terje
    --
    - <Terje.Mathisen at tmsw.no>
    "almost all programming can be viewed as an exercise in caching"
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Mon Dec 2 16:54:15 2024
    From Newsgroup: comp.arch

    On 12/1/2024 8:12 PM, Chris M. Thomasson wrote:
    On 12/1/2024 5:26 PM, MitchAlsup1 wrote:
    On Sun, 1 Dec 2024 23:22:14 +0000, Chris M. Thomasson wrote:

    On 11/29/2024 10:28 PM, Anton Ertl wrote:
    John Levine <johnl@taugh.com> writes:
    S/360 had 24 bit addresses and 32 bit registers. When doing address
    arithmetic
    the high 8 bits of the register were ignored. That turned out to be a >>>>> really bad
    decision since a few instructions and a lot of programming conventions >>>>> stored
    other stuff in that high byte, causing severe pain a few years later >>>>> when
    memories got bigger than 16 meg.

    The technique of putting stuff in unused bits of an address has its
    drawbacks, but it also has benefits, in particular type information is >>>> often stored there (even on architectures that do not ignore any
    bits).  Of course AMD and Intel have the bad examples of S/360 and
    68000 in mind, and did not want to have anything to do with that
    during the first two decades of AMD64.

    Fwiw, stealing bits from pointers is a common practice in exotic
    lock-free algorithms. It's not portable at all, but comes in handy!

    How are you going to write these algorithms when a pointer consumes
    all 64-bits of the register/memory container ?? VAS = 64-bits.

    You don't for they are not portable at all. However, on systems were we
    can steal some bits of a pointer value in C/C++, well, we can do it and create some interesting algorithms.

    another way to steal bits is over alignment.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Stefan Monnier@monnier@iro.umontreal.ca to comp.arch on Tue Dec 3 11:51:46 2024
    From Newsgroup: comp.arch

    another way to steal bits is over alignment.

    Yup. I keep lamenting that Alpha didn't go for bit-addressed memory,
    which would have given us 3 extra free bits from alignment (as well as
    allowing pointers to bits and bitfields).


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From John Levine@johnl@taugh.com to comp.arch on Tue Dec 3 18:19:51 2024
    From Newsgroup: comp.arch

    According to Stefan Monnier <monnier@iro.umontreal.ca>:
    another way to steal bits is over alignment.

    Yup. I keep lamenting that Alpha didn't go for bit-addressed memory,
    which would have given us 3 extra free bits from alignment (as well as >allowing pointers to bits and bitfields).

    I thought STRETCH persuaded people that bit addressable memory was a bad idea. Some of the 1970s Burroughs machines were bit addressable at the microcode level
    but I think they just used it to do different word sizes for different application
    microcode.

    The word=addressed PDP-6/10 could address bit fields just fine using byte pointers that had address, offset, and size fields. It had load and store byte, load and store after incrementing the pointer to the next byte, and on later models, advance the pointer by N bytes. It was nice but 95% of the time they were used in a single way to pack and unpack 7 bit ASCII characters in 36 bit words.

    R's,
    John
    --
    Regards,
    John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
    Please consider the environment before reading this e-mail. https://jl.ly
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Stefan Monnier@monnier@iro.umontreal.ca to comp.arch on Tue Dec 3 13:46:01 2024
    From Newsgroup: comp.arch

    another way to steal bits is over alignment.
    Yup. I keep lamenting that Alpha didn't go for bit-addressed memory,
    which would have given us 3 extra free bits from alignment (as well as >>allowing pointers to bits and bitfields).
    I thought STRETCH persuaded people that bit addressable memory was a bad idea.

    Yes, but that was a misunderstanding. I'm not suggesting that
    load/store instructions can access things at any bit position and any
    bit size. Any load or store with a pointer whose last 3 bits is not 0 would presumably signal en error.
    Just like the 21064 Alpha where they had byte-addressed memory but the load/store instructions could only handle aligned words.


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mitchalsup@mitchalsup@aol.com (MitchAlsup1) to comp.arch on Tue Dec 3 19:22:04 2024
    From Newsgroup: comp.arch

    On Tue, 3 Dec 2024 18:19:51 +0000, John Levine wrote:

    According to Stefan Monnier <monnier@iro.umontreal.ca>:
    another way to steal bits is over alignment.

    Yup. I keep lamenting that Alpha didn't go for bit-addressed memory,
    which would have given us 3 extra free bits from alignment (as well as >>allowing pointers to bits and bitfields).

    I thought STRETCH persuaded people that bit addressable memory was a bad idea.

    With the address space STRETCH had bit addressability IS a VERY bad
    Idea.

    We now have people (again) using the top bits of pointers for "special
    things".

    Thus the Ferris wheel of invention is caught in a loop.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From John Levine@johnl@taugh.com to comp.arch on Tue Dec 3 23:33:34 2024
    From Newsgroup: comp.arch

    According to Stefan Monnier <monnier@iro.umontreal.ca>:
    another way to steal bits is over alignment.
    Yup. I keep lamenting that Alpha didn't go for bit-addressed memory, >>>which would have given us 3 extra free bits from alignment (as well as >>>allowing pointers to bits and bitfields).
    I thought STRETCH persuaded people that bit addressable memory was a bad idea.

    Yes, but that was a misunderstanding. I'm not suggesting that
    load/store instructions can access things at any bit position and any
    bit size. Any load or store with a pointer whose last 3 bits is not 0 would >presumably signal en error.

    Seems like an odd place to put what are in practice just flag bits.

    Just like the 21064 Alpha where they had byte-addressed memory but the >load/store instructions could only handle aligned words.

    Well, we know how that turned out, not unlike the way IBM designed the 360
    to require data alignment, got badly bitten when they realized it broke a
    lot of Fortran programs, and added unaligned accesses in the 360/85.
    --
    Regards,
    John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
    Please consider the environment before reading this e-mail. https://jl.ly
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Stefan Monnier@monnier@iro.umontreal.ca to comp.arch on Tue Dec 3 18:52:10 2024
    From Newsgroup: comp.arch

    Yes, but that was a misunderstanding. I'm not suggesting that
    load/store instructions can access things at any bit position and any
    bit size. Any load or store with a pointer whose last 3 bits is not 0 would >>presumably signal en error.
    Seems like an odd place to put what are in practice just flag bits.

    It's a very natural one, tho. Byte addressing is somewhat arbitrary
    (why 8 bits, why not 16 or 4 or 6 or 9 ...?), whereas bit-addressing has
    some logic to it (fractional bit addressing would be hard to define).

    Just like the 21064 Alpha where they had byte-addressed memory but the >>load/store instructions could only handle aligned words.
    Well, we know how that turned out, not unlike the way IBM designed the 360
    to require data alignment, got badly bitten when they realized it broke a
    lot of Fortran programs, and added unaligned accesses in the 360/85.

    Yes, but contrary to the case for bytes, there is virtually (literally?)
    no code out there which expects non-byte-aligned memory accesses
    to work.

    It would suffer from some incompatibilities, of course, since +1 on
    a `char*` would correspond to +8 on the underlying integer, so I'd
    expect most `malloc` libraries to croak along with various other
    non-100% portable code, but what's a few incompatibility between
    friends, when you consider the fact that your architecture would be philosophically cleaner, able to point to bit fields, *and* grant
    3 extra tag bits to implementors of dynamically typed languages?


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Tue Dec 3 16:56:47 2024
    From Newsgroup: comp.arch

    On 12/3/2024 8:51 AM, Stefan Monnier wrote:
    another way to steal bits is over alignment.

    Yup. I keep lamenting that Alpha didn't go for bit-addressed memory,
    which would have given us 3 extra free bits from alignment (as well as allowing pointers to bits and bitfields).

    ;^)

    Wrt stealing bits I always revert back to the original pointer when I
    use it for anything to do with the system. Now, actually using the
    stolen bits, well we can over align on a _large_ boundary and use them
    for a smallish reference count and/or version counter. We can use them
    for state machines in some clever lock-free algorithms. We just need to
    only use the stolen bits for _our_ logic. Mask them off, get back to the original pointer "value" before we use that pointer for what's its
    pointing too. Never deference a pointer with stolen bits!!!!!!!!!!!!!!!!!!

    Fair enough?
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.arch on Tue Dec 3 17:03:15 2024
    From Newsgroup: comp.arch

    On 12/3/2024 11:22 AM, MitchAlsup1 wrote:
    On Tue, 3 Dec 2024 18:19:51 +0000, John Levine wrote:

    According to Stefan Monnier  <monnier@iro.umontreal.ca>:
    another way to steal bits is over alignment.

    Yup.  I keep lamenting that Alpha didn't go for bit-addressed memory,
    which would have given us 3 extra free bits from alignment (as well as
    allowing pointers to bits and bitfields).

    I thought STRETCH persuaded people that bit addressable memory was a bad
    idea.

    With the address space STRETCH had bit addressability IS a VERY bad
    Idea.

    We now have people (again) using the top bits of pointers for "special things".

    Thus the Ferris wheel of invention is caught in a loop.

    Stealing bit's wrt say, lock-free algorithms is usually about stealing
    from a pointer "value". think about C++'s std::uintptr_t, for a
    moment... Iirc, it may be optional, well, stealing bits from a pointer
    _value_ is non portable in and of itself. Although, they can be very
    useful, indeed... :^)
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.arch on Tue Dec 3 17:43:15 2024
    From Newsgroup: comp.arch

    anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
    [...]
    The technique of putting stuff in unused bits of an address has its drawbacks, but it also has benefits, in particular type information is
    often stored there (even on architectures that do not ignore any
    bits). Of course AMD and Intel have the bad examples of S/360 and
    68000 in mind, and did not want to have anything to do with that
    during the first two decades of AMD64.
    [...]

    One example of this that I haven't seen mentioned here is used by the C
    and C++ compilers for Cray vector machines (I've used the T90 and SV1).

    These systems had a 64-bit word size, and were heavily optimized
    for floating-point operations. Hardware addresses referred to 64-bit
    words. Compatibility with other systems required support for 8-bit
    bytes (CHAR_BIT==8). This was implemented in generated code by using
    the high-order 3 bits of an address as a byte offset.

    The fact that all byte addressing was implemented in software meant
    that, for example, string manipulation was remarkably slow -- but it
    worked.

    (I'm using the past tense because I don't know whether any of these
    systems are still in use.)
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mitchalsup@mitchalsup@aol.com (MitchAlsup1) to comp.arch on Wed Dec 4 02:19:52 2024
    From Newsgroup: comp.arch

    On Sun, 1 Dec 2024 14:40:33 +0000, Thomas Koenig wrote:

    David Schultz <david.schultz@earthlink.net> schrieb:
    On 12/1/24 8:03 AM, Thomas Koenig wrote:
    I think "ALU can add up to n-bit numbers" is a reasonable definition
    for an n-bit architecture, which also fits the 16-bit 68000.
    It does not fit the 360/30, or the Nova (but see de Castro's remark
    on the latter).
    Or the CDP1802. 8 bit accumulator and 1 bit ALU.

    Or the PDP-8/S...

    We who used a PDP-8S considered it a (slow) 12-bit machine.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mitchalsup@mitchalsup@aol.com (MitchAlsup1) to comp.arch on Wed Dec 4 02:36:21 2024
    From Newsgroup: comp.arch

    On Tue, 3 Dec 2024 23:52:10 +0000, Stefan Monnier wrote:

    Yes, but that was a misunderstanding. I'm not suggesting that
    load/store instructions can access things at any bit position and any
    bit size. Any load or store with a pointer whose last 3 bits is not 0
    would
    presumably signal en error.
    Seems like an odd place to put what are in practice just flag bits.

    It's a very natural one, tho. Byte addressing is somewhat arbitrary
    (why 8 bits, why not 16 or 4 or 6 or 9 ...?), whereas bit-addressing has
    some logic to it (fractional bit addressing would be hard to define).

    Various architectures used 6-bit characters--you get 64 characters which
    is good enough for the 16 letters, 10 digits, and all the pnctuation +-*/&|^(){}[]_ ... Realistically, you do not need 7-bit characters until
    you add lower case. AND there are some situations where 9-bit characters
    would be superior to 8-bit ones.

    8-bits won because it was enough (at the time of inception {IBM
    360--1963})
    we had no need for larger character sets. That need did not arise until
    word processors were created (late 1980s) and by then 8-bit characters
    were standard.

    Just like the 21064 Alpha where they had byte-addressed memory but the >>>load/store instructions could only handle aligned words.
    Well, we know how that turned out, not unlike the way IBM designed the
    360
    to require data alignment, got badly bitten when they realized it broke
    a
    lot of Fortran programs, and added unaligned accesses in the 360/85.

    Yes, but contrary to the case for bytes, there is virtually (literally?)
    no code out there which expects non-byte-aligned memory accesses
    to work.

    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.

    (*) MIPS LD/ST left/right still requires SW to be aware of the
    misalignment so the compiler can emit enough instructions. How
    much easier is it if the compiler remains blissfully unaware of
    any misalignment.

    It would suffer from some incompatibilities, of course, since +1 on
    a `char*` would correspond to +8 on the underlying integer, so I'd
    expect most `malloc` libraries to croak along with various other
    non-100% portable code, but what's a few incompatibility between
    friends, when you consider the fact that your architecture would be philosophically cleaner, able to point to bit fields, *and* grant
    3 extra tag bits to implementors of dynamically typed languages?


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mitchalsup@mitchalsup@aol.com (MitchAlsup1) to comp.arch on Wed Dec 4 02:42:40 2024
    From Newsgroup: comp.arch

    On Wed, 4 Dec 2024 1:43:15 +0000, Keith Thompson wrote:

    anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
    [...]
    The technique of putting stuff in unused bits of an address has its
    drawbacks, but it also has benefits, in particular type information is
    often stored there (even on architectures that do not ignore any
    bits). Of course AMD and Intel have the bad examples of S/360 and
    68000 in mind, and did not want to have anything to do with that
    during the first two decades of AMD64.
    [...]

    One example of this that I haven't seen mentioned here is used by the C
    and C++ compilers for Cray vector machines (I've used the T90 and SV1).

    These systems had a 64-bit word size, and were heavily optimized
    for floating-point operations. Hardware addresses referred to 64-bit
    words. Compatibility with other systems required support for 8-bit
    bytes (CHAR_BIT==8). This was implemented in generated code by using
    the high-order 3 bits of an address as a byte offset.

    The fact that all byte addressing was implemented in software meant
    that, for example, string manipulation was remarkably slow -- but it
    worked.

    Circa 1983: Lee Higbe (a CRAY compiler writer) told me that the symbol
    table lookup process had been completely vectorized and this is why the
    CRAY complier and assembler were so fast. Apparently, identifying
    symbols and looking them up in the symbol table had been nearly
    complete-
    ly vectorized.

    So, maybe C string functions are slow on word accessed CRAY machines,
    But identifying what string of characters is a name and looking it up
    in a symbol table CAN be vectorized with the semantics of normal
    languages if not with the C intrinsics.

    (I'm using the past tense because I don't know whether any of these
    systems are still in use.)
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From John Levine@johnl@taugh.com to comp.arch on Wed Dec 4 03:25:41 2024
    From Newsgroup: comp.arch

    According to MitchAlsup1 <mitchalsup@aol.com>:
    Or the CDP1802. 8 bit accumulator and 1 bit ALU.

    Or the PDP-8/S...

    We who used a PDP-8S considered it a (slow) 12-bit machine.

    It was clearly a 12 bit machine, just like a 360/30 was a 32 bit machine.

    Yeah, the internal implementations were narrower but that wasn't visible
    to the programmer beyond the slowness.
    --
    Regards,
    John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
    Please consider the environment before reading this e-mail. https://jl.ly
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Thomas Koenig@tkoenig@netcologne.de to comp.arch on Wed Dec 4 06:29:23 2024
    From Newsgroup: comp.arch

    MitchAlsup1 <mitchalsup@aol.com> schrieb:

    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.

    This option is violated by all compilers that I currently have
    access to, and is also incompatible with, for exmaple, the x86_64
    ABI on Linux (which requires alignment as if for C structs).

    For gfortran, you need a special flag to enforce it.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Stefan Monnier@monnier@iro.umontreal.ca to comp.arch on Wed Dec 4 10:32:58 2024
    From Newsgroup: comp.arch

    Yes, but contrary to the case for bytes, there is virtually (literally?)
    no code out there which expects non-byte-aligned memory accesses
    to work.
    FORTRAN COMMON blocks require misaligned accesses to double precision
    data.

    I don't think FORTRAN stipulate this also applies to sub-byte alignment.


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Stefan Monnier@monnier@iro.umontreal.ca to comp.arch on Wed Dec 4 10:37:52 2024
    From Newsgroup: comp.arch

    Never deference a pointer with stolen bits!!!!!!!!!!!!!!!!!!
    Fair enough?

    +1


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From scott@scott@slp53.sl.home (Scott Lurndal) to comp.arch on Wed Dec 4 16:31:25 2024
    From Newsgroup: comp.arch

    mitchalsup@aol.com (MitchAlsup1) writes:
    On Tue, 3 Dec 2024 23:52:10 +0000, Stefan Monnier wrote:

    Yes, but that was a misunderstanding. I'm not suggesting that >>>>load/store instructions can access things at any bit position and any >>>>bit size. Any load or store with a pointer whose last 3 bits is not 0
    would
    presumably signal en error.
    Seems like an odd place to put what are in practice just flag bits.

    It's a very natural one, tho. Byte addressing is somewhat arbitrary
    (why 8 bits, why not 16 or 4 or 6 or 9 ...?), whereas bit-addressing has
    some logic to it (fractional bit addressing would be hard to define).

    Various architectures used 6-bit characters--you get 64 characters which
    is good enough for the 16 letters, 10 digits, and all the pnctuation >+-*/&|^(){}[]_ ... Realistically, you do not need 7-bit characters until
    you add lower case. AND there are some situations where 9-bit characters >would be superior to 8-bit ones.

    8-bits won because it was enough (at the time of inception {IBM
    360--1963})

    8-bits is also a convenient multiple of four bits, which was common
    in many machines prior to the 360. The hardware in burroughs
    BCD machines could automatically add/remove the zone digit (bits <7:4>)
    during data movement.

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mitchalsup@mitchalsup@aol.com (MitchAlsup1) to comp.arch on Wed Dec 4 19:47:12 2024
    From Newsgroup: comp.arch

    On Wed, 4 Dec 2024 15:32:58 +0000, Stefan Monnier wrote:

    Yes, but contrary to the case for bytes, there is virtually (literally?) >>> no code out there which expects non-byte-aligned memory accesses
    to work.
    FORTRAN COMMON blocks require misaligned accesses to double precision
    data.

    I don't think FORTRAN stipulate this also applies to sub-byte alignment.

    FORTRAN (of that era) only had words and then went on to describe
    double precision FP to take 2 of those words without specifying
    any additional alignment criteria.

    Later Fortrans (from FORTRAN 77, WATfor, and WATfiv) we have Character*1


    Stefan
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.arch on Wed Dec 4 15:47:23 2024
    From Newsgroup: comp.arch

    Stefan Monnier <monnier@iro.umontreal.ca> writes:
    Yes, but contrary to the case for bytes, there is virtually (literally?) >>> no code out there which expects non-byte-aligned memory accesses
    to work.
    FORTRAN COMMON blocks require misaligned accesses to double precision
    data.

    I don't think FORTRAN stipulate this also applies to sub-byte alignment.

    I see that you use Gnus, the same newsreader I use.

    When you post a followup, Gnus automatically adds attribution lines,
    like the "Stefan Monnier <monnier@iro.umontreal.ca> writes:" line in
    this post. Please leave those lines in place. It makes it easier to
    follow conversations. (Yes, readers can typically jump to the parent
    article, but it's not always easy to do that or to get back to the
    current article.)
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.20a-Linux NewsLink 1.114