Re: Subtraction + comparison in one asm instruction?

"VBDis" <vbdis@aol.com>
12 Sep 2002 00:29:40 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Subtraction + comparison in one asm instruction? iddw@hotmail.com (Dave Hansen) (2002-08-14)
Re: Subtraction + comparison in one asm instruction? walter@bytecraft.com (Walter Banks) (2002-08-23)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-08-23)
Re: Subtraction + comparison in one asm instruction? gdr@soliton.integrable-solutions.net (Gabriel Dos Reis) (2002-09-03)
Re: Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-09-08)
Re: Subtraction + comparison in one asm instruction? gdr@integrable-solutions.net (Gabriel Dos Reis) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? vbdis@aol.com (VBDis) (2002-09-12)
Re: Subtraction + comparison in one asm instruction? gdr@integrable-solutions.net (Gabriel Dos Reis) (2002-09-12)
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)
[4 later articles]
| List of all articles for this month |

From: "VBDis" <vbdis@aol.com>
Newsgroups: comp.compilers
Date: 12 Sep 2002 00:29:40 -0400
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
References: 02-09-038
Keywords: arithmetic
Posted-Date: 12 Sep 2002 00:29:40 EDT

"Vincent Lefevre" <vincent+news@vinc17.org> schreibt:


>If underflow/overflow traps are supported, there could
>be a compiler switch to allow the user to say that he has proved that
>there are no overflows in his program, so that such optimizations
>could be performed for speed-critical programs.


IMO the side effects of optimization are unpredictable for
sub-expressions. Either you expect (x+1-1) being optimized into a
NOP, what certainly will produce the correct result, or you expect
that all intermediate steps are executed exactly as given in the
source code, with no optimizations inside expressions.


Optimized code must produce the same /results/ as non-optimized code,
but the compiler is free to modify and rearrange all the /intermediate
steps/ which are required to yield that result.


The substition of (x+1-1) by (x) is an algebraic operation, which can
be performed before a compiler creates code for that expression, and
it can be made in the source code as well. 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. Otherwise all the
variables, constants and operators in formulas must be attributed with
explicit rules, which define their intended deviation from the common
algebraic rules (commutativity, associativity...). (I hope to have
found the appropriate English terms)


DoDi


Post a followup to this message

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