aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4isel_masm.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-07-22 11:56:33 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2014-08-12 12:30:34 +0200
commit4ad1b63f257ac033e3876130f39eba3325363de5 (patch)
treee617b30d8afa3ae0f132396fb70857e22cc6121f /src/qml/jit/qv4isel_masm.cpp
parentf87d2a40ef2f20a11ed1353ed59ef8ced2cecb00 (diff)
V4 JIT: generate code for int32 comparisons.
Change-Id: I5e88fb3df7b01f4f515ce4d2e451a5a6f5ba92ad Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jit/qv4isel_masm.cpp')
-rw-r--r--src/qml/jit/qv4isel_masm.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index b91b5eabc0..f5d112c072 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -1304,6 +1304,10 @@ void InstructionSelection::visitCJump(IR::CJump *s)
&& visitCJumpDouble(b->op, b->left, b->right, s->iftrue, s->iffalse))
return;
+ if (b->left->type == IR::SInt32Type && b->right->type == IR::SInt32Type
+ && visitCJumpSInt32(b->op, b->left, b->right, s->iftrue, s->iffalse))
+ return;
+
if (b->op == IR::OpStrictEqual || b->op == IR::OpStrictNotEqual) {
visitCJumpStrict(b, s->iftrue, s->iffalse);
return;
@@ -1580,6 +1584,23 @@ bool InstructionSelection::visitCJumpDouble(IR::AluOp op, IR::Expr *left, IR::Ex
return true;
}
+bool InstructionSelection::visitCJumpSInt32(IR::AluOp op, IR::Expr *left, IR::Expr *right,
+ IR::BasicBlock *iftrue, IR::BasicBlock *iffalse)
+{
+ if (!isPregOrConst(left) || !isPregOrConst(right))
+ return false;
+
+ if (_as->nextBlock() == iftrue) {
+ Assembler::Jump target = _as->branchInt32(true, op, left, right);
+ _as->addPatch(iffalse, target);
+ } else {
+ Assembler::Jump target = _as->branchInt32(false, op, left, right);
+ _as->addPatch(iftrue, target);
+ _as->jumpToBlock(_block, iffalse);
+ }
+ return true;
+}
+
void InstructionSelection::visitCJumpStrict(IR::Binop *binop, IR::BasicBlock *trueBlock,
IR::BasicBlock *falseBlock)
{