summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/offlineasm
diff options
context:
space:
mode:
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2013-09-16 09:05:38 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-17 16:06:40 +0200
commitbc425620d469b437c3045ddf383a54920e1bea03 (patch)
tree719bc0c9a8f0cba3cc959935542528965b5c04bc /Source/JavaScriptCore/offlineasm
parent73bc82e67431b163a520d2c52a79fe9964b9c92e (diff)
downloadqtwebkit-bc425620d469b437c3045ddf383a54920e1bea03.tar.gz
[sh4] Handle subp opcode with 3 operands and bpbeq opcode in LLINT.
https://bugs.webkit.org/show_bug.cgi?id=121412 Patch by Julien Brianceau <jbriance@cisco.com> on 2013-09-16 Reviewed by Andreas Kling. * offlineasm/sh4.rb: Change-Id: I4c0cbe22fb409b8d0d20c4c498b13a7e0ff870d0 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155846 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/offlineasm')
-rw-r--r--Source/JavaScriptCore/offlineasm/sh4.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/offlineasm/sh4.rb b/Source/JavaScriptCore/offlineasm/sh4.rb
index 57223c826..3abfd3484 100644
--- a/Source/JavaScriptCore/offlineasm/sh4.rb
+++ b/Source/JavaScriptCore/offlineasm/sh4.rb
@@ -570,11 +570,20 @@ class Instruction
$asm.puts "add #{sh4Operands(operands)}"
end
when "subi", "subp"
- raise "#{opcode} with #{operands.size} operands is not handled yet" unless operands.size == 2
- if operands[0].is_a? Immediate
- $asm.puts "add #{sh4Operands([Immediate.new(codeOrigin, -1 * operands[0].value), operands[1]])}"
+ if operands.size == 3
+ if operands[1] != operands[2]
+ $asm.puts "neg #{sh4Operands([operands[2], operands[2]])}"
+ $asm.puts "add #{sh4Operands([operands[0], operands[2]])}"
+ else
+ $asm.puts "mov #{sh4Operands([operands[0], operands[2]])}"
+ $asm.puts "sub #{sh4Operands([operands[1], operands[2]])}"
+ end
else
- $asm.puts "sub #{sh4Operands(operands)}"
+ if operands[0].is_a? Immediate
+ $asm.puts "add #{sh4Operands([Immediate.new(codeOrigin, -1 * operands[0].value), operands[1]])}"
+ else
+ $asm.puts "sub #{sh4Operands(operands)}"
+ end
end
when "muli", "mulp"
$asm.puts "mul.l #{sh4Operands(operands[0..1])}"
@@ -681,6 +690,8 @@ class Instruction
emitSH4CondBranch("hs", true, operands)
when "bia", "bpa", "bba"
emitSH4CondBranch("hi", false, operands)
+ when "bibeq", "bpbeq"
+ emitSH4CondBranch("hi", true, operands)
when "biaeq", "bpaeq"
emitSH4CondBranch("hs", false, operands)
when "bigteq", "bpgteq", "bbgteq"