Hi all,

While I was working on the BitOps library, I noticed that using compiler
intrinsics wasn't actually giving a performance increase. In fact, some
compiler's intrinsics would actually perform worse than my versions of the
operations that were plain C. The problem boils down to that unless you
tell the compiler to optimize for a specific architecture or instruction
set it assumes that those instructions are not available for use.

The easy way to tell the compiler (gcc/clang/intel) about these featuers
is by setting '-march=native' when compiling [0]. This tells the compiler
to detect and use any features available in the host processor, but it
creates a non-portable binary. The problem with that is we cross-compile
often.  Beyond 'native' there are a large number of processor
architectures available for -march. There are also flags to enable support
for a specific instruction sets in the form of the -msse, -msse2, -mavx
and several others.


So we need some way to specify the minimum feature set for compilation. To
complicate things further, we'd like to use these settings while compiling
the runtime. In addition, even though -march=native is shared across
intel, clang, and gcc, for anything other than 'native' intel uses
different values than clang/gcc. The values gcc uses vary from version to
version as well.

All of this together means that we probably have to add an user
configurable setting along the lines of 'CHPL_RT_ARCH' and/or
'CHPL_RT_INSTRUCTION_SETS' and provide no default value. An alternative
would be to use -march=native when nothing has been given, unless we are
in a known cross-compilation setting (PrgEnv-*).

So that is the gist of it. Does anyone have thoughts or preferences on
this?

Thanks,

-Kyle

[0] For a good overview on these settings see:
    https://wiki.gentoo.org/wiki/GCC_optimization#The_basics


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to