jaqquery / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

I422ToARGB AVX2 fail #393

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This code fails on osx

_I422ToARGBRow_AVX2:
0000000000001880    55                  pushq   %rbp
0000000000001881    4889e5              movq    %rsp, %rbp
0000000000001884    448945fc            movl    %r8d, -0x4(%rbp)
0000000000001888    488d0500000000      leaq    __ZN6libyuv17kYuvConstants_AVXE(%rip), 
%rax
000000000000188f    4829f2              subq    %rsi, %rdx
0000000000001892    c5d574ed            vpcmpeqb    %ymm5, %ymm5, %ymm5
0000000000001896    c5fa7e06            vmovq   _I400ToARGBRow_SSE2(%rsi), %xmm0
000000000000189a    c5fa7e0c16          vmovq   _I400ToARGBRow_SSE2(%rsi,%rdx), %xmm1
000000000000189f    488d7608            leaq    0x8(%rsi), %rsi
00000000000018a3    c5fd60c1            vpunpcklbw  %ymm1, %ymm0, %ymm0 ## ymm0 = 
ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[4],ymm1[4],
ymm0[5],ymm1[5],ymm0[6],ymm1[6],ymm0[7],ymm1[7],ymm0[16],ymm1[16],ymm0[17],ymm1[
17],ymm0[18],ymm1[18],ymm0[19],ymm1[19],ymm0[20],ymm1[20],ymm0[21],ymm1[21],ymm0
[22],ymm1[22],ymm0[23],ymm1[23]
00000000000018a7    c4e3fd00c0d8        vpermq  $-0x28, %ymm0, %ymm0    ## ymm0 = 
ymm0[0,2,1,3]
00000000000018ad    c5fd61c0            vpunpcklwd  %ymm0, %ymm0, %ymm0 ## ymm0 = 
ymm0[0,0,1,1,2,2,3,3,8,8,9,9,10,10,11,11]
00000000000018b1    c4e27d045040        vpmaddubsw  0x40(%rax), %ymm0, %ymm2
00000000000018b7    c4e27d044820        vpmaddubsw  0x20(%rax), %ymm0, %ymm1
00000000000018bd    c4e27d0400          vpmaddubsw  _I400ToARGBRow_SSE2(%rax), %ymm0, 
%ymm0
00000000000018c2    c5fe6f98a0000000    vmovdqu 0xa0(%rax), %ymm3
00000000000018ca    c5e5f9d2            vpsubw  %ymm2, %ymm3, %ymm2
00000000000018ce    c5fe6f9080000000    vmovdqu 0x80(%rax), %ymm2
00000000000018d6    c5edf9c9            vpsubw  %ymm1, %ymm2, %ymm1
00000000000018da    c5fe6f4860          vmovdqu 0x60(%rax), %ymm1
00000000000018df    c5f5f9c0            vpsubw  %ymm0, %ymm1, %ymm0
00000000000018e3    c5fa6f1f            vmovdqu _I400ToARGBRow_SSE2(%rdi), %xmm3
00000000000018e7    488d7f10            leaq    0x10(%rdi), %rdi
00000000000018eb    c4e3fd00dbd8        vpermq  $-0x28, %ymm3, %ymm3    ## ymm3 = 
ymm3[0,2,1,3]
00000000000018f1    c5e560db            vpunpcklbw  %ymm3, %ymm3, %ymm3 ## ymm3 = 
ymm3[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,16,16,17,17,18,18,19,19,20,20,21,21,22,22,2
3,23]
00000000000018f5    c5e5e498c0000000    vpmulhuw    0xc0(%rax), %ymm3, %ymm3
00000000000018fd    c5fdedc3            vpaddsw %ymm3, %ymm0, %ymm0
0000000000001901    c5f5edcb            vpaddsw %ymm3, %ymm1, %ymm1
0000000000001905    c5ededd3            vpaddsw %ymm3, %ymm2, %ymm2
0000000000001909    c5fd71e006          vpsraw  $0x6, %ymm0, %ymm0
000000000000190e    c5f571e106          vpsraw  $0x6, %ymm1, %ymm1
0000000000001913    c5ed71e206          vpsraw  $0x6, %ymm2, %ymm2
0000000000001918    c5fd67c0            vpackuswb   %ymm0, %ymm0, %ymm0
000000000000191c    c5f567c9            vpackuswb   %ymm1, %ymm1, %ymm1
0000000000001920    c5ed67d2            vpackuswb   %ymm2, %ymm2, %ymm2
0000000000001924    c5fd60c1            vpunpcklbw  %ymm1, %ymm0, %ymm0 ## ymm0 = 
ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[4],ymm1[4],
ymm0[5],ymm1[5],ymm0[6],ymm1[6],ymm0[7],ymm1[7],ymm0[16],ymm1[16],ymm0[17],ymm1[
17],ymm0[18],ymm1[18],ymm0[19],ymm1[19],ymm0[20],ymm1[20],ymm0[21],ymm1[21],ymm0
[22],ymm1[22],ymm0[23],ymm1[23]
0000000000001928    c4e3fd00c0d8        vpermq  $-0x28, %ymm0, %ymm0    ## ymm0 = 
ymm0[0,2,1,3]
000000000000192e    c5ed60d5            vpunpcklbw  %ymm5, %ymm2, %ymm2 ## ymm2 = 
ymm2[0],ymm5[0],ymm2[1],ymm5[1],ymm2[2],ymm5[2],ymm2[3],ymm5[3],ymm2[4],ymm5[4],
ymm2[5],ymm5[5],ymm2[6],ymm5[6],ymm2[7],ymm5[7],ymm2[16],ymm5[16],ymm2[17],ymm5[
17],ymm2[18],ymm5[18],ymm2[19],ymm5[19],ymm2[20],ymm5[20],ymm2[21],ymm5[21],ymm2
[22],ymm5[22],ymm2[23],ymm5[23]
0000000000001932    c4e3fd00d2d8        vpermq  $-0x28, %ymm2, %ymm2    ## ymm2 = 
ymm2[0,2,1,3]
0000000000001938    c5fd61ca            vpunpcklwd  %ymm2, %ymm0, %ymm1 ## ymm1 = 
ymm0[0],ymm2[0],ymm0[1],ymm2[1],ymm0[2],ymm2[2],ymm0[3],ymm2[3],ymm0[8],ymm2[8],
ymm0[9],ymm2[9],ymm0[10],ymm2[10],ymm0[11],ymm2[11]
000000000000193c    c5fd69c2            vpunpckhwd  %ymm2, %ymm0, %ymm0 ## ymm0 = 
ymm0[4],ymm2[4],ymm0[5],ymm2[5],ymm0[6],ymm2[6],ymm0[7],ymm2[7],ymm0[12],ymm2[12
],ymm0[13],ymm2[13],ymm0[14],ymm2[14],ymm0[15],ymm2[15]
0000000000001940    c5fe7f09            vmovdqu %ymm1, _I400ToARGBRow_SSE2(%rcx)
0000000000001944    c5fe7f4120          vmovdqu %ymm0, 0x20(%rcx)
0000000000001949    488d4940            leaq    0x40(%rcx), %rcx
000000000000194d    4183e810            subl    $0x10, %r8d
0000000000001951    0f8f3fffffff        jg  0x1896
0000000000001957    c5f877              vzeroupper
000000000000195a    448945fc            movl    %r8d, -0x4(%rbp)
000000000000195e    5d                  popq    %rbp
000000000000195f    c3                  retq

