[x264-devel] [PATCH 09/14] gas-preprocessor: Convert muls into mul+cmp when autoconverting arm code into thumb

Martin Storsjö martin at martin.st
Fri Mar 24 10:33:41 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 35d201d..43ee437 100755
--- a/tools/gas-preprocessor.pl
+++ b/tools/gas-preprocessor.pl
@@ -951,6 +951,9 @@ sub handle_serialized_line {
         $line =~ s/stm(?:db|fd)\s+sp!\s*,\s*\{([^,-]+)\}/str $1, [sp, #-4]!/g;
         $line =~ s/ldm(?:ia|fd)?\s+sp!\s*,\s*\{([^,-]+)\}/ldr $1, [sp], #4/g;
 
+        # Convert muls into mul+cmp
+        $line =~ s/muls\s+(\w+),\s*(\w+)\,\s*(\w+)/mul $1, $2, $3\n\tcmp $1, #0/g;
+
         $line =~ s/\.arm/.thumb/x;
     }
 
-- 
2.7.4



More information about the x264-devel mailing list