Changeset 229331 in webkit


Ignore:
Timestamp:
Mar 6, 2018 11:14:10 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Dominik Infuehr <dinfuehr@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:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r229324 r229331  
     12018-03-06  Dominik Infuehr  <dinfuehr@igalia.com>
     2
     3        [ARM] Assembler warnings: "use of r13 is deprecated"
     4        https://bugs.webkit.org/show_bug.cgi?id=183286
     5
     6        Reviewed by Mark Lam.
     7
     8        Usage of sp/r13 as operand Rm is deprecated on ARM. offlineasm
     9        sometimes generates assembly code that triggers this warning. Prevent
     10        this by simply switching operands.
     11
     12        * offlineasm/arm.rb:
     13
    1142018-03-06  Yusuke Suzuki  <utatane.tea@gmail.com>
    215
  • trunk/Source/JavaScriptCore/offlineasm/arm.rb

    r228402 r229331  
    221221#
    222222
     223def armOpcodeReversedOperands(opcode)
     224    m = /\Ab[ipb]/.match(opcode)
     225
     226    operation = case m.post_match
     227                when "eq" then "eq"
     228                when "neq" then "neq"
     229                when "a" then "b"
     230                when "aeq" then "beq"
     231                when "b" then "a"
     232                when "beq" then "aeq"
     233                when "gt" then "lt"
     234                when "gteq" then "lteq"
     235                when "lt" then "gt"
     236                when "lteq" then "gteq"
     237                else
     238                    raise "unknown operation #{m.post_match}"
     239                end
     240
     241    "#{m[0]}#{operation}"
     242end
     243
     244def armLowerStackPointerInComparison(list)
     245    newList = []
     246    list.each {
     247        | node |
     248        if node.is_a? Instruction
     249            case node.opcode
     250            when "bieq", "bpeq", "bbeq",
     251                "bineq", "bpneq", "bbneq",
     252                "bia", "bpa", "bba",
     253                "biaeq", "bpaeq", "bbaeq",
     254                "bib", "bpb", "bbb",
     255                "bibeq", "bpbeq", "bbbeq",
     256                "bigt", "bpgt", "bbgt",
     257                "bigteq", "bpgteq", "bbgteq",
     258                "bilt", "bplt", "bblt",
     259                "bilteq", "bplteq", "bblteq"
     260                if node.operands[1].is_a?(RegisterID) && node.operands[1].name == "sp"
     261                    newList << Instruction.new(codeOrigin, armOpcodeReversedOperands(node.opcode), [node.operands[1], node.operands[0]] + node.operands[2..-1])
     262                else
     263                    newList << node
     264                end
     265            else
     266                newList << node
     267            end
     268        else
     269            newList << node
     270        end
     271    }
     272    newList
     273end
     274
    223275class Sequence
    224276    def getModifiedListARM
     
    259311        result = assignRegistersToTemporaries(result, :gpr, ARM_EXTRA_GPRS)
    260312        result = assignRegistersToTemporaries(result, :fpr, ARM_EXTRA_FPRS)
     313        result = armLowerStackPointerInComparison(result)
    261314        return result
    262315    end
Note: See TracChangeset for help on using the changeset viewer.