Commit 4965ebc2 authored by oliver@apple.com's avatar oliver@apple.com

fourthTier: FTL should support LogicalNot

https://bugs.webkit.org/show_bug.cgi?id=115924

Reviewed by Mark Hahnenberg.

* ftl/FTLAbbreviations.h:
(JSC::FTL::buildNot):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileLogicalNot):
(LowerDFGToLLVM):
* ftl/FTLOutput.h:
(JSC::FTL::Output::bitNot):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1f9b9b7d
2013-05-10 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL should support LogicalNot
https://bugs.webkit.org/show_bug.cgi?id=115924
Reviewed by Mark Hahnenberg.
* ftl/FTLAbbreviations.h:
(JSC::FTL::buildNot):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileLogicalNot):
(LowerDFGToLLVM):
* ftl/FTLOutput.h:
(JSC::FTL::Output::bitNot):
2013-05-10 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL should support CompareGreater, CompareLessEq, and CompareGreaterEq
......
......@@ -195,6 +195,7 @@ static inline LValue buildXor(LBuilder builder, LValue left, LValue right) { ret
static inline LValue buildShl(LBuilder builder, LValue left, LValue right) { return LLVMBuildShl(builder, left, right, ""); }
static inline LValue buildAShr(LBuilder builder, LValue left, LValue right) { return LLVMBuildAShr(builder, left, right, ""); }
static inline LValue buildLShr(LBuilder builder, LValue left, LValue right) { return LLVMBuildLShr(builder, left, right, ""); }
static inline LValue buildNot(LBuilder builder, LValue value) { return LLVMBuildNot(builder, value, ""); }
static inline LValue buildLoad(LBuilder builder, LValue pointer) { return LLVMBuildLoad(builder, pointer, ""); }
static inline LValue buildStore(LBuilder builder, LValue value, LValue pointer) { return LLVMBuildStore(builder, value, pointer); }
static inline LValue buildZExt(LBuilder builder, LValue value, LType type) { return LLVMBuildZExt(builder, value, type, ""); }
......
......@@ -146,6 +146,7 @@ bool canCompile(Graph& graph)
break;
return false;
case Branch:
case LogicalNot:
if (node->child1().useKind() == BooleanUse)
break;
return false;
......
......@@ -373,6 +373,9 @@ private:
case CompareGreaterEq:
compileCompareGreaterEq();
break;
case LogicalNot:
compileLogicalNot();
break;
case Branch:
compileBranch();
break;
......@@ -1040,6 +1043,20 @@ private:
RELEASE_ASSERT_NOT_REACHED();
}
void compileLogicalNot()
{
switch (m_node->child1().useKind()) {
case BooleanUse: {
m_booleanValues.add(m_node, m_out.bitNot(lowBoolean(m_node->child1())));
break;
}
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
}
void compileBranch()
{
switch (m_node->child1().useKind()) {
......
......@@ -138,6 +138,7 @@ public:
LValue shl(LValue left, LValue right) { return buildShl(m_builder, left, right); }
LValue aShr(LValue left, LValue right) { return buildAShr(m_builder, left, right); }
LValue lShr(LValue left, LValue right) { return buildLShr(m_builder, left, right); }
LValue bitNot(LValue value) { return buildNot(m_builder, value); }
LValue addWithOverflow32(LValue left, LValue right)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment