Comment 16 for bug 539632

Revision history for this message
Dmitri Hrapof (hrapof) wrote : Re: [Bug 539632] Re: simd woes

dmitri@dmitri-laptop:~$ gcc -msse2 -mpreferred-stack-boundary=2 -fPIC
-O2 -shared himd.c -o libhimd.so
dmitri@dmitri-laptop:~$ objdump -d libhimd.so

000003f0 <himd_sqrt>:
  3f0: 55 push %ebp
  3f1: 89 e5 mov %esp,%ebp
  3f3: 57 push %edi
  3f4: 56 push %esi
  3f5: 83 ec 10 sub $0x10,%esp
  3f8: 8b 45 0c mov 0xc(%ebp),%eax
  3fb: 8b 4d 08 mov 0x8(%ebp),%ecx
  3fe: 89 c7 mov %eax,%edi
  400: 83 e7 01 and $0x1,%edi
  403: 8d 50 ff lea -0x1(%eax),%edx
  406: 0f 44 d0 cmove %eax,%edx
  409: 85 d2 test %edx,%edx
  40b: 7e 34 jle 441 <himd_sqrt+0x51>
  40d: 8d 75 e8 lea -0x18(%ebp),%esi
  410: 31 c0 xor %eax,%eax
  412: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
  418: dd 04 c1 fldl (%ecx,%eax,8)
  41b: dd 5d e8 fstpl -0x18(%ebp)
  41e: dd 44 c1 08 fldl 0x8(%ecx,%eax,8)
  422: dd 5d f0 fstpl -0x10(%ebp)
  425: 66 0f 51 06 sqrtpd (%esi),%xmm0
  429: 66 0f 29 06 movapd %xmm0,(%esi)
  42d: dd 45 e8 fldl -0x18(%ebp)
  430: dd 1c c1 fstpl (%ecx,%eax,8)
  433: dd 45 f0 fldl -0x10(%ebp)
  436: dd 5c c1 08 fstpl 0x8(%ecx,%eax,8)
  43a: 83 c0 02 add $0x2,%eax
  43d: 39 c2 cmp %eax,%edx
  43f: 7f d7 jg 418 <himd_sqrt+0x28>
  441: 85 ff test %edi,%edi
  443: 74 17 je 45c <himd_sqrt+0x6c>
  445: 8d 04 d1 lea (%ecx,%edx,8),%eax
  448: dd 00 fldl (%eax)
  44a: dd 5d e8 fstpl -0x18(%ebp)
  44d: 66 0f 51 45 e8 sqrtpd -0x18(%ebp),%xmm0
  452: 66 0f 29 45 e8 movapd %xmm0,-0x18(%ebp)
  457: dd 45 e8 fldl -0x18(%ebp)
  45a: dd 18 fstpl (%eax)
  45c: 83 c4 10 add $0x10,%esp
  45f: 5e pop %esi
  460: 5f pop %edi
  461: 5d pop %ebp
  462: c3 ret

dmitri@dmitri-laptop:~$ sudo cp libhimd.so /usr/lib
dmitri@dmitri-laptop:~$ ldd a.out
 linux-gate.so.1 => (0xb7f77000)
 libhimd.so => /usr/lib/libhimd.so (0xb7f41000)
 libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7de3000)
 /lib/ld-linux.so.2 (0xb7f5d000)
dmitri@dmitri-laptop:~$ ./a.out
1.000000 1.414214 1.732051
dmitri@dmitri-laptop:~$ gcc -v
Используются внутренние спецификации.
Целевая архитектура: i486-linux-gnu
Параметры конфигурации: ../src/configure -v --with-pkgversion='Ubuntu
4.3.2-1ubuntu12'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-targets=all --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Модель многопотоковости: posix
gcc версия 4.3.2 (Ubuntu 4.3.2-1ubuntu12)