If you go back to the early to mid 1960s, in the mainframe era, at least
the IBM S/360 series and the Univac 1100 series only had signed
numbers.
I don't know about Univac, but the S/360 certainly supported unsigned >arithmetic. They even had two versions of add instructions, which seems >strange for a two's complement machine, but they set flags differently,
of which the /360 had too few.
According to Thomas Koenig <tkoenig@netcologne.de>:
the S/360 certainly supported unsigned
arithmetic. They even had two versions of add instructions, which seems >>strange for a two's complement machine, but they set flags differently,
of which the /360 had too few.
More important, signed add and subtract can trap on overflow, unsigned
can't.
The unsigned condition codes tell you whether there was a carry
which makes multiple precision artithmetic a lot simpler.
John Levine <johnl@taugh.com> writes:
According to Thomas Koenig <tkoenig@netcologne.de>:
the S/360 certainly supported unsigned
arithmetic. They even had two versions of add instructions, which seems >>>strange for a two's complement machine, but they set flags differently, >>>of which the /360 had too few.
More important, signed add and subtract can trap on overflow, unsigned >>can't.
I dimly remember (coreectly?) that there is a way to disable the
trapping.
The unsigned condition codes tell you whether there was a carry
which makes multiple precision artithmetic a lot simpler.
S/360 has no add with carry-in. That was only added in ESA390. So >multi-precision integer arithmetic on S/360 is similarly complicated
as on MIPS or RISC-V.
According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
S/360 has no add with carry-in. That was only added in ESA390. So >>multi-precision integer arithmetic on S/360 is similarly complicated
as on MIPS or RISC-V.
Also right, you had to test the condition code and propagate the carry >yourself. It took 30 years before they added add-with-carry so it
evidently wasn't urgent. It was added to zArchitecture and then
backported to the ESA/390 mode on z.
And I guess that it has not been important for IBM mainframes when
ESA/390 (1990) was designed. Public-key cryptrography only became a
thing with ssh (1995) and SSL 2.0 (1995; SSL 1.0 was never released),
Overall, the whole flags topic looks like the unloved stepchild of
computer architecture that often is designed in as an afterthought.
This shows in the S/360 dedicating only two bits to flags, so they had
to multiplex their meanings, depending on the setting instructions.
And it shows in the fact that ARM A64 has only a single condition-code >register,
John Levine <johnl@taugh.com> writes:
According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
S/360 has no add with carry-in. That was only added in ESA390. So >>multi-precision integer arithmetic on S/360 is similarly complicated
as on MIPS or RISC-V.
Also right, you had to test the condition code and propagate the carry >yourself. It took 30 years before they added add-with-carry so it >evidently wasn't urgent. It was added to zArchitecture and then
backported to the ESA/390 mode on z.
So, even later than ESA/390. Interestingly, the IBM 704 has add with carry-in. My guess is that they already had the hardware thanks to sign-magnitude representation (which is implemented as ones-complement
with additional inversion steps AFAIK), so why not provide an
instruction. Or maybe the S/360 architects just thought so, and
considered carry-in just a piece of baggage from
sign-magnitude/1s-complement architectures that they wanted to get rid
of.
And I guess that it has not been important for IBM mainframes when
ESA/390 (1990) was designed. Public-key cryptrography only became a
thing with ssh (1995) and SSL 2.0 (1995; SSL 1.0 was never released),
and I expect that in those years the IBM mainframes tended not to be connected to the Internet, so ssh and SSL were not important for them.
PGP was released in 1991, but adoption has not been strong, and
performance not a big issue; I think that only ssh and especially SSL
made demands for public-key cryptography and therefore multi-precision arithmetics show up on the radar of computer companies.
Similarly, for MIPS (1986) and Alpha (1992), public-key crypto was not
a thing when they were designed. What is more surprising is that
RISC-V designers have acted and are still acting as if it was still
the 1980s.
Overall, the whole flags topic looks like the unloved stepchild of
computer architecture that often is designed in as an afterthought.
This shows in the S/360 dedicating only two bits to flags, so they had
to multiplex their meanings, depending on the setting instructions.
It shows in the fact that RISC-V has no flags, and needs 5
instructions for a carry-in carry-out addition. It shows in PowerPC
and 88000 have a single carry-flag tacked on outside their usual
flag-handling infrastructure, which is ironic, because the carry flag--- Synchronet 3.22a-Linux NewsLink 1.2
is the one that has the highest need for several instances, at least
for programming languages like C with short-circuit evaluation.
And it shows in the fact that ARM A64 has only a single condition-code register, with the instructions designed such that it needs separate
renaming from the GPRs; if every instruction that writes a register
sets all the flags and vice versa, the flags can be renamed with the
GPRs (i.e., it would have the same implementation as my extended GPRs,
but the architecture would make flag-reading implicit, and it would
use only the instance from the most recent result). Having flags like
ARM A32/T32 rather than, e.g., what 88000 or IA-64 have was probably
natural for ARM A64, but if they designed it like I suggest above, the
recent implementations without ARM A32/T32 support would be cheaper to implement.
- anton
anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
John Levine <johnl@taugh.com> writes:
According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
S/360 has no add with carry-in. That was only added in ESA390. So
multi-precision integer arithmetic on S/360 is similarly complicated
as on MIPS or RISC-V.
Also right, you had to test the condition code and propagate the carry
yourself. It took 30 years before they added add-with-carry so it
evidently wasn't urgent. It was added to zArchitecture and then
backported to the ESA/390 mode on z.
So, even later than ESA/390. Interestingly, the IBM 704 has add with
carry-in. My guess is that they already had the hardware thanks to
sign-magnitude representation (which is implemented as ones-complement
with additional inversion steps AFAIK), so why not provide an
instruction. Or maybe the S/360 architects just thought so, and
considered carry-in just a piece of baggage from
sign-magnitude/1s-complement architectures that they wanted to get rid
of.
In my opinion, S/360 did not have carry (anywhere) because they (IBM)
thought the decimal arithmetic would handle "long integer" calculations.
In my opinion, S/360 did not have carry (anywhere) because they (IBM)
thought the decimal arithmetic would handle "long integer" calculations.
Or maybe the S/360 architects just thought so, and
considered carry-in just a piece of baggage from
sign-magnitude/1s-complement architectures that they wanted to get rid
of.
However, if that was the reason, then the 1130 should have add with
carry in, and I doubt that.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 74 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 121:09:25 |
| Calls: | 1,194 |
| Files: | 1,352 |
| Messages: | 290,208 |