Changeset 209295 in webkit
- Timestamp:
- Dec 2, 2016 10:40:37 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r209293 r209295 24 24 "Unreviewed, forgot to change instruction after renaming." 25 25 http://trac.webkit.org/changeset/209276 26 27 2016-12-02 Keith Miller <keith_miller@apple.com> 28 29 Add Wasm floating point nearest and trunc 30 https://bugs.webkit.org/show_bug.cgi?id=165339 31 32 Reviewed by Saam Barati. 33 34 * wasm/function-tests/nearest.js: Added. 35 * wasm/function-tests/trunc.js: Added. 26 36 27 37 2016-12-02 Keith Miller <keith_miller@apple.com> -
trunk/Source/JavaScriptCore/ChangeLog
r209293 r209295 48 48 "Unreviewed, forgot to change instruction after renaming." 49 49 http://trac.webkit.org/changeset/209276 50 51 2016-12-02 Keith Miller <keith_miller@apple.com> 52 53 Add Wasm floating point nearest and trunc 54 https://bugs.webkit.org/show_bug.cgi?id=165339 55 56 Reviewed by Saam Barati. 57 58 This patch also allows any wasm primitive type to be passed as a 59 string. 60 61 * assembler/MacroAssemblerARM64.h: 62 (JSC::MacroAssemblerARM64::nearestIntDouble): 63 (JSC::MacroAssemblerARM64::nearestIntFloat): 64 (JSC::MacroAssemblerARM64::truncDouble): 65 (JSC::MacroAssemblerARM64::truncFloat): 66 * assembler/MacroAssemblerX86Common.h: 67 (JSC::MacroAssemblerX86Common::nearestIntDouble): 68 (JSC::MacroAssemblerX86Common::nearestIntFloat): 69 * jsc.cpp: 70 (box): 71 * wasm/WasmB3IRGenerator.cpp: 72 (JSC::Wasm::B3IRGenerator::addOp<F64ConvertUI64>): 73 (JSC::Wasm::B3IRGenerator::addOp<OpType::F32ConvertUI64>): 74 (JSC::Wasm::B3IRGenerator::addOp<OpType::F64Nearest>): 75 (JSC::Wasm::B3IRGenerator::addOp<OpType::F32Nearest>): 76 (JSC::Wasm::B3IRGenerator::addOp<OpType::F64Trunc>): 77 (JSC::Wasm::B3IRGenerator::addOp<OpType::F32Trunc>): 78 * wasm/WasmFunctionParser.h: 79 (JSC::Wasm::FunctionParser<Context>::parseExpression): 50 80 51 81 2016-12-02 Keith Miller <keith_miller@apple.com> -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
r209283 r209295 1561 1561 } 1562 1562 1563 void roundTowardNearestIntDouble(FPRegisterID src, FPRegisterID dest) 1564 { 1565 m_assembler.frintn<64>(dest, src); 1566 } 1567 1568 void roundTowardNearestIntFloat(FPRegisterID src, FPRegisterID dest) 1569 { 1570 m_assembler.frintn<32>(dest, src); 1571 } 1572 1563 1573 void roundTowardZeroDouble(FPRegisterID src, FPRegisterID dest) 1564 1574 { … … 1570 1580 m_assembler.frintz<32>(dest, src); 1571 1581 } 1582 1572 1583 1573 1584 // Convert 'src' to an integer, and places the resulting 'dest'. -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
r209283 r209295 796 796 { 797 797 m_assembler.roundss_mr(src.offset, src.base, dst, X86Assembler::RoundingType::TowardNegativeInfiniti); 798 } 799 800 void roundTowardNearestIntDouble(FPRegisterID src, FPRegisterID dst) 801 { 802 m_assembler.roundsd_rr(src, dst, X86Assembler::RoundingType::ToNearestWithTiesToEven); 803 } 804 805 void roundTowardNearestIntFloat(FPRegisterID src, FPRegisterID dst) 806 { 807 m_assembler.roundss_rr(src, dst, X86Assembler::RoundingType::ToNearestWithTiesToEven); 798 808 } 799 809 -
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
r209283 r209295 784 784 } 785 785 786 template<> 787 bool B3IRGenerator::addOp<OpType::F64Nearest>(ExpressionType arg, ExpressionType& result) 788 { 789 PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Double, Origin()); 790 patchpoint->append(arg, ValueRep::SomeRegister); 791 patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) { 792 jit.roundTowardNearestIntDouble(params[1].fpr(), params[0].fpr()); 793 }); 794 patchpoint->effects = Effects::none(); 795 result = patchpoint; 796 return true; 797 } 798 799 template<> 800 bool B3IRGenerator::addOp<OpType::F32Nearest>(ExpressionType arg, ExpressionType& result) 801 { 802 PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Float, Origin()); 803 patchpoint->append(arg, ValueRep::SomeRegister); 804 patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) { 805 jit.roundTowardNearestIntFloat(params[1].fpr(), params[0].fpr()); 806 }); 807 patchpoint->effects = Effects::none(); 808 result = patchpoint; 809 return true; 810 } 811 812 template<> 813 bool B3IRGenerator::addOp<OpType::F64Trunc>(ExpressionType arg, ExpressionType& result) 814 { 815 PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Double, Origin()); 816 patchpoint->append(arg, ValueRep::SomeRegister); 817 patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) { 818 jit.roundTowardZeroDouble(params[1].fpr(), params[0].fpr()); 819 }); 820 patchpoint->effects = Effects::none(); 821 result = patchpoint; 822 return true; 823 } 824 825 template<> 826 bool B3IRGenerator::addOp<OpType::F32Trunc>(ExpressionType arg, ExpressionType& result) 827 { 828 PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Float, Origin()); 829 patchpoint->append(arg, ValueRep::SomeRegister); 830 patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) { 831 jit.roundTowardZeroFloat(params[1].fpr(), params[0].fpr()); 832 }); 833 patchpoint->effects = Effects::none(); 834 result = patchpoint; 835 return true; 836 } 837 786 838 } } // namespace JSC::Wasm 787 839
Note: See TracChangeset
for help on using the changeset viewer.