Re: Subtraction + comparison in one asm instruction?

"Gabriel Dos Reis" <gdr@soliton.integrable-solutions.net>
3 Sep 2002 00:08:12 -0400

          From comp.compilers

Related articles
Subtraction + comparison in one asm instruction? vincent+news@vinc17.org (Vincent Lefevre) (2002-08-10)
Re: Subtraction + comparison in one asm instruction? Peter-Lawrence.Montgomery@cwi.nl (Peter L. Montgomery) (2002-08-14)
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)
[7 later articles]
| List of all articles for this month |
From: "Gabriel Dos Reis" <gdr@soliton.integrable-solutions.net>
Newsgroups: comp.compilers
Date: 3 Sep 2002 00:08:12 -0400
Organization: CodeSourcery, LLC
References: 02-08-033 02-08-044 02-08-064
Keywords: architecture, arithmetic
Posted-Date: 03 Sep 2002 00:08:12 EDT

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


[...]


| In my code, if c - 1 is not representable, this is an undefined
| behaviour. Thus the compiler could choose to do anything in this
| case and the optimization would be valid


Unless the implementation chooses to bind to other contraints where
the C standard leaves the issue implementation-defined or undefined.
It is quite reasonable to expect an underflow trap/exception, if such
a thing is supported by the executing environment (e.g. conforming to
"Language Independent Arithmetic, part 1"). In that case, I would not
like to see the compiler deliberately suppress that expectation in my
codes.


One of the purposes of the C standards leaving some behaviour undefined
is to give implementations the opportunities to satisfy other "bindings".


| (if there are problems
| with some codes, the compiler could still provide switches to
| disable the optimization for such broken codes).


Err, the codes aren't necessarily broken. It may just be that the
inputs are exercising boundary values.


-- Gaby


Post a followup to this message

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