RESOLVED FIXED 165519
[WASM] Add support for truncation operators
https://bugs.webkit.org/show_bug.cgi?id=165519
Summary [WASM] Add support for truncation operators
Keith Miller
Reported 2016-12-06 23:55:24 PST
Add support for truncation operators
Attachments
Patch (41.70 KB, patch)
2016-12-07 00:01 PST, Keith Miller
ggaren: review+
Keith Miller
Comment 1 2016-12-07 00:01:43 PST
Geoffrey Garen
Comment 2 2016-12-07 10:39:06 PST
Comment on attachment 296382 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296382&action=review r=me > Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:1316 > + // instructions are the same. Otherwise, we subtract need to int64_t::min() convert then add it back. Otherwise, we need to: subtract int64_t::min(); truncate double to uint64_t; then add back int64_t::min(). > Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:1324 > + m_assembler.movq_i64r(0x8000000000000000, scratchRegister()); Let's use numeric_limits<int64_t>::min() here instead of 0x8. > Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:1356 > + m_assembler.movq_i64r(0x8000000000000000, scratchRegister()); Samesies. > Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:1043 > + constant = m_currentBlock->appendNew<ConstDoubleValue>(m_proc, Origin(), bitwise_cast<double>(0x43e0000000000000)); static_cast<double>(numeric_limits<int64_t>::min()) > Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:1108 > + constant = m_currentBlock->appendNew<ConstFloatValue>(m_proc, Origin(), bitwise_cast<float>(0x5f000000)); static_cast<float>(numeric_limits<int64_t>::min())
Keith Miller
Comment 3 2016-12-07 13:44:27 PST
Note You need to log in before you can comment on or make changes to this bug.