From fb8fba8060eb72fc8d33e3f92c3dc2ee2d79c0be Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Tue, 2 May 2017 15:30:15 -0700 Subject: fix for clang compile error on mips sgtu instruction. In NDK r14 the assenbler built into llvm fails on sgtu pseudo-op instruction. r14 uses clang 3.8. sgtu is set great than unsigned. The instruction has been added in 3.9 and 4.0 for future updates https://reviews.llvm.org/D22752#765a2da5 But the its just a pseudo op for sltu: set less than unsigned. So this change switches the order of the 2 operands and uses sltu instead of sgtu. Bug: 37671160 Test: lunch aosp_mips-eng and build is successful. Change-Id: I04b5f756787a468d45c85546f2028360130bd6c1 --- files/source/row_dspr2.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/source/row_dspr2.cc b/files/source/row_dspr2.cc index 466dd5d9..11f78e0d 100644 --- a/files/source/row_dspr2.cc +++ b/files/source/row_dspr2.cc @@ -68,7 +68,7 @@ void CopyRow_MIPS(const uint8* src, uint8* dst, int count) { "pref 0, 64(%[src]) \n" "pref 30, 32(%[dst]) \n" // In case the a1 > t9 don't use "pref 30" at all - "sgtu $v1, %[dst], $t9 \n" + "sltu $v1, $t9, %[dst] \n" "bgtz $v1, $loop16w \n" "nop \n" // otherwise, start with using pref30 @@ -119,7 +119,7 @@ void CopyRow_MIPS(const uint8* src, uint8* dst, int count) { "sw $t7, 60(%[dst]) \n" "addiu %[dst], %[dst], 64 \n" // adding 64 to dest - "sgtu $v1, %[dst], $t9 \n" + "sltu $v1, $t9, %[dst] \n" "bne %[dst], $a3, $loop16w \n" " addiu %[src], %[src], 64 \n" // adding 64 to src "move %[count], $t8 \n" @@ -221,7 +221,7 @@ void CopyRow_MIPS(const uint8* src, uint8* dst, int count) { "pref 30, 32(%[dst]) \n" // safe, as we have at least 64 bytes ahead // In case the a1 > t9 don't use "pref 30" at all - "sgtu $v1, %[dst], $t9 \n" + "sltu $v1, $t9, %[dst] \n" "bgtz $v1, $ua_loop16w \n" // skip "pref 30,64(a1)" for too short arrays " nop \n" @@ -292,7 +292,7 @@ void CopyRow_MIPS(const uint8* src, uint8* dst, int count) { "sw $t7, 60(%[dst]) \n" "addiu %[dst],%[dst],64 \n" // adding 64 to dest - "sgtu $v1,%[dst],$t9 \n" + "sltu $v1,$t9,%[dst] \n" "bne %[dst],$a3,$ua_loop16w \n" " addiu %[src],%[src],64 \n" // adding 64 to src "move %[count],$t8 \n" -- cgit v1.2.3