This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/44534] New: _builtin_ia32_vextractf128_si256(X,N) acts as if N was always set to 1.


the avx built-in   _builtin_ia32_vextractf128_si256(X,N) acts as if the
immediate N was always set to 1.

to isolate the problem I compiled 2 programs:
---------------------------
#include <immintrin.h>

int main()       
{ 
  __m256i c = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);  
  __m128i d =  (__m128i)__builtin_ia32_vextractf128_si256( (__v8si)c, 1); 
   return 0;  
} 
----------------------------

and

--------------------------
#include <immintrin.h>

int main()       
{ 
  __m256i c = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);  
  __m128i d =  (__m128i)__builtin_ia32_vextractf128_si256( (__v8si)c, 0); 
   return 0;  
} 
----------------------------

with 
 gcc-4.5 pipo0.cpp -mavx -o pipo0
and
 gc-4.5 pipo1.cpp -mavx -o pipo1

the two binaries generated are identical

and both use 

vextractf128 $0x1,%ymm0,%xmm0

in the assembler output from embroider


programs using ouputs were also tested and provide always the ouput 
5 6 7 8 for d (never 1 2 3 4)
--------------------------------------------------------
 gcc-4.5 -v
Using built-in specs.
COLLECT_GCC=gcc-4.5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.5.1/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.0-2'
--with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,java,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --program-suffix=-4.5 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-plugin --enable-gold --with-plugin-ld=ld.gold --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.5/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.5
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.5
--with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-targets=all --with-arch-32=i486 --with-tune=generic
--enable-checking=yes --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.5.1 20100419 (prerelease) (Debian 4.5.0-2) 
------------------------------------------------------------------

thanks for your attention, and sorry if I missed something

                J.T. Lapresté


-- 
           Summary:  _builtin_ia32_vextractf128_si256(X,N) acts as if  N was
                    always set to 1.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jtlapreste at gmail dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]