Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: b07e2d5c790373fbf908cecdf9aa47517c40de93 https://github.com/WebKit/WebKit/commit/b07e2d5c790373fbf908cecdf9aa47517c40de93 Author: Joseph Griego <jgri...@igalia.com> Date: 2022-09-26 (Mon, 26 Sep 2022)
Changed paths: M Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp Log Message: ----------- [JSC] Clean up wasm AirIRGenerator FP truncation 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 _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes