http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57202



             Bug #: 57202

           Summary: Please make the intrinsics headers like immintrin.h be

                    usable without compiler flags

    Classification: Unclassified

           Product: gcc

           Version: 4.8.1

            Status: UNCONFIRMED

          Severity: enhancement

          Priority: P3

         Component: other

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: thi...@kde.org





Please make all headers for intrinsics be includable without special compiler

flags.



In other words, I want the following to work:



$ gcc -fsyntax-only -include smmintrin.h -xc /dev/null

In file included from <command-line>:0:0:

/usr/lib/gcc/x86_64-redhat-linux/4.7.2/include/smmintrin.h:31:3: error: #error

"SSE4.1 instruction set not enabled"



Note it works with ICC:

$ icc -fsyntax-only -include smmintrin.h -xc /dev/null && echo works

works





Not only that, please make all the intrinsics functions be defined and ready to

be used.



This is necessary so that the following source file could compile even if

-msse4.1 is not passed on the command-line (adapted from

http://gcc.gnu.org/gcc-4.8/changes.html):



#include <smmintrin.h>



 __attribute__ ((target ("default")))

int foo(void)

{

  return 1;

}



__attribute__ ((target ("sse4.2")))

int foo(void)

{

  __m128i v;

  _mm_blendv_epi8(v, v, v);

  return 2;

}



There are several reasons for that, number one among them that it makes the GCC

4.8 feature above actually useful for non-trivial code. Also, passing extra

options on the command-line are simply not an option for C++ code (where the

feature above is useful) if that code is moderately complex and uses inline

functions, and those options cannot be used if LTO is to be used (bug 54231).

Reply via email to