[x264-devel] [PATCH 10/14] gas-preprocessor: Convert "and r0, sp, #xx" into "mov r0, sp", "and r0, r0, #xx" when converting to thumb

Martin Storsjö martin at martin.st
Fri Mar 24 10:33:42 CET 2017


---
 tools/gas-preprocessor.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/gas-preprocessor.pl b/tools/gas-preprocessor.pl
index 43ee437..4c2cf9d 100755
--- a/tools/gas-preprocessor.pl
+++ b/tools/gas-preprocessor.pl
@@ -954,6 +954,9 @@ sub handle_serialized_line {
         # Convert muls into mul+cmp
         $line =~ s/muls\s+(\w+),\s*(\w+)\,\s*(\w+)/mul $1, $2, $3\n\tcmp $1, #0/g;
 
+        # Convert "and r0, sp, #xx" into "mov r0, sp", "and r0, r0, #xx"
+        $line =~ s/and\s+(\w+),\s*(sp|r13)\,\s*#(\w+)/mov $1, $2\n\tand $1, $1, #$3/g;
+
         $line =~ s/\.arm/.thumb/x;
     }
 
-- 
2.7.4



More information about the x264-devel mailing list