haikuwebkit/Source/JavaScriptCore/jit/JITBitOrGenerator.h

47 lines
1.8 KiB
C
Raw Permalink Normal View History

Snippefy bitwise operators for the baseline JIT. https://bugs.webkit.org/show_bug.cgi?id=151680 Reviewed by Geoffrey Garen. This patch has passed the JSC tests on x86 and x86_64. It has also passed the layout tests on x86_64. With the DFG enabled, perf is neutral on x86_64 and x86. With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g. gcc-loops.cpp 1.0269x faster stepanov_container.cpp 1.0180x faster With the DFG disabled on x86, perf is neutral. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::moveValueRegs): (JSC::AssemblyHelpers::branchIfNotInt32): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emitBitwiseBinaryOpFastPath): - Template for the bitwise operations. (JSC::JIT::emit_op_bitand): (JSC::JIT::emit_op_bitor): (JSC::JIT::emit_op_bitxor): - Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators. (JSC::JIT::emitSlow_op_bitand): (JSC::JIT::emitSlow_op_bitor): (JSC::JIT::emitSlow_op_bitxor): - Implement respective slow paths. * jit/JITArithmetic32_64.cpp: (JSC::JIT::emit_op_bitand): Deleted. (JSC::JIT::emitSlow_op_bitand): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. - Now unified with the 64-bit version using snippets. * jit/JITBitAndGenerator.cpp: Added. (JSC::JITBitAndGenerator::generateFastPath): * jit/JITBitAndGenerator.h: Added. (JSC::JITBitAndGenerator::JITBitAndGenerator): * jit/JITBitOrGenerator.cpp: Added. (JSC::JITBitOrGenerator::generateFastPath): * jit/JITBitOrGenerator.h: Added. (JSC::JITBitOrGenerator::JITBitOrGenerator): * jit/JITBitXorGenerator.cpp: Added. (JSC::JITBitXorGenerator::generateFastPath): * jit/JITBitXorGenerator.h: Added. (JSC::JITBitXorGenerator::JITBitXorGenerator): * jit/JITBitwiseBinaryOpGenerator.h: Added. (JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator): (JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath): (JSC::JITBitwiseBinaryOpGenerator::endJumpList): (JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. * jit/SnippetOperand.h: (JSC::SnippetOperand::SnippetOperand): * tests/stress/op_bitand.js: * tests/stress/op_bitor.js: * tests/stress/op_bitxor.js: - Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff. Canonical link: https://commits.webkit.org/170017@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-04 22:28:11 +00:00
/*
* Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
Snippefy bitwise operators for the baseline JIT. https://bugs.webkit.org/show_bug.cgi?id=151680 Reviewed by Geoffrey Garen. This patch has passed the JSC tests on x86 and x86_64. It has also passed the layout tests on x86_64. With the DFG enabled, perf is neutral on x86_64 and x86. With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g. gcc-loops.cpp 1.0269x faster stepanov_container.cpp 1.0180x faster With the DFG disabled on x86, perf is neutral. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::moveValueRegs): (JSC::AssemblyHelpers::branchIfNotInt32): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emitBitwiseBinaryOpFastPath): - Template for the bitwise operations. (JSC::JIT::emit_op_bitand): (JSC::JIT::emit_op_bitor): (JSC::JIT::emit_op_bitxor): - Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators. (JSC::JIT::emitSlow_op_bitand): (JSC::JIT::emitSlow_op_bitor): (JSC::JIT::emitSlow_op_bitxor): - Implement respective slow paths. * jit/JITArithmetic32_64.cpp: (JSC::JIT::emit_op_bitand): Deleted. (JSC::JIT::emitSlow_op_bitand): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. - Now unified with the 64-bit version using snippets. * jit/JITBitAndGenerator.cpp: Added. (JSC::JITBitAndGenerator::generateFastPath): * jit/JITBitAndGenerator.h: Added. (JSC::JITBitAndGenerator::JITBitAndGenerator): * jit/JITBitOrGenerator.cpp: Added. (JSC::JITBitOrGenerator::generateFastPath): * jit/JITBitOrGenerator.h: Added. (JSC::JITBitOrGenerator::JITBitOrGenerator): * jit/JITBitXorGenerator.cpp: Added. (JSC::JITBitXorGenerator::generateFastPath): * jit/JITBitXorGenerator.h: Added. (JSC::JITBitXorGenerator::JITBitXorGenerator): * jit/JITBitwiseBinaryOpGenerator.h: Added. (JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator): (JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath): (JSC::JITBitwiseBinaryOpGenerator::endJumpList): (JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. * jit/SnippetOperand.h: (JSC::SnippetOperand::SnippetOperand): * tests/stress/op_bitand.js: * tests/stress/op_bitor.js: * tests/stress/op_bitxor.js: - Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff. Canonical link: https://commits.webkit.org/170017@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-04 22:28:11 +00:00
#if ENABLE(JIT)
#include "JITBitBinaryOpGenerator.h"
Snippefy bitwise operators for the baseline JIT. https://bugs.webkit.org/show_bug.cgi?id=151680 Reviewed by Geoffrey Garen. This patch has passed the JSC tests on x86 and x86_64. It has also passed the layout tests on x86_64. With the DFG enabled, perf is neutral on x86_64 and x86. With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g. gcc-loops.cpp 1.0269x faster stepanov_container.cpp 1.0180x faster With the DFG disabled on x86, perf is neutral. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::moveValueRegs): (JSC::AssemblyHelpers::branchIfNotInt32): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emitBitwiseBinaryOpFastPath): - Template for the bitwise operations. (JSC::JIT::emit_op_bitand): (JSC::JIT::emit_op_bitor): (JSC::JIT::emit_op_bitxor): - Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators. (JSC::JIT::emitSlow_op_bitand): (JSC::JIT::emitSlow_op_bitor): (JSC::JIT::emitSlow_op_bitxor): - Implement respective slow paths. * jit/JITArithmetic32_64.cpp: (JSC::JIT::emit_op_bitand): Deleted. (JSC::JIT::emitSlow_op_bitand): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. - Now unified with the 64-bit version using snippets. * jit/JITBitAndGenerator.cpp: Added. (JSC::JITBitAndGenerator::generateFastPath): * jit/JITBitAndGenerator.h: Added. (JSC::JITBitAndGenerator::JITBitAndGenerator): * jit/JITBitOrGenerator.cpp: Added. (JSC::JITBitOrGenerator::generateFastPath): * jit/JITBitOrGenerator.h: Added. (JSC::JITBitOrGenerator::JITBitOrGenerator): * jit/JITBitXorGenerator.cpp: Added. (JSC::JITBitXorGenerator::generateFastPath): * jit/JITBitXorGenerator.h: Added. (JSC::JITBitXorGenerator::JITBitXorGenerator): * jit/JITBitwiseBinaryOpGenerator.h: Added. (JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator): (JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath): (JSC::JITBitwiseBinaryOpGenerator::endJumpList): (JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. * jit/SnippetOperand.h: (JSC::SnippetOperand::SnippetOperand): * tests/stress/op_bitand.js: * tests/stress/op_bitor.js: * tests/stress/op_bitxor.js: - Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff. Canonical link: https://commits.webkit.org/170017@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-04 22:28:11 +00:00
namespace JSC {
class JITBitOrGenerator : public JITBitBinaryOpGenerator {
Snippefy bitwise operators for the baseline JIT. https://bugs.webkit.org/show_bug.cgi?id=151680 Reviewed by Geoffrey Garen. This patch has passed the JSC tests on x86 and x86_64. It has also passed the layout tests on x86_64. With the DFG enabled, perf is neutral on x86_64 and x86. With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g. gcc-loops.cpp 1.0269x faster stepanov_container.cpp 1.0180x faster With the DFG disabled on x86, perf is neutral. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::moveValueRegs): (JSC::AssemblyHelpers::branchIfNotInt32): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emitBitwiseBinaryOpFastPath): - Template for the bitwise operations. (JSC::JIT::emit_op_bitand): (JSC::JIT::emit_op_bitor): (JSC::JIT::emit_op_bitxor): - Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators. (JSC::JIT::emitSlow_op_bitand): (JSC::JIT::emitSlow_op_bitor): (JSC::JIT::emitSlow_op_bitxor): - Implement respective slow paths. * jit/JITArithmetic32_64.cpp: (JSC::JIT::emit_op_bitand): Deleted. (JSC::JIT::emitSlow_op_bitand): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. - Now unified with the 64-bit version using snippets. * jit/JITBitAndGenerator.cpp: Added. (JSC::JITBitAndGenerator::generateFastPath): * jit/JITBitAndGenerator.h: Added. (JSC::JITBitAndGenerator::JITBitAndGenerator): * jit/JITBitOrGenerator.cpp: Added. (JSC::JITBitOrGenerator::generateFastPath): * jit/JITBitOrGenerator.h: Added. (JSC::JITBitOrGenerator::JITBitOrGenerator): * jit/JITBitXorGenerator.cpp: Added. (JSC::JITBitXorGenerator::generateFastPath): * jit/JITBitXorGenerator.h: Added. (JSC::JITBitXorGenerator::JITBitXorGenerator): * jit/JITBitwiseBinaryOpGenerator.h: Added. (JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator): (JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath): (JSC::JITBitwiseBinaryOpGenerator::endJumpList): (JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. * jit/SnippetOperand.h: (JSC::SnippetOperand::SnippetOperand): * tests/stress/op_bitand.js: * tests/stress/op_bitor.js: * tests/stress/op_bitxor.js: - Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff. Canonical link: https://commits.webkit.org/170017@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-04 22:28:11 +00:00
public:
JITBitOrGenerator(const SnippetOperand& leftOperand, const SnippetOperand& rightOperand,
JSValueRegs result, JSValueRegs left, JSValueRegs right, GPRReg unused = InvalidGPRReg)
: JITBitBinaryOpGenerator(leftOperand, rightOperand, result, left, right, unused)
Snippefy bitwise operators for the baseline JIT. https://bugs.webkit.org/show_bug.cgi?id=151680 Reviewed by Geoffrey Garen. This patch has passed the JSC tests on x86 and x86_64. It has also passed the layout tests on x86_64. With the DFG enabled, perf is neutral on x86_64 and x86. With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g. gcc-loops.cpp 1.0269x faster stepanov_container.cpp 1.0180x faster With the DFG disabled on x86, perf is neutral. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::moveValueRegs): (JSC::AssemblyHelpers::branchIfNotInt32): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emitBitwiseBinaryOpFastPath): - Template for the bitwise operations. (JSC::JIT::emit_op_bitand): (JSC::JIT::emit_op_bitor): (JSC::JIT::emit_op_bitxor): - Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators. (JSC::JIT::emitSlow_op_bitand): (JSC::JIT::emitSlow_op_bitor): (JSC::JIT::emitSlow_op_bitxor): - Implement respective slow paths. * jit/JITArithmetic32_64.cpp: (JSC::JIT::emit_op_bitand): Deleted. (JSC::JIT::emitSlow_op_bitand): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. - Now unified with the 64-bit version using snippets. * jit/JITBitAndGenerator.cpp: Added. (JSC::JITBitAndGenerator::generateFastPath): * jit/JITBitAndGenerator.h: Added. (JSC::JITBitAndGenerator::JITBitAndGenerator): * jit/JITBitOrGenerator.cpp: Added. (JSC::JITBitOrGenerator::generateFastPath): * jit/JITBitOrGenerator.h: Added. (JSC::JITBitOrGenerator::JITBitOrGenerator): * jit/JITBitXorGenerator.cpp: Added. (JSC::JITBitXorGenerator::generateFastPath): * jit/JITBitXorGenerator.h: Added. (JSC::JITBitXorGenerator::JITBitXorGenerator): * jit/JITBitwiseBinaryOpGenerator.h: Added. (JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator): (JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath): (JSC::JITBitwiseBinaryOpGenerator::endJumpList): (JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_bitxor): Deleted. (JSC::JIT::emit_op_bitor): Deleted. (JSC::JIT::emitSlow_op_bitxor): Deleted. (JSC::JIT::emitSlow_op_bitor): Deleted. * jit/SnippetOperand.h: (JSC::SnippetOperand::SnippetOperand): * tests/stress/op_bitand.js: * tests/stress/op_bitor.js: * tests/stress/op_bitxor.js: - Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff. Canonical link: https://commits.webkit.org/170017@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-04 22:28:11 +00:00
{ }
void generateFastPath(CCallHelpers&);
};
} // namespace JSC
#endif // ENABLE(JIT)