Liste des Groupes | Revenir à c arch |
David Brown <david.brown@hesbynett.no> schrieb:Sure. But not all processors are big enough to support such exceptions - many of those I have used are really small. (An "unimplemented instruction" exception also lets you use it for non-nefarious purposes, such as supporting binary compatibility with other members of the processor family, or as convenient user extensions.)On 16/09/2024 09:17, Thomas Koenig wrote:A much better idea is to raise an exception, that way you canDavid Brown <david.brown@hesbynett.no> schrieb:>On 14/09/2024 21:26, Thomas Koenig wrote:>MitchAlsup1 <mitchalsup@aol.com> schrieb:>
>In many cases int is slower now than long -- which violates the notion>
of int from K&R days.
That's a designers's choice, I think. It is possible to add 32-bit
instructions which should be as fast (or possibly faster) than
64-bit instructions, as AMD64 and ARM have shown.
>
For some kinds of instructions, that's true - for others, it's not so
easy without either making rather complicated instructions or having
assembly instructions with undefined behaviour (imagine the terror that
would bring to some people!).
It has happened, see the illegal (but sometimes useful)
6502 instructions, or the recent RISC-V implementation snafu
(GhostWrite).
I have seen plenty of undefined behaviour in ISA's over the years. (A
very common case is that instruction encodings that are not specified
are left as UB so that later extensions to the ISA can use them.)
be sure that nobody uses it for nefarious purposes.
Yes.I wasHard to see how this would be possible... but I realize this
just thinking of the reactions you'd get if you made an ISA where
attempting to overflow signed integer arithmetic was UB at the hardware
level, so that you could get faster and simpler instructions.
is a hypothetical example.
Les messages affichés proviennent d'usenet.