Fix SH4 build (broken since r148639).
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2013 01:08:49 +0000 (01:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2013 01:08:49 +0000 (01:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114773.

Allow longer displacements for specific branches in SH4 LLINT.

Patch by Julien Brianceau <jbrianceau@nds.com> on 2013-04-17
Reviewed by Oliver Hunt.

* offlineasm/sh4.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148653 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/offlineasm/sh4.rb

index 981dc01..5fb891f 100644 (file)
@@ -1,3 +1,14 @@
+2013-04-17  Julien Brianceau  <jbrianceau@nds.com>
+
+        Fix SH4 build (broken since r148639).
+        https://bugs.webkit.org/show_bug.cgi?id=114773.
+
+        Allow longer displacements for specific branches in SH4 LLINT.
+
+        Reviewed by Oliver Hunt.
+
+        * offlineasm/sh4.rb:
+
 2013-04-14  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. More Windows build fix.
index ae50585..02636d1 100644 (file)
@@ -457,8 +457,21 @@ def emitSH4ShiftImm(val, operand, direction)
 end
 
 def emitSH4BranchIfT(label, neg)
-    sh4opcode = neg ? "bf" : "bt"
-    $asm.puts "#{sh4opcode} #{label.asmLabel}"
+    outlabel = LocalLabel.unique("branchIfT")
+    sh4opcode = neg ? "bt" : "bf"
+    $asm.puts "#{sh4opcode} #{LocalLabelReference.new(codeOrigin, outlabel).asmLabel}"
+    if label.is_a? LocalLabelReference
+        $asm.puts "bra #{label.asmLabel}"
+        $asm.puts "nop"
+    else
+        $asm.puts ".balign 4"
+        $asm.puts "mov.l @(8, PC), #{SH4_TMP_GPRS[0].sh4Operand}"
+        $asm.puts "jmp @#{SH4_TMP_GPRS[0].sh4Operand}"
+        $asm.puts "nop"
+        $asm.puts "nop"
+        $asm.puts ".long #{label.asmLabel}"
+    end
+    outlabel.lower("SH4")
 end
 
 def emitSH4IntCompare(cmpOpcode, operands)