Index: pjproject/trunk/third_party/yuv/source/rotate_neon64.cc
===================================================================
--- pjproject/trunk/third_party/yuv/source/rotate_neon64.cc	(revision 5358)
+++ pjproject/trunk/third_party/yuv/source/rotate_neon64.cc	(revision 5633)
@@ -9,6 +9,6 @@
  */
 
+#include "libyuv/rotate_row.h"
 #include "libyuv/row.h"
-#include "libyuv/rotate_row.h"
 
 #include "libyuv/basic_types.h"
@@ -22,16 +22,18 @@
 #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
 
-static uvec8 kVTbl4x4Transpose =
-  { 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 };
-
-void TransposeWx8_NEON(const uint8* src, int src_stride,
-                       uint8* dst, int dst_stride, int width) {
+static uvec8 kVTbl4x4Transpose = {0, 4, 8,  12, 1, 5, 9,  13,
+                                  2, 6, 10, 14, 3, 7, 11, 15};
+
+void TransposeWx8_NEON(const uint8* src,
+                       int src_stride,
+                       uint8* dst,
+                       int dst_stride,
+                       int width) {
   const uint8* src_temp;
-  int64 width64 = (int64) width;  // Work around clang 3.4 warning.
   asm volatile (
     // loops are on blocks of 8. loop will stop when
     // counter gets to or below 0. starting the counter
     // at w-8 allow for this
-    "sub         %3, %3, #8                      \n"
+    "sub         %w3, %w3, #8                     \n"
 
     // handle 8x8 blocks. this should be the majority of the plane
@@ -39,19 +41,11 @@
       "mov         %0, %1                        \n"
 
-      MEMACCESS(0)
       "ld1        {v0.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v1.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v2.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v3.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v4.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v5.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v6.8b}, [%0], %5              \n"
-      MEMACCESS(0)
       "ld1        {v7.8b}, [%0]                  \n"
 
@@ -85,60 +79,43 @@
       "mov         %0, %2                        \n"
 
-    MEMACCESS(0)
       "st1      {v17.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v16.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v19.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v18.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v21.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v20.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v23.8b}, [%0], %6               \n"
-    MEMACCESS(0)
       "st1      {v22.8b}, [%0]                   \n"
 
       "add         %1, %1, #8                    \n"  // src += 8
       "add         %2, %2, %6, lsl #3            \n"  // dst += 8 * dst_stride
-      "subs        %3, %3, #8                    \n"  // w   -= 8
+      "subs        %w3, %w3, #8                  \n"  // w   -= 8
       "b.ge        1b                            \n"
 
     // add 8 back to counter. if the result is 0 there are
     // no residuals.
-    "adds        %3, %3, #8                      \n"
+    "adds        %w3, %w3, #8                    \n"
     "b.eq        4f                              \n"
 
     // some residual, so between 1 and 7 lines left to transpose
-    "cmp         %3, #2                          \n"
+    "cmp         %w3, #2                          \n"
     "b.lt        3f                              \n"
 
-    "cmp         %3, #4                          \n"
+    "cmp         %w3, #4                          \n"
     "b.lt        2f                              \n"
 
     // 4x8 block
     "mov         %0, %1                          \n"
-    MEMACCESS(0)
     "ld1     {v0.s}[0], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v0.s}[1], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v0.s}[2], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v0.s}[3], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.s}[0], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.s}[1], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.s}[2], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.s}[3], [%0]                     \n"
 
     "mov         %0, %2                          \n"
 
-    MEMACCESS(4)
     "ld1      {v2.16b}, [%4]                     \n"
 
@@ -148,31 +125,23 @@
     // TODO(frkoenig): Rework shuffle above to
     // write out with 4 instead of 8 writes.
-    MEMACCESS(0)
     "st1 {v3.s}[0], [%0], %6                     \n"
-    MEMACCESS(0)
     "st1 {v3.s}[1], [%0], %6                     \n"
-    MEMACCESS(0)
     "st1 {v3.s}[2], [%0], %6                     \n"
-    MEMACCESS(0)
     "st1 {v3.s}[3], [%0]                         \n"
 
     "add         %0, %2, #4                      \n"
-    MEMACCESS(0)
     "st1 {v0.s}[0], [%0], %6                     \n"
-    MEMACCESS(0)
     "st1 {v0.s}[1], [%0], %6                     \n"
-    MEMACCESS(0)
     "st1 {v0.s}[2], [%0], %6                     \n"
-    MEMACCESS(0)
     "st1 {v0.s}[3], [%0]                         \n"
 
     "add         %1, %1, #4                      \n"  // src += 4
     "add         %2, %2, %6, lsl #2              \n"  // dst += 4 * dst_stride
-    "subs        %3, %3, #4                      \n"  // w   -= 4
+    "subs        %w3, %w3, #4                    \n"  // w   -= 4
     "b.eq        4f                              \n"
 
     // some residual, check to see if it includes a 2x8 block,
     // or less
-    "cmp         %3, #2                          \n"
+    "cmp         %w3, #2                         \n"
     "b.lt        3f                              \n"
 
@@ -180,19 +149,11 @@
     "2:                                          \n"
     "mov         %0, %1                          \n"
-    MEMACCESS(0)
     "ld1     {v0.h}[0], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.h}[0], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v0.h}[1], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.h}[1], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v0.h}[2], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.h}[2], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v0.h}[3], [%0], %5                 \n"
-    MEMACCESS(0)
     "ld1     {v1.h}[3], [%0]                     \n"
 
@@ -202,34 +163,23 @@
     "mov         %0, %2                          \n"
 
-    MEMACCESS(0)
     "st1     {v3.8b}, [%0], %6                   \n"
-    MEMACCESS(0)
     "st1     {v2.8b}, [%0]                       \n"
 
     "add         %1, %1, #2                      \n"  // src += 2
     "add         %2, %2, %6, lsl #1              \n"  // dst += 2 * dst_stride
-    "subs        %3, %3,  #2                     \n"  // w   -= 2
+    "subs        %w3, %w3,  #2                   \n"  // w   -= 2
     "b.eq        4f                              \n"
 
     // 1x8 block
     "3:                                          \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[0], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[1], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[2], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[3], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[4], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[5], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[6], [%1], %5             \n"
-    MEMACCESS(1)
     "ld1         {v0.b}[7], [%1]                 \n"
 
-    MEMACCESS(2)
     "st1         {v0.8b}, [%2]                   \n"
 
@@ -239,5 +189,5 @@
       "+r"(src),                                  // %1
       "+r"(dst),                                  // %2
-      "+r"(width64)                               // %3
+      "+r"(width)                                 // %3
     : "r"(&kVTbl4x4Transpose),                    // %4
       "r"(static_cast<ptrdiff_t>(src_stride)),    // %5
@@ -248,19 +198,21 @@
 }
 
-static uint8 kVTbl4x4TransposeDi[32] =
-  { 0,  16, 32, 48,  2, 18, 34, 50,  4, 20, 36, 52,  6, 22, 38, 54,
-    1,  17, 33, 49,  3, 19, 35, 51,  5, 21, 37, 53,  7, 23, 39, 55};
-
-void TransposeUVWx8_NEON(const uint8* src, int src_stride,
-                         uint8* dst_a, int dst_stride_a,
-                         uint8* dst_b, int dst_stride_b,
+static uint8 kVTbl4x4TransposeDi[32] = {
+    0, 16, 32, 48, 2, 18, 34, 50, 4, 20, 36, 52, 6, 22, 38, 54,
+    1, 17, 33, 49, 3, 19, 35, 51, 5, 21, 37, 53, 7, 23, 39, 55};
+
+void TransposeUVWx8_NEON(const uint8* src,
+                         int src_stride,
+                         uint8* dst_a,
+                         int dst_stride_a,
+                         uint8* dst_b,
+                         int dst_stride_b,
                          int width) {
   const uint8* src_temp;
-  int64 width64 = (int64) width;  // Work around clang 3.4 warning.
   asm volatile (
     // loops are on blocks of 8. loop will stop when
     // counter gets to or below 0. starting the counter
     // at w-8 allow for this
-    "sub       %4, %4, #8                      \n"
+    "sub       %w4, %w4, #8                    \n"
 
     // handle 8x8 blocks. this should be the majority of the plane
@@ -268,19 +220,11 @@
     "mov       %0, %1                          \n"
 
-    MEMACCESS(0)
     "ld1       {v0.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v1.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v2.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v3.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v4.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v5.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v6.16b}, [%0], %5              \n"
-    MEMACCESS(0)
     "ld1       {v7.16b}, [%0]                  \n"
 
@@ -314,38 +258,22 @@
     "mov       %0, %2                          \n"
 
-    MEMACCESS(0)
     "st1       {v16.d}[0], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v18.d}[0], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v17.d}[0], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v19.d}[0], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v16.d}[1], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v18.d}[1], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v17.d}[1], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v19.d}[1], [%0]                \n"
 
     "mov       %0, %3                          \n"
 
-    MEMACCESS(0)
     "st1       {v20.d}[0], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v22.d}[0], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v21.d}[0], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v23.d}[0], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v20.d}[1], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v22.d}[1], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v21.d}[1], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v23.d}[1], [%0]                \n"
 
@@ -353,17 +281,17 @@
     "add       %2, %2, %6, lsl #3              \n"  // dst_a += 8 * dst_stride_a
     "add       %3, %3, %7, lsl #3              \n"  // dst_b += 8 * dst_stride_b
-    "subs      %4, %4,  #8                     \n"  // w     -= 8
+    "subs      %w4, %w4,  #8                   \n"  // w     -= 8
     "b.ge      1b                              \n"
 
     // add 8 back to counter. if the result is 0 there are
     // no residuals.
-    "adds      %4, %4, #8                      \n"
+    "adds      %w4, %w4, #8                    \n"
     "b.eq      4f                              \n"
 
     // some residual, so between 1 and 7 lines left to transpose
-    "cmp       %4, #2                          \n"
+    "cmp       %w4, #2                         \n"
     "b.lt      3f                              \n"
 
-    "cmp       %4, #4                          \n"
+    "cmp       %w4, #4                         \n"
     "b.lt      2f                              \n"
 
@@ -371,22 +299,13 @@
     // 4x8 block
     "mov       %0, %1                          \n"
-    MEMACCESS(0)
     "ld1       {v0.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v1.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v2.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v3.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v4.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v5.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v6.8b}, [%0], %5               \n"
-    MEMACCESS(0)
     "ld1       {v7.8b}, [%0]                   \n"
 
-    MEMACCESS(8)
     "ld1       {v30.16b}, [%8], #16            \n"
     "ld1       {v31.16b}, [%8]                 \n"
@@ -399,42 +318,26 @@
     "mov       %0, %2                          \n"
 
-    MEMACCESS(0)
     "st1       {v16.s}[0],  [%0], %6           \n"
-    MEMACCESS(0)
     "st1       {v16.s}[1],  [%0], %6           \n"
-    MEMACCESS(0)
     "st1       {v16.s}[2],  [%0], %6           \n"
-    MEMACCESS(0)
     "st1       {v16.s}[3],  [%0], %6           \n"
 
     "add       %0, %2, #4                      \n"
-    MEMACCESS(0)
     "st1       {v18.s}[0], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v18.s}[1], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v18.s}[2], [%0], %6            \n"
-    MEMACCESS(0)
     "st1       {v18.s}[3], [%0]                \n"
 
     "mov       %0, %3                          \n"
 
-    MEMACCESS(0)
     "st1       {v17.s}[0], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v17.s}[1], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v17.s}[2], [%0], %7            \n"
-    MEMACCESS(0)
     "st1       {v17.s}[3], [%0], %7            \n"
 
     "add       %0, %3, #4                      \n"
-    MEMACCESS(0)
     "st1       {v19.s}[0],  [%0], %7           \n"
-    MEMACCESS(0)
     "st1       {v19.s}[1],  [%0], %7           \n"
-    MEMACCESS(0)
     "st1       {v19.s}[2],  [%0], %7           \n"
-    MEMACCESS(0)
     "st1       {v19.s}[3],  [%0]               \n"
 
@@ -442,10 +345,10 @@
     "add       %2, %2, %6, lsl #2              \n"  // dst_a += 4 * dst_stride_a
     "add       %3, %3, %7, lsl #2              \n"  // dst_b += 4 * dst_stride_b
-    "subs      %4,  %4,  #4                    \n"  // w     -= 4
+    "subs      %w4,  %w4,  #4                  \n"  // w     -= 4
     "b.eq      4f                              \n"
 
     // some residual, check to see if it includes a 2x8 block,
     // or less
-    "cmp       %4, #2                          \n"
+    "cmp       %w4, #2                         \n"
     "b.lt      3f                              \n"
 
@@ -453,19 +356,11 @@
     "2:                                        \n"
     "mov       %0, %1                          \n"
-    MEMACCESS(0)
     "ld2       {v0.h, v1.h}[0], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v2.h, v3.h}[0], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v0.h, v1.h}[1], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v2.h, v3.h}[1], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v0.h, v1.h}[2], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v2.h, v3.h}[2], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v0.h, v1.h}[3], [%0], %5       \n"
-    MEMACCESS(0)
     "ld2       {v2.h, v3.h}[3], [%0]           \n"
 
@@ -477,14 +372,10 @@
     "mov       %0, %2                          \n"
 
-    MEMACCESS(0)
     "st1       {v4.d}[0], [%0], %6             \n"
-    MEMACCESS(0)
     "st1       {v6.d}[0], [%0]                 \n"
 
     "mov       %0, %3                          \n"
 
-    MEMACCESS(0)
     "st1       {v5.d}[0], [%0], %7             \n"
-    MEMACCESS(0)
     "st1       {v7.d}[0], [%0]                 \n"
 
@@ -492,29 +383,19 @@
     "add       %2, %2, %6, lsl #1              \n"  // dst_a += 2 * dst_stride_a
     "add       %3, %3, %7, lsl #1              \n"  // dst_b += 2 * dst_stride_b
-    "subs      %4,  %4,  #2                    \n"  // w     -= 2
+    "subs      %w4,  %w4,  #2                  \n"  // w     -= 2
     "b.eq      4f                              \n"
 
     // 1x8 block
     "3:                                        \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[0], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[1], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[2], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[3], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[4], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[5], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[6], [%1], %5       \n"
-    MEMACCESS(1)
     "ld2       {v0.b, v1.b}[7], [%1]           \n"
 
-    MEMACCESS(2)
     "st1       {v0.d}[0], [%2]                 \n"
-    MEMACCESS(3)
     "st1       {v1.d}[0], [%3]                 \n"
 
@@ -525,5 +406,5 @@
       "+r"(dst_a),                                // %2
       "+r"(dst_b),                                // %3
-      "+r"(width64)                               // %4
+      "+r"(width)                                 // %4
     : "r"(static_cast<ptrdiff_t>(src_stride)),    // %5
       "r"(static_cast<ptrdiff_t>(dst_stride_a)),  // %6
