Title: [229331] trunk/Source/_javascript_Core
Revision
229331
Author
commit-qu...@webkit.org
Date
2018-03-06 11:14:10 -0800 (Tue, 06 Mar 2018)

Log Message

[ARM] Assembler warnings: "use of r13 is deprecated"
https://bugs.webkit.org/show_bug.cgi?id=183286

Patch by Dominik Infuehr <dinfu...@igalia.com> on 2018-03-06
Reviewed by Mark Lam.

Usage of sp/r13 as operand Rm is deprecated on ARM. offlineasm
sometimes generates assembly code that triggers this warning. Prevent
this by simply switching operands.

* offlineasm/arm.rb:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (229330 => 229331)


--- trunk/Source/_javascript_Core/ChangeLog	2018-03-06 19:10:52 UTC (rev 229330)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-03-06 19:14:10 UTC (rev 229331)
@@ -1,3 +1,16 @@
+2018-03-06  Dominik Infuehr  <dinfu...@igalia.com>
+
+        [ARM] Assembler warnings: "use of r13 is deprecated"
+        https://bugs.webkit.org/show_bug.cgi?id=183286
+
+        Reviewed by Mark Lam.
+
+        Usage of sp/r13 as operand Rm is deprecated on ARM. offlineasm
+        sometimes generates assembly code that triggers this warning. Prevent
+        this by simply switching operands.
+
+        * offlineasm/arm.rb:
+
 2018-03-06  Yusuke Suzuki  <utatane....@gmail.com>
 
         Unreviewed, fix incorrect assertion after r229309

Modified: trunk/Source/_javascript_Core/offlineasm/arm.rb (229330 => 229331)


--- trunk/Source/_javascript_Core/offlineasm/arm.rb	2018-03-06 19:10:52 UTC (rev 229330)
+++ trunk/Source/_javascript_Core/offlineasm/arm.rb	2018-03-06 19:14:10 UTC (rev 229331)
@@ -220,6 +220,58 @@
 # Actual lowering code follows.
 #
 
+def armOpcodeReversedOperands(opcode)
+    m = /\Ab[ipb]/.match(opcode)
+
+    operation = case m.post_match
+                when "eq" then "eq"
+                when "neq" then "neq"
+                when "a" then "b"
+                when "aeq" then "beq"
+                when "b" then "a"
+                when "beq" then "aeq"
+                when "gt" then "lt"
+                when "gteq" then "lteq"
+                when "lt" then "gt"
+                when "lteq" then "gteq"
+                else
+                    raise "unknown operation #{m.post_match}"
+                end
+
+    "#{m[0]}#{operation}"
+end
+
+def armLowerStackPointerInComparison(list)
+    newList = []
+    list.each {
+        | node |
+        if node.is_a? Instruction
+            case node.opcode
+            when "bieq", "bpeq", "bbeq",
+                "bineq", "bpneq", "bbneq",
+                "bia", "bpa", "bba",
+                "biaeq", "bpaeq", "bbaeq",
+                "bib", "bpb", "bbb",
+                "bibeq", "bpbeq", "bbbeq",
+                "bigt", "bpgt", "bbgt",
+                "bigteq", "bpgteq", "bbgteq",
+                "bilt", "bplt", "bblt",
+                "bilteq", "bplteq", "bblteq"
+                if node.operands[1].is_a?(RegisterID) && node.operands[1].name == "sp"
+                    newList << Instruction.new(codeOrigin, armOpcodeReversedOperands(node.opcode), [node.operands[1], node.operands[0]] + node.operands[2..-1])
+                else
+                    newList << node
+                end
+            else
+                newList << node
+            end
+        else
+            newList << node
+        end
+    }
+    newList
+end
+
 class Sequence
     def getModifiedListARM
         raise unless $activeBackend == "ARM"
@@ -258,6 +310,7 @@
         result = riscLowerRegisterReuse(result)
         result = assignRegistersToTemporaries(result, :gpr, ARM_EXTRA_GPRS)
         result = assignRegistersToTemporaries(result, :fpr, ARM_EXTRA_FPRS)
+        result = armLowerStackPointerInComparison(result)
         return result
     end
 end
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to