To view parent comment, click here.
To read all comments associated with this story, please click here.
renox,
"I also prefer MIPS ISA because it can trap on integer overflow which is nice for efficient Ada compilation. "
You may be right about mips handling overflow better than x86, but I actually don't mind the way the x86 does it.
ADD [edi], dword 5 # cause overflow
JO xyz # optionally handle overflow
INTO # generate an interrupt on overflow
ADC [edi+4], dword 0 # add carry
CMOVO [edi], ... # clip the range
# do nothing, modulo arithmetic is often desirable.
"But unfortunately nearly nobody use a language with this (nice) behaviour instead of stupid C/C++ or Java's behaviour on integer overflow, so it doesn't really matter"
I share the same gripe of the C language. It offers no way to use or act upon the overflow, leading to less efficient algorithms.
Also, I think modulo arithmetic should be made explicit. Languages like C/Java that implicitly discard overflow information lead to bugs regardless of architecture. New languages should automatically assert errors on overflow unless told to do otherwise.
*: not 100% true even if both operations have the same performance because "trap on overflow" allow less reorganization than modulo arithmetic.





Member since:
2005-07-06
I also prefer MIPS ISA because it can trap on integer overflow which is nice for efficient Ada compilation.
But unfortunately nearly nobody use a language with this (nice) behaviour instead of stupid C/C++ or Java's behaviour on integer overflow, so it doesn't really matter: both ISAs are quite nice, much better than x86 anyway.