Re: Subtraction + comparison in one asm instruction?

"Gabriel Dos Reis" <gdr@integrable-solutions.net>
12 Sep 2002 00:27:23 -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)
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)
[5 later articles]
| List of all articles for this month |

From: "Gabriel Dos Reis" <gdr@integrable-solutions.net>
Newsgroups: comp.compilers
Date: 12 Sep 2002 00:27:23 -0400
Organization: Linux Private Site
References: 02-08-033 02-08-044 02-08-064 02-09-006 02-09-038
Keywords: architecture
Posted-Date: 12 Sep 2002 00:27:23 EDT

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


> Gabriel Dos Reis <gdr@soliton.integrable-solutions.net> wrote:
>
> > 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.
>
> In all the cases I've tested, there was no support for underflow trap,


Then, you're not lucky enough :-)


Note that in most cases, "installing traps" happens behind the back of
the compilers (when it doesn't provide switch to tell). So, when the
compiler doesn't have direct knowledge of the CPU status, it just lets
things fall through and see what happens.


It is true that for floating point types (not your primary concern
here), C99 tries to rule the land through use of #pragmas and #dogmas.
But yes, GCC -- in your example -- has long road to make before making
consistent decisions based on predictable rules.


[...]


> 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.


Yes, if underflow/overflow traps are *directly* supported by the
compiler, then indeed you have a point.


-- Gaby


Post a followup to this message

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