jacob navia <> writes:
> Le 29/12/10 22:45, Keith Thompson a écrit :
>> jacob navia<> writes:
>> [...]
>>> There is no processor that hasn't an overflow flag.
>> [...]
>>
>> I don't believe this is correct. In fact I seem to recall that
>> concrete counterexamples have been posted here.
>>
>
> Sure the DeathStar 9000... I know. But in that machine you can
> always test for overflow as stated in the FAQ...
No, I am not referring to the DeathStar 9000. I am referring to a
specific real-world microprocessor that does not have an overflow
flag. (The DEC/Compaq/HP Alpha, perhaps?) I don't remember the
details; perhaps someone else can dig them up.
>> And even if you're right, are you sure that all CPUs' overflow
>> flags behave the same way as the x86 overflow flag?
>>
>
> I haven't come around a processor that couldn't test for overflow.
That wasn't the question. Are you sure that all CPUs' overflow
flags behave the same way as the x86 overflow flag? Is the flag
always set or cleared in the same circumstances?
> Maybe there are some micro-controllers that do not have that, but...
>
> who cares?
Anyone who either uses those micro-controllers or who care about
portable code.
>> Performing a simple arithmetic operation with a check for overflow
>> is a fundamental operation, and I do find it frustrating that C
>> doesn't support it directly and makes it inordinately difficult to
>> support it indirectly. I'd love to see a good clean way to do this.
>> I just don't think that adding an intrinsic that queries the overflow
>> flag is the way to do it.
>>
>
> I have never said that there should be "an intrinsic". That is how
> it can be implemented it in the Power PC, for instance, or in the intel
> machines, but it could be implemented differently in other machines.
>
> You are reading things I did not write. Please keep centered in
> what I actually said.
Ok. What you actually said is "There is no processor that hasn't an
overflow flag". As I said, I don't believe that's correct.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"