New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSC] Clean up wasm AirIRGenerator FP truncation #4539
[JSC] Clean up wasm AirIRGenerator FP truncation #4539
Conversation
0e64991
to
4e5598d
Compare
EWS run on previous version of this PR (hash 4e5598d)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
4e5598d
to
2195b79
Compare
EWS run on previous version of this PR (hash 2195b79)
|
(^ rebase and fix typo in comment) |
2195b79
to
01380fd
Compare
EWS run on current version of this PR (hash 01380fd)
|
https://bugs.webkit.org/show_bug.cgi?id=245436 Reviewed by Justin Michaud. The implementation for all of the (checked and saturated) floating point to integer truncations ends up being really duplicative--we have code for the patchpoints to generate the appropriate instructions twice for each flavor of this operation and code for the bounds checking needed is duplicated many times. This patch adds a new method for generating only the code for an unchecked truncation; a table of the output ranges for each flavor, and uses both to have a single implementation for both the checked and saturating versions of each truncation instruction. Also avoids clobbering the macro scratch registers on ARM64 for some variants of the truncation (the ones resulting in U64s) since the macro assembler doesn't seem to actually need them on that architecture. Relying on the existing test suite; this shouldn't really change the generated code, except for the change to the macro scratch register clobbers on ARM64. * Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::lookupTruncationRange): (JSC::Wasm::AirIRGenerator::addUncheckedFloatingPointTruncation): (JSC::Wasm::AirIRGenerator::truncSaturated): (JSC::Wasm::AirIRGenerator::addCheckedFloatingPointTruncation): (JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncSF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncSF32>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncUF32>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncSF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncSF32>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): Canonical link: https://commits.webkit.org/254875@main
01380fd
to
b07e2d5
Compare
Committed 254875@main (b07e2d5): https://commits.webkit.org/254875@main Reviewed commits have been landed. Closing PR #4539 and removing active labels. |
b07e2d5
01380fd
π mac-debugπ§ͺ ios-wk2π§ͺ mac-AS-debug-wk2