[Llvm-bgq-discuss] Does anyone use math-function errno?

Jeff Hammond jhammond at alcf.anl.gov
Thu Aug 29 11:28:17 CDT 2013


I never check errno period.  I think the entire concept is stupid.  Functions that don't return useful error codes directly are stupid.

Jeff

----- Original Message -----
> From: "Hal Finkel" <hfinkel at anl.gov>
> To: llvm-bgq-discuss at lists.alcf.anl.gov
> Sent: Thursday, August 29, 2013 9:09:33 AM
> Subject: [Llvm-bgq-discuss] Does anyone use math-function errno?
> 
> I'm looking for user feedback here:
> 
> Currently, Clang on Linux (and, thus, on the BG/Q) uses -fmath-errno
> as the default setting. This means that it recognizes that math
> functions (like sqrt for example) might set the global (per-thread)
> errno variable in error situations. This limits a number of
> optimizations that can be performed (including preventing these libm
> math functions from being autovectorized). This is turned off in
> fast-math mode (with -ffast-math), but some systems (such as Mac OS
> X) also have it turned off in general (meaning that -fno-math-errno
> is the system wide default).
> 
> I'll note that bgxlc uses its equivalent of fast-math mode by default
> at -O3 and higher, and I'm sure that I'd like to go that far. But,
> in my experience, I've not seen a science code that actually checked
> errno after calling a libm math function. As a result, I'm
> considering making the BG/Q Clang default, like on Mac OS X, be
> -fno-math-errno. In this way, by default, we'll get stronger
> optimizations around calls to libm functions (including
> autovectorization). If anyone has an opinion here, please share.
> 
> Thanks again,
> Hal
> 
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> _______________________________________________
> llvm-bgq-discuss mailing list
> llvm-bgq-discuss at lists.alcf.anl.gov
> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> 

-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
ALCF docs: http://www.alcf.anl.gov/user-guides



More information about the llvm-bgq-discuss mailing list