Original issue reported on code.google.com by fbarch...@google.com on 26 Jan 2015 at 7:53

GoogleCodeExporter commented 8 years ago
In r1259 YToARGB with AVX2 is working on Windows.

Original comment by fbarch...@google.com on 4 Feb 2015 at 7:59

GoogleCodeExporter commented 8 years ago
r1363 still has the issue, in clang for windows, as well as osx/linux.

enable in include/libyuv/row.h: #define HAS_I422TOARGBROW_AVX2

build with clang
set GYP_DEFINES=clang=1 make_clang_dir=../../myllvm/build target_arch=ia32 
libyuv_enable_svn=1 libyuv_disable_jpeg=1
set LLVM_REPO_URL=svn://svn.chromium.org/llvm-project
python tools\clang\scripts\update.py
python gyp_libyuv -fninja libyuv_test.gyp
ninja -C out\Release

run with emulator
c:\intelsde\sde -ast -hsw -- out\release\libyuv_unittest.exe 
--gtest_catch_exceptions=0 --gtest_filter=*I422ToARGB*
[  FAILED  ] libyuvTest.I422ToARGB_Opt

Original comment by fbarch...@chromium.org on 8 Apr 2015 at 12:30

GoogleCodeExporter commented 8 years ago
fixed in r1364

Original comment by fbarch...@chromium.org on 8 Apr 2015 at 2:33