nanguantong / libyuv

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

LIBYUV_DISABLE_X86 defines are out of sync #476

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build with g++ -m32 (not defining -msse2)
I did:
$ cmake . -DCMAKE_CXX_FLAGS=-m32
with g++-4.8.4
2. $ nm -n libyuv.a | grep ScaleRowDown2_SSE2
         U ScaleRowDown2_SSE2

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
r1437; Linux

Please provide any additional information below.

Currently there are 3 places this is defined in the public headers [1] with 
slightly different conditionals. When trying to directly link with the object 
files [2] many of the SSE2 symbols are undefined. Matching row.h and 
scale_row.h seems to correct the problem in [2]. Any reason these are different?

[1]
include/libyuv/scale_row.h-#if defined(__pnacl__) || defined(__CLR_VER) || 
defined(COVERAGE_ENABLED) || \
include/libyuv/scale_row.h-    defined(TARGET_IPHONE_SIMULATOR)
include/libyuv/scale_row.h:#define LIBYUV_DISABLE_X86
--
include/libyuv/planar_functions.h-#if defined(__pnacl__) || defined(__CLR_VER) 
|| defined(COVERAGE_ENABLED) || \
include/libyuv/planar_functions.h-    defined(TARGET_IPHONE_SIMULATOR) || \
include/libyuv/planar_functions.h-    (defined(__i386__) && !defined(__SSE2__)) 
|| \
include/libyuv/planar_functions.h-    ((defined(_MSC_VER) && 
!defined(__clang__)) && defined(__clang__))
include/libyuv/planar_functions.h:#define LIBYUV_DISABLE_X86
--
include/libyuv/row.h-#if defined(__pnacl__) || defined(__CLR_VER) || 
defined(COVERAGE_ENABLED) || \
include/libyuv/row.h-    defined(TARGET_IPHONE_SIMULATOR) || \
include/libyuv/row.h-    (defined(__i386__) && !defined(__SSE2__))
include/libyuv/row.h:#define LIBYUV_DISABLE_X86

[2]
http://build.webmproject.org/jenkins/job/libvpx%20compile%20options/20254/arch=x
86-linux-gcc,config=rtcd/console
third_party/libyuv/source/scale_any.cc.o: In function `ScaleRowDown2_Any_SSE2':
scale_any.cc:(.text+0x42): undefined reference to `ScaleRowDown2_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown2Linear_Any_SSE2':
scale_any.cc:(.text+0xc2): undefined reference to `ScaleRowDown2Linear_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown2Box_Any_SSE2':
scale_any.cc:(.text+0x142): undefined reference to `ScaleRowDown2Box_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function `ScaleRowDown4_Any_SSE2':
scale_any.cc:(.text+0x1c2): undefined reference to `ScaleRowDown4_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown4Box_Any_SSE2':
scale_any.cc:(.text+0x242): undefined reference to `ScaleRowDown4Box_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown34_Any_SSSE3':
scale_any.cc:(.text+0x2d5): undefined reference to `ScaleRowDown34_SSSE3'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown34_0_Box_Any_SSSE3':
scale_any.cc:(.text+0x375): undefined reference to `ScaleRowDown34_0_Box_SSSE3'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown34_1_Box_Any_SSSE3':
scale_any.cc:(.text+0x415): undefined reference to `ScaleRowDown34_1_Box_SSSE3'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown38_Any_SSSE3':
scale_any.cc:(.text+0x4b5): undefined reference to `ScaleRowDown38_SSSE3'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown38_3_Box_Any_SSSE3':
scale_any.cc:(.text+0x554): undefined reference to `ScaleRowDown38_3_Box_SSSE3'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleRowDown38_2_Box_Any_SSSE3':
scale_any.cc:(.text+0x5f4): undefined reference to `ScaleRowDown38_2_Box_SSSE3'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleARGBRowDown2_Any_SSE2':
scale_any.cc:(.text+0x682): undefined reference to `ScaleARGBRowDown2_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleARGBRowDown2Linear_Any_SSE2':
scale_any.cc:(.text+0x702): undefined reference to 
`ScaleARGBRowDown2Linear_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleARGBRowDown2Box_Any_SSE2':
scale_any.cc:(.text+0x782): undefined reference to `ScaleARGBRowDown2Box_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleARGBRowDownEven_Any_SSE2':
scale_any.cc:(.text+0x80e): undefined reference to `ScaleARGBRowDownEven_SSE2'
third_party/libyuv/source/scale_any.cc.o: In function 
`ScaleARGBRowDownEvenBox_Any_SSE2':
scale_any.cc:(.text+0x89e): undefined reference to 
`ScaleARGBRowDownEvenBox_SSE2'

Original issue reported on code.google.com by jz...@google.com on 25 Jul 2015 at 2:00

GoogleCodeExporter commented 9 years ago
The intent was that each functional area disables assembly (other CPUs too) for 
different reasons, but should not interact.

scale_row.h, rotate_row.h and row.h are really intended to be internal and not 
to interact.

planar_functions should not really need to dsiable assembly.  It exposes one 
function if I recall.

row.h is the most correct version.  I'll see if that version can be used for 
all headers.

Original comment by fbarch...@chromium.org on 27 Jul 2015 at 5:30

GoogleCodeExporter commented 9 years ago
the row.h one covers the most common case and should be considered correct.
but its currently doing

#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \
    defined(TARGET_IPHONE_SIMULATOR) || \
    (defined(__i386__) && !defined(__SSE2__))
#define LIBYUV_DISABLE_X86
#endif

technically there is a bit of X86 assembly that could work without SSE2 but its 
not worth worrying about, and this keeps the ifdefs simplier.

the coverage and iphone are build system specific, and I propose removing them.
if iphone still needs ifdefs they can be reintroduced in a way that is build 
system agnostic.

#if defined(__pnacl__) || defined(__CLR_VER) || (defined(__i386__) && 
!defined(__SSE2__))
#define LIBYUV_DISABLE_X86
#endif

Original comment by fbarch...@chromium.org on 27 Jul 2015 at 7:04

GoogleCodeExporter commented 9 years ago
Fixed in r1453

todo review NEON disables in same way.

Original comment by fbarch...@chromium.org on 27 Jul 2015 at 7:50

GoogleCodeExporter commented 9 years ago

Original comment by fbarch...@chromium.org on 27 Jul 2015 at 7:50