Re: Subtraction + comparison in one asm instruction?

"Sander Vesik" <sander@haldjas.folklore.ee>
12 Nov 2002 14:05:37 -0500

          From comp.compilers

Related articles
[10 earlier articles]
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? anton@mips.complang.tuwien.ac.at (Anton Ertl) (2002-09-14)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-09-14)
Re: Subtraction + comparison in one asm instruction? vbdis@aol.com (VBDis) (2002-09-19)
Re: Subtraction + comparison in one asm instruction? anton@mips.complang.tuwien.ac.at (Anton Ertl) (2002-09-19)
Re: Subtraction + comparison in one asm instruction? joachim_d@gmx.de (Joachim Durchholz) (2002-09-19)
Re: Subtraction + comparison in one asm instruction? sander@haldjas.folklore.ee (Sander Vesik) (2002-11-12)
Re: Subtraction + comparison in one asm instruction? sander@haldjas.folklore.ee (Sander Vesik) (2002-11-12)
Re: Subtraction + comparison in one asm instruction? jvorbrueggen@mediasec.de (Jan C. =?iso-8859-1?Q?Vorbr=FCggen?=) (2002-11-13)
| List of all articles for this month |
From: "Sander Vesik" <sander@haldjas.folklore.ee>
Newsgroups: comp.compilers
Date: 12 Nov 2002 14:05:37 -0500
Organization: ERA/EKI FO
References: 02-09-038 02-09-076 02-09-079
Keywords: architecture, arithmetic
Posted-Date: 12 Nov 2002 14:05:37 EST

Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
> "VBDis" <vbdis@aol.com> writes:
>
>> The conversion of formulas,
>> according to algebraic rules, IMO is independent from the ranges of
>> the data types which are used in actual source code.
>
> No, that is not true in C, nor in C++ for example.
>
> On a machine set up to trap when an overflow occurs, the behaviour for
> the strict semantics of "(x + 1) - 1" is to trap when
> x == INT_MAX for example, while the transformed version will not trap:
> The net result is that the semantics of the transformed expression no
> longr match that of the untouched one.


It would be far easier to do such an optimisation only on machines
without over/underflow traps. Seeing their machine being the slowest
around would then teach the machine manufacturers to not make such in
the future...
--
Sander


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.