http://llvm.org/bugs/show_bug.cgi?id=15282

            Bug ID: 15282
           Summary: clang 3.2 generates buggy code from AVX + FMA
                    instrinsics
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The code in question is the GROMACS molecular dynamics simulation package
(www.gromacs.org). GROMACS, an HPC code, has a heavily optimized C codebase. It
is widely used in academia, is and available through packages in all major
Linux distributions, and it is the "engine" of Folding@Home.

The new 4.6 release includes, among others, AVX + FMA SIMD kernels. These
kernels do compile, but the generate code that seems to be incorrect. The code
compiles and runs fine (i.e passes our regressiontests) with gcc and msvc as
well as icc (using FMA3).

I know that a limited repro case would be preferred, but that is rather
difficult toa achieve.

However, reproducing hte issue is fairly simple and can be summarized in a few
steps:

* Get the code:

Release 4.6:
wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.tar.gz

or the current stable development version:
git clone git://git.gromacs.org/gromacs -b release-4-6 gromacs-4.6

* Build the code and execute regressiont tests (requires and AMD Bulldozer or
Piledriver CPU!):
mkdir build_gmx_avx && cd build_gmx_avx && CC=clang-3.2 cmake ../gromacs-4.6
-DGMX_CPU_ACCELERATION=AVX_128_FMA -DREGRESSIONTEST_DOWNLOAD=ON && make check

Most of the tests will fail.

* If you now build with the SSE4.1 SIMD kernels the tests will pass:

mkdir build_gmx_sse41 && cd build_gmx_sse41 && CC=clang-3.2 cmake
../gromacs-4.6 -DGMX_CPU_ACCELERATION=SSE4.1 -DREGRESSIONTEST_DOWNLOAD=ON &&
make check

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to