lcwyylcwyy / libyuv

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

64 bit neon doesn't build #413

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. build code for 64 bit with neon turned on

What is the expected output? What do you see instead?
64 neon accelerated executable, instead it fails to compile

What version of the product are you using? On what operating system?
1157 iOS 8

Please provide any additional information below.

Here is an extract of my patch file showing how I fixed the build issue in my 
local copy, although I'd propose the functions taking longs as a parameter 
instead:

diff --git a/libyuv/source/row_neon64.cc b/libyuv/source/row_neon64.cc
index ddccd5d..d994d7b 100644
--- a/libyuv/source/row_neon64.cc
+++ b/libyuv/source/row_neon64.cc
@@ -517,6 +517,7 @@ void I422ToARGB4444Row_NEON(const uint8* src_y,
 void YToARGBRow_NEON(const uint8* src_y,
                      uint8* dst_argb,
                      int width) {
+  long correct_width = width;
   asm volatile (
     YUV422TORGB_SETUP_REG
   "1:                                          \n"
@@ -529,7 +530,7 @@ void YToARGBRow_NEON(const uint8* src_y,
     "b.gt       1b                             \n"
     : "+r"(src_y),     // %0
       "+r"(dst_argb),  // %1
-      "+r"(width)      // %2
+      "+r"(correct_width)      // %2
     : [kUVBiasBGR]"r"(&kUVBiasBGR),
       [kYToRgb]"r"(&kYToRgb)
     : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20",
@@ -674,6 +675,7 @@ void NV21ToRGB565Row_NEON(const uint8* src_y,
 void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
                         uint8* dst_argb,
                         int width) {
+  long correct_width = width;
   asm volatile (
     YUV422TORGB_SETUP_REG
   "1:                                          \n"
@@ -686,7 +688,7 @@ void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
     "b.gt       1b                             \n"
     : "+r"(src_yuy2),  // %0
       "+r"(dst_argb),  // %1
-      "+r"(width)      // %2
+      "+r"(correct_width)      // %2
     : [kUVBiasBGR]"r"(&kUVBiasBGR),
       [kYToRgb]"r"(&kYToRgb)
     : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20",
@@ -699,6 +701,7 @@ void YUY2ToARGBRow_NEON(const uint8* src_yuy2,
 void UYVYToARGBRow_NEON(const uint8* src_uyvy,
                         uint8* dst_argb,
                         int width) {
+  long correct_width = width;
   asm volatile (
     YUV422TORGB_SETUP_REG
   "1:                                          \n"
@@ -711,7 +714,7 @@ void UYVYToARGBRow_NEON(const uint8* src_uyvy,
     "b.gt       1b                             \n"
     : "+r"(src_uyvy),  // %0
       "+r"(dst_argb),  // %1
-      "+r"(width)      // %2
+      "+r"(correct_width)      // %2
     : [kUVBiasBGR]"r"(&kUVBiasBGR),
       [kYToRgb]"r"(&kYToRgb)
     : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20",
-- 

Original issue reported on code.google.com by thesombr...@gmail.com on 13 Mar 2015 at 11:16

GoogleCodeExporter commented 9 years ago
I'm seeing warnings and notes, but no errors?

GYP_DEFINES="OS=ios target_arch=armv7 target_subarch=64" GYP_CROSSCOMPILE=1 
GYP_GENERATOR_FLAGS="output_dir=out_ios" ./gyp_libyuv -f ninja --depth=. 
libyuv_test.gyp 
ninja -j7 -C out_ios/Debug-iphoneos libyuv_unittest

ninja: Entering directory `out_ios/Debug-iphoneos'
[30/297] CXX obj/source/libyuv_neon.row_neon64.arm64.o
../../source/row_neon64.cc:532:12: warning: value size does not match register 
size specified by the constraint and modifier [-Wasm-operand-widths]
      "+r"(width)      // %2
           ^
../../source/row_neon64.cc:521:5: note: use constraint modifier "w"
    YUV422TORGB_SETUP_REG
    ^
../../source/row_neon64.cc:98:28: note: expanded from macro 
'YUV422TORGB_SETUP_REG'
    "ld1r       {v31.4s}, [%[kYToRgb]]         \n"                             \
                           ^
../../source/row_neon64.cc:689:12: warning: value size does not match register 
size specified by the constraint and modifier [-Wasm-operand-widths]
      "+r"(width)      // %2
           ^
../../source/row_neon64.cc:678:5: note: use constraint modifier "w"
    YUV422TORGB_SETUP_REG
    ^
../../source/row_neon64.cc:98:28: note: expanded from macro 
'YUV422TORGB_SETUP_REG'
    "ld1r       {v31.4s}, [%[kYToRgb]]         \n"                             \
                           ^
../../source/row_neon64.cc:714:12: warning: value size does not match register 
size specified by the constraint and modifier [-Wasm-operand-widths]
      "+r"(width)      // %2
           ^
../../source/row_neon64.cc:703:5: note: use constraint modifier "w"
    YUV422TORGB_SETUP_REG
    ^
../../source/row_neon64.cc:98:28: note: expanded from macro 
'YUV422TORGB_SETUP_REG'
    "ld1r       {v31.4s}, [%[kYToRgb]]         \n"                             \
                           ^
3 warnings generated.
[34/297] LIBTOOL-STATIC libyuv_neon.a, POSTBUILDS

For width, a 'w' register is expected - 32 bits.

Original comment by phthor...@gmail.com on 15 Mar 2015 at 10:52

GoogleCodeExporter commented 9 years ago
fixed in r1338

Original comment by phthor...@gmail.com on 17 Mar 2015 at 5:57