This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: IEEE inexact-flag not working on the Alpha (despite -mieee-with-inexact)?
- From: Roberto Bagnara <bagnara at cs dot unipr dot it>
- To: tprince at computer dot org
- Cc: gcc at gcc dot gnu dot org, "The Parma Polyhedra Library developers' list" <ppl-devel at cs dot unipr dot it>
- Date: Thu, 18 Sep 2008 15:17:41 +0200
- Subject: Re: IEEE inexact-flag not working on the Alpha (despite -mieee-with-inexact)?
- References: <48D23D14.2030006@cs.unipr.it> <48D26FA7.4000503@sbcglobal.net>
Tim Prince wrote:
Roberto Bagnara wrote:
#include <fenv.h>
#include <cstdio>
int main() {
float x = 2;
float y = 3;
feclearexcept(FE_INEXACT);
x = x / y;
printf("%d %.1000g\n", fetestexcept(FE_INEXACT) != 0, x);
}
Is this a way of testing whether the division is performed at compile
time? Do you call it a bug if constant propagation occurs when you don't
take action to prevent it?
Hi Tim,
I am not sure I understand your message. However, before mailing I did
check that constant propagation is not an issue by checking the generated
assembly:
ldq $27,feclearexcept($29) !literal!2
jsr $26,($27),0 !lituse_jsr!2
ldah $29,0($26) !gpdisp!3
lda $29,0($29) !gpdisp!3
lds $f11,20($15)
lds $f10,16($15)
divs/sui $f11,$f10,$f12
trapb
cpys $f12,$f12,$f10
sts $f10,20($15)
ldah $16,32($31)
ldq $27,fetestexcept($29) !literal!4
jsr $26,($27),0 !lituse_jsr!4
Note that I am not compiling with optimizations and that the
divs/sui opcode is generated.
All the best,
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it