Changeset 160315 in webkit


Ignore:
Timestamp:
Dec 9, 2013 10:36:44 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Fix sh4 LLINT build.
https://bugs.webkit.org/show_bug.cgi?id=125454

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-12-09
Reviewed by Michael Saboff.

In LLINT, sh4 backend implementation didn't handle properly conditional jumps using
a LabelReference instance. This patch fixes it through sh4LowerMisplacedLabels phase.
Also, to avoid the need of a 4th temporary gpr, this phase is triggered later in
getModifiedListSH4.

  • offlineasm/sh4.rb:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r160295 r160315  
     12013-12-09  Julien Brianceau  <jbriance@cisco.com>
     2
     3        Fix sh4 LLINT build.
     4        https://bugs.webkit.org/show_bug.cgi?id=125454
     5
     6        Reviewed by Michael Saboff.
     7
     8        In LLINT, sh4 backend implementation didn't handle properly conditional jumps using
     9        a LabelReference instance. This patch fixes it through sh4LowerMisplacedLabels phase.
     10        Also, to avoid the need of a 4th temporary gpr, this phase is triggered later in
     11        getModifiedListSH4.
     12
     13        * offlineasm/sh4.rb:
     14
    1152013-12-08  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/JavaScriptCore/offlineasm/sh4.rb

    r160100 r160315  
    453453        | node |
    454454        if node.is_a? Instruction
    455             case node.opcode
    456             when "jmp", "call"
    457                 if node.operands[0].is_a? LabelReference
    458                     tmp = Tmp.new(codeOrigin, :gpr)
    459                     newList << Instruction.new(codeOrigin, "move", [node.operands[0], tmp])
    460                     newList << Instruction.new(codeOrigin, node.opcode, [tmp])
    461                 else
    462                     newList << node
    463                 end
    464             else
    465                 newList << node
    466             end
     455            operands = node.operands
     456            newOperands = []
     457            operands.each {
     458                | operand |
     459                if operand.is_a? LabelReference
     460                    tmp = Tmp.new(operand.codeOrigin, :gpr)
     461                    newList << Instruction.new(operand.codeOrigin, "move", [operand, tmp])
     462                    newOperands << tmp
     463                else
     464                    newOperands << operand
     465                end
     466            }
     467            newList << Instruction.new(node.codeOrigin, node.opcode, newOperands, node.annotation)
    467468        else
    468469            newList << node
     
    731732            "bigteq", "bpgteq", "bilt", "bplt", "bigt", "bpgt", "bilteq", "bplteq", "btiz", "btpz", "btinz", "btpnz", "btbz", "btbnz"])
    732733        result = riscLowerMalformedImmediates(result, -128..127)
     734        result = riscLowerMisplacedAddresses(result)
    733735        result = sh4LowerMisplacedLabels(result)
    734         result = riscLowerMisplacedAddresses(result)
    735736        result = sh4LowerMisplacedSpecialRegisters(result)
    736737
     
    750751
    751752def emitSH4Branch(sh4opcode, operand)
     753    raise "Invalid operand #{operand}" unless operand.is_a? RegisterID or operand.is_a? SpecialRegister
    752754    $asm.puts "#{sh4opcode} @#{operand.sh4Operand}"
    753755    $asm.puts "nop"
     
    773775end
    774776
    775 def emitSH4BranchIfT(label, neg)
     777def emitSH4BranchIfT(dest, neg)
    776778    outlabel = LocalLabel.unique("branchIfT")
    777779    sh4opcode = neg ? "bt" : "bf"
    778780    $asm.puts "#{sh4opcode} #{LocalLabelReference.new(codeOrigin, outlabel).asmLabel}"
    779     $asm.puts "bra #{label.asmLabel}"
    780     $asm.puts "nop"
     781    if dest.is_a? LocalLabelReference
     782        $asm.puts "bra #{dest.asmLabel}"
     783        $asm.puts "nop"
     784    else
     785        emitSH4Branch("jmp", dest)
     786    end
    781787    outlabel.lower("SH4")
    782788end
Note: See TracChangeset for help on using the changeset viewer.