Printer.cpp 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  1. /*
  2. * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/HashMap.h>
  7. #include <AK/TemporaryChange.h>
  8. #include <LibWasm/AbstractMachine/AbstractMachine.h>
  9. #include <LibWasm/Printer/Printer.h>
  10. namespace Wasm {
  11. struct Names {
  12. static HashMap<OpCode, ByteString> instruction_names;
  13. static HashMap<ByteString, OpCode> instructions_by_name;
  14. };
  15. ByteString instruction_name(OpCode const& opcode)
  16. {
  17. return Names::instruction_names.get(opcode).value_or("<unknown>");
  18. }
  19. Optional<OpCode> instruction_from_name(StringView name)
  20. {
  21. if (Names::instructions_by_name.is_empty()) {
  22. for (auto& entry : Names::instruction_names)
  23. Names::instructions_by_name.set(entry.value, entry.key);
  24. }
  25. return Names::instructions_by_name.get(name);
  26. }
  27. void Printer::print_indent()
  28. {
  29. for (size_t i = 0; i < m_indent; ++i)
  30. m_stream.write_until_depleted(" "sv.bytes()).release_value_but_fixme_should_propagate_errors();
  31. }
  32. void Printer::print(Wasm::BlockType const& type)
  33. {
  34. print_indent();
  35. print("(type block ");
  36. switch (type.kind()) {
  37. case Wasm::BlockType::Kind::Index:
  38. print("index {})\n", type.type_index().value());
  39. return;
  40. case Wasm::BlockType::Kind::Type: {
  41. print("type\n");
  42. {
  43. TemporaryChange change { m_indent, m_indent + 1 };
  44. print(type.value_type());
  45. }
  46. print_indent();
  47. print(")\n");
  48. return;
  49. }
  50. case Wasm::BlockType::Kind ::Empty:
  51. print("empty)\n");
  52. return;
  53. }
  54. VERIFY_NOT_REACHED();
  55. }
  56. void Printer::print(Wasm::CodeSection const& section)
  57. {
  58. print_indent();
  59. print("(section code\n");
  60. {
  61. TemporaryChange change { m_indent, m_indent + 1 };
  62. for (auto& code : section.functions())
  63. print(code);
  64. }
  65. print_indent();
  66. print(")\n");
  67. }
  68. void Printer::print(Wasm::CodeSection::Code const& code)
  69. {
  70. print(code.func());
  71. }
  72. void Printer::print(Wasm::CustomSection const& section)
  73. {
  74. print_indent();
  75. print("(section custom\n");
  76. {
  77. TemporaryChange change { m_indent, m_indent + 1 };
  78. print_indent();
  79. print("(name `{}')\n", section.name());
  80. print_indent();
  81. print("(contents {} bytes)\n", section.contents().size());
  82. }
  83. print_indent();
  84. print(")\n");
  85. }
  86. void Printer::print(Wasm::DataCountSection const& section)
  87. {
  88. print_indent();
  89. print("(section data count\n");
  90. if (section.count().has_value()) {
  91. TemporaryChange change { m_indent, m_indent + 1 };
  92. print_indent();
  93. print("(count `{}')\n", *section.count());
  94. }
  95. print_indent();
  96. print(")\n");
  97. }
  98. void Printer::print(Wasm::DataSection const& section)
  99. {
  100. print_indent();
  101. print("(section data\n");
  102. {
  103. TemporaryChange change { m_indent, m_indent + 1 };
  104. for (auto& entry : section.data())
  105. print(entry);
  106. }
  107. print_indent();
  108. print(")\n");
  109. }
  110. void Printer::print(Wasm::DataSection::Data const& data)
  111. {
  112. print_indent();
  113. print("(data with value\n");
  114. {
  115. TemporaryChange change { m_indent, m_indent + 1 };
  116. data.value().visit(
  117. [this](DataSection::Data::Passive const& value) {
  118. print_indent();
  119. print("(passive init {}xu8 (", value.init.size());
  120. print(ByteString::join(' ', value.init, "{:x}"sv));
  121. print(")\n");
  122. },
  123. [this](DataSection::Data::Active const& value) {
  124. print_indent();
  125. print("(active init {}xu8 (", value.init.size());
  126. print(ByteString::join(' ', value.init, "{:x}"sv));
  127. print("\n");
  128. {
  129. TemporaryChange change { m_indent, m_indent + 1 };
  130. print_indent();
  131. print("(offset\n");
  132. {
  133. TemporaryChange change { m_indent, m_indent + 1 };
  134. print(value.offset);
  135. }
  136. print_indent();
  137. print(")\n");
  138. }
  139. {
  140. TemporaryChange change { m_indent, m_indent + 1 };
  141. print_indent();
  142. print("(index {})\n", value.index.value());
  143. }
  144. });
  145. }
  146. print_indent();
  147. print(")\n");
  148. }
  149. void Printer::print(Wasm::ElementSection const& section)
  150. {
  151. print_indent();
  152. print("(section element\n");
  153. {
  154. TemporaryChange change { m_indent, m_indent + 1 };
  155. for (auto& entry : section.segments())
  156. print(entry);
  157. }
  158. print_indent();
  159. print(")\n");
  160. }
  161. void Printer::print(Wasm::ElementSection::Element const& element)
  162. {
  163. print_indent();
  164. print("(element ");
  165. {
  166. TemporaryChange<size_t> change { m_indent, 0 };
  167. print(element.type);
  168. }
  169. {
  170. TemporaryChange change { m_indent, m_indent + 1 };
  171. print_indent();
  172. print("(init\n");
  173. {
  174. TemporaryChange change { m_indent, m_indent + 1 };
  175. for (auto& entry : element.init)
  176. print(entry);
  177. }
  178. print_indent();
  179. print(")\n");
  180. print_indent();
  181. print("(mode ");
  182. element.mode.visit(
  183. [this](ElementSection::Active const& active) {
  184. print("\n");
  185. {
  186. TemporaryChange change { m_indent, m_indent + 1 };
  187. print_indent();
  188. print("(active index {}\n", active.index.value());
  189. {
  190. print(active.expression);
  191. }
  192. print_indent();
  193. print(")\n");
  194. }
  195. print_indent();
  196. },
  197. [this](ElementSection::Passive const&) { print("passive"); },
  198. [this](ElementSection::Declarative const&) { print("declarative"); });
  199. print(")\n");
  200. }
  201. }
  202. void Printer::print(Wasm::ExportSection const& section)
  203. {
  204. print_indent();
  205. print("(section export\n");
  206. {
  207. TemporaryChange change { m_indent, m_indent + 1 };
  208. for (auto& entry : section.entries())
  209. print(entry);
  210. }
  211. print_indent();
  212. print(")\n");
  213. }
  214. void Printer::print(Wasm::ExportSection::Export const& entry)
  215. {
  216. print_indent();
  217. print("(export `{}' as\n", entry.name());
  218. {
  219. TemporaryChange change { m_indent, m_indent + 1 };
  220. print_indent();
  221. entry.description().visit(
  222. [this](FunctionIndex const& index) { print("(function index {})\n", index.value()); },
  223. [this](TableIndex const& index) { print("(table index {})\n", index.value()); },
  224. [this](MemoryIndex const& index) { print("(memory index {})\n", index.value()); },
  225. [this](GlobalIndex const& index) { print("(global index {})\n", index.value()); });
  226. }
  227. print_indent();
  228. print(")\n");
  229. }
  230. void Printer::print(Wasm::Expression const& expression)
  231. {
  232. TemporaryChange change { m_indent, m_indent + 1 };
  233. for (auto& instr : expression.instructions())
  234. print(instr);
  235. }
  236. void Printer::print(Wasm::CodeSection::Func const& func)
  237. {
  238. print_indent();
  239. print("(function\n");
  240. {
  241. TemporaryChange change { m_indent, m_indent + 1 };
  242. {
  243. print_indent();
  244. print("(locals\n");
  245. {
  246. TemporaryChange change { m_indent, m_indent + 1 };
  247. for (auto& locals : func.locals())
  248. print(locals);
  249. }
  250. print_indent();
  251. print(")\n");
  252. }
  253. print_indent();
  254. print("(body\n");
  255. print(func.body());
  256. print_indent();
  257. print(")\n");
  258. }
  259. print_indent();
  260. print(")\n");
  261. }
  262. void Printer::print(Wasm::FunctionSection const& section)
  263. {
  264. print_indent();
  265. print("(section function\n");
  266. {
  267. TemporaryChange change { m_indent, m_indent + 1 };
  268. for (auto& index : section.types()) {
  269. print_indent();
  270. print("(type index {})\n", index.value());
  271. }
  272. }
  273. print_indent();
  274. print(")\n");
  275. }
  276. void Printer::print(Wasm::FunctionType const& type)
  277. {
  278. print_indent();
  279. print("(type function\n");
  280. {
  281. TemporaryChange change { m_indent, m_indent + 1 };
  282. print_indent();
  283. print("(parameters\n");
  284. {
  285. TemporaryChange change { m_indent, m_indent + 1 };
  286. for (auto& param : type.parameters())
  287. print(param);
  288. }
  289. print_indent();
  290. print(")\n");
  291. }
  292. {
  293. TemporaryChange change { m_indent, m_indent + 1 };
  294. print_indent();
  295. print("(results\n");
  296. {
  297. TemporaryChange change { m_indent, m_indent + 1 };
  298. for (auto& type : type.results())
  299. print(type);
  300. }
  301. print_indent();
  302. print(")\n");
  303. }
  304. print_indent();
  305. print(")\n");
  306. }
  307. void Printer::print(Wasm::GlobalSection const& section)
  308. {
  309. print_indent();
  310. print("(section global\n");
  311. {
  312. TemporaryChange change { m_indent, m_indent + 1 };
  313. for (auto& entry : section.entries())
  314. print(entry);
  315. }
  316. print_indent();
  317. print(")\n");
  318. }
  319. void Printer::print(Wasm::GlobalSection::Global const& entry)
  320. {
  321. print_indent();
  322. print("(global\n");
  323. {
  324. TemporaryChange change { m_indent, m_indent + 1 };
  325. print_indent();
  326. print("(type\n");
  327. {
  328. TemporaryChange change { m_indent, m_indent + 1 };
  329. print(entry.type());
  330. }
  331. print_indent();
  332. print(")\n");
  333. }
  334. {
  335. TemporaryChange change { m_indent, m_indent + 1 };
  336. print_indent();
  337. print("(init\n");
  338. {
  339. TemporaryChange change { m_indent, m_indent + 1 };
  340. print(entry.expression());
  341. }
  342. print_indent();
  343. print(")\n");
  344. }
  345. print_indent();
  346. print(")\n");
  347. }
  348. void Printer::print(Wasm::GlobalType const& type)
  349. {
  350. print_indent();
  351. print("(type global {}mutable\n", type.is_mutable() ? "" : "im");
  352. {
  353. TemporaryChange change { m_indent, m_indent + 1 };
  354. print(type.type());
  355. }
  356. print_indent();
  357. print(")\n");
  358. }
  359. void Printer::print(Wasm::ImportSection const& section)
  360. {
  361. print_indent();
  362. print("(section import\n");
  363. {
  364. TemporaryChange change { m_indent, m_indent + 1 };
  365. for (auto& import : section.imports())
  366. print(import);
  367. }
  368. print_indent();
  369. print(")\n");
  370. }
  371. void Printer::print(Wasm::ImportSection::Import const& import)
  372. {
  373. print_indent();
  374. print("(import `{}' from `{}' as\n", import.name(), import.module());
  375. {
  376. TemporaryChange change { m_indent, m_indent + 1 };
  377. import.description().visit(
  378. [this](auto const& type) {
  379. print(type);
  380. },
  381. [this](TypeIndex const& index) {
  382. print_indent();
  383. print("(type index {})\n", index.value());
  384. });
  385. }
  386. print_indent();
  387. print(")\n");
  388. }
  389. void Printer::print(Wasm::Instruction const& instruction)
  390. {
  391. print_indent();
  392. print("({}", instruction_name(instruction.opcode()));
  393. if (instruction.arguments().has<u8>()) {
  394. print(")\n");
  395. } else {
  396. print(" ");
  397. instruction.arguments().visit(
  398. [&](BlockType const& type) { print(type); },
  399. [&](DataIndex const& index) { print("(data index {})", index.value()); },
  400. [&](ElementIndex const& index) { print("(element index {})", index.value()); },
  401. [&](FunctionIndex const& index) { print("(function index {})", index.value()); },
  402. [&](GlobalIndex const& index) { print("(global index {})", index.value()); },
  403. [&](LabelIndex const& index) { print("(label index {})", index.value()); },
  404. [&](LocalIndex const& index) { print("(local index {})", index.value()); },
  405. [&](TableIndex const& index) { print("(table index {})", index.value()); },
  406. [&](Instruction::IndirectCallArgs const& args) { print("(indirect (type index {}) (table index {}))", args.type.value(), args.table.value()); },
  407. [&](Instruction::MemoryArgument const& args) { print("(memory index {} (align {}) (offset {}))", args.memory_index.value(), args.align, args.offset); },
  408. [&](Instruction::MemoryAndLaneArgument const& args) { print("(memory index {} (align {}) (offset {})) (lane {})", args.memory.memory_index.value(), args.memory.align, args.memory.offset, args.lane); },
  409. [&](Instruction::MemoryInitArgs const& args) { print("(memory index {}) (data index {})", args.memory_index.value(), args.data_index.value()); },
  410. [&](Instruction::MemoryCopyArgs const& args) { print("(from (memory index {}) to (memory index {}))", args.src_index.value(), args.dst_index.value()); },
  411. [&](Instruction::MemoryIndexArgument const& args) { print("(memory index {})", args.memory_index.value()); },
  412. [&](Instruction::LaneIndex const& args) { print("(lane {})", args.lane); },
  413. [&](Instruction::ShuffleArgument const& args) {
  414. print("{{ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} }}",
  415. args.lanes[0], args.lanes[1], args.lanes[2], args.lanes[3],
  416. args.lanes[4], args.lanes[5], args.lanes[6], args.lanes[7],
  417. args.lanes[8], args.lanes[9], args.lanes[10], args.lanes[11],
  418. args.lanes[12], args.lanes[13], args.lanes[14], args.lanes[15]);
  419. },
  420. [&](Instruction::StructuredInstructionArgs const& args) {
  421. print("(structured\n");
  422. TemporaryChange change { m_indent, m_indent + 1 };
  423. print(args.block_type);
  424. print_indent();
  425. print("(else {}) (end {}))", args.else_ip.has_value() ? ByteString::number(args.else_ip->value()) : "(none)", args.end_ip.value());
  426. },
  427. [&](Instruction::TableBranchArgs const& args) {
  428. print("(table_branch");
  429. for (auto& label : args.labels)
  430. print(" (label {})", label.value());
  431. print(" (label {}))", args.default_.value());
  432. },
  433. [&](Instruction::TableElementArgs const& args) { print("(table_element (table index {}) (element index {}))", args.table_index.value(), args.element_index.value()); },
  434. [&](Instruction::TableTableArgs const& args) { print("(table_table (table index {}) (table index {}))", args.lhs.value(), args.rhs.value()); },
  435. [&](ValueType const& type) { print(type); },
  436. [&](Vector<ValueType> const&) { print("(types...)"); },
  437. [&](auto const& value) { print("{}", value); });
  438. print(")\n");
  439. }
  440. }
  441. void Printer::print(Wasm::Limits const& limits)
  442. {
  443. print_indent();
  444. print("(limits min={}", limits.min());
  445. if (limits.max().has_value())
  446. print(" max={}", limits.max().value());
  447. else
  448. print(" unbounded");
  449. print(")\n");
  450. }
  451. void Printer::print(Wasm::Locals const& local)
  452. {
  453. print_indent();
  454. print("(local x{} of type\n", local.n());
  455. {
  456. TemporaryChange change { m_indent, m_indent + 1 };
  457. print(local.type());
  458. }
  459. print_indent();
  460. print(")\n");
  461. }
  462. void Printer::print(Wasm::MemorySection const& section)
  463. {
  464. print_indent();
  465. print("(section memory\n");
  466. {
  467. TemporaryChange change { m_indent, m_indent + 1 };
  468. for (auto& memory : section.memories())
  469. print(memory);
  470. }
  471. print_indent();
  472. print(")\n");
  473. }
  474. void Printer::print(Wasm::MemorySection::Memory const& memory)
  475. {
  476. print_indent();
  477. print("(memory\n");
  478. {
  479. TemporaryChange change { m_indent, m_indent + 1 };
  480. print(memory.type());
  481. }
  482. print_indent();
  483. print(")\n");
  484. }
  485. void Printer::print(Wasm::MemoryType const& type)
  486. {
  487. print_indent();
  488. print("(type memory\n");
  489. {
  490. TemporaryChange change { m_indent, m_indent + 1 };
  491. print(type.limits());
  492. }
  493. print_indent();
  494. print(")\n");
  495. }
  496. void Printer::print(Wasm::Module const& module)
  497. {
  498. print_indent();
  499. {
  500. TemporaryChange change { m_indent, m_indent + 1 };
  501. print("(module\n");
  502. for (auto& section : module.sections())
  503. section.visit([this](auto const& value) { print(value); });
  504. }
  505. print_indent();
  506. print(")\n");
  507. }
  508. void Printer::print(Wasm::StartSection const& section)
  509. {
  510. print_indent();
  511. print("(section start\n");
  512. {
  513. TemporaryChange change { m_indent, m_indent + 1 };
  514. print(section.function());
  515. }
  516. print_indent();
  517. print(")\n");
  518. }
  519. void Printer::print(Wasm::StartSection::StartFunction const& function)
  520. {
  521. print_indent();
  522. print("(start function index {})\n", function.index().value());
  523. }
  524. void Printer::print(Wasm::TableSection const& section)
  525. {
  526. print_indent();
  527. print("(section table\n");
  528. {
  529. TemporaryChange change { m_indent, m_indent + 1 };
  530. for (auto& table : section.tables())
  531. print(table);
  532. }
  533. print_indent();
  534. print(")\n");
  535. }
  536. void Printer::print(Wasm::TableSection::Table const& table)
  537. {
  538. print_indent();
  539. print("(table\n");
  540. {
  541. TemporaryChange change { m_indent, m_indent + 1 };
  542. print(table.type());
  543. }
  544. print_indent();
  545. print(")\n");
  546. }
  547. void Printer::print(Wasm::TableType const& type)
  548. {
  549. print_indent();
  550. print("(type table min:{}", type.limits().min());
  551. if (type.limits().max().has_value())
  552. print(" max:{}", type.limits().max().value());
  553. print("\n");
  554. {
  555. TemporaryChange change { m_indent, m_indent + 1 };
  556. print(type.element_type());
  557. }
  558. print_indent();
  559. print(")\n");
  560. }
  561. void Printer::print(Wasm::TypeSection const& section)
  562. {
  563. print_indent();
  564. print("(section type\n");
  565. {
  566. TemporaryChange change { m_indent, m_indent + 1 };
  567. for (auto& type : section.types())
  568. print(type);
  569. }
  570. print_indent();
  571. print(")\n");
  572. }
  573. void Printer::print(Wasm::ValueType const& type)
  574. {
  575. print_indent();
  576. print("(type {})\n", ValueType::kind_name(type.kind()));
  577. }
  578. void Printer::print(Wasm::Value const& value)
  579. {
  580. print_indent();
  581. print("{} ", value.value().visit([&]<typename T>(T const& value) {
  582. if constexpr (IsSame<Wasm::Reference, T>) {
  583. return ByteString::formatted(
  584. "addr({})",
  585. value.ref().visit(
  586. [](Wasm::Reference::Null const&) { return ByteString("null"); },
  587. [](auto const& ref) { return ByteString::number(ref.address.value()); }));
  588. } else if constexpr (IsSame<u128, T>) {
  589. return ByteString::formatted("v128({:x})", value);
  590. } else {
  591. return ByteString::formatted("{}", value);
  592. }
  593. }));
  594. TemporaryChange<size_t> change { m_indent, 0 };
  595. print(value.type());
  596. }
  597. void Printer::print(Wasm::Reference const& value)
  598. {
  599. print_indent();
  600. print(
  601. "addr({})\n",
  602. value.ref().visit(
  603. [](Wasm::Reference::Null const&) { return ByteString("null"); },
  604. [](auto const& ref) { return ByteString::number(ref.address.value()); }));
  605. }
  606. }
  607. HashMap<Wasm::OpCode, ByteString> Wasm::Names::instruction_names {
  608. { Instructions::unreachable, "unreachable" },
  609. { Instructions::nop, "nop" },
  610. { Instructions::block, "block" },
  611. { Instructions::loop, "loop" },
  612. { Instructions::if_, "if" },
  613. { Instructions::br, "br" },
  614. { Instructions::br_if, "br.if" },
  615. { Instructions::br_table, "br.table" },
  616. { Instructions::return_, "return" },
  617. { Instructions::call, "call" },
  618. { Instructions::call_indirect, "call.indirect" },
  619. { Instructions::drop, "drop" },
  620. { Instructions::select, "select" },
  621. { Instructions::select_typed, "select.typed" },
  622. { Instructions::local_get, "local.get" },
  623. { Instructions::local_set, "local.set" },
  624. { Instructions::local_tee, "local.tee" },
  625. { Instructions::global_get, "global.get" },
  626. { Instructions::global_set, "global.set" },
  627. { Instructions::table_get, "table.get" },
  628. { Instructions::table_set, "table.set" },
  629. { Instructions::i32_load, "i32.load" },
  630. { Instructions::i64_load, "i64.load" },
  631. { Instructions::f32_load, "f32.load" },
  632. { Instructions::f64_load, "f64.load" },
  633. { Instructions::i32_load8_s, "i32.load8_s" },
  634. { Instructions::i32_load8_u, "i32.load8_u" },
  635. { Instructions::i32_load16_s, "i32.load16_s" },
  636. { Instructions::i32_load16_u, "i32.load16_u" },
  637. { Instructions::i64_load8_s, "i64.load8_s" },
  638. { Instructions::i64_load8_u, "i64.load8_u" },
  639. { Instructions::i64_load16_s, "i64.load16_s" },
  640. { Instructions::i64_load16_u, "i64.load16_u" },
  641. { Instructions::i64_load32_s, "i64.load32_s" },
  642. { Instructions::i64_load32_u, "i64.load32_u" },
  643. { Instructions::i32_store, "i32.store" },
  644. { Instructions::i64_store, "i64.store" },
  645. { Instructions::f32_store, "f32.store" },
  646. { Instructions::f64_store, "f64.store" },
  647. { Instructions::i32_store8, "i32.store8" },
  648. { Instructions::i32_store16, "i32.store16" },
  649. { Instructions::i64_store8, "i64.store8" },
  650. { Instructions::i64_store16, "i64.store16" },
  651. { Instructions::i64_store32, "i64.store32" },
  652. { Instructions::memory_size, "memory.size" },
  653. { Instructions::memory_grow, "memory.grow" },
  654. { Instructions::i32_const, "i32.const" },
  655. { Instructions::i64_const, "i64.const" },
  656. { Instructions::f32_const, "f32.const" },
  657. { Instructions::f64_const, "f64.const" },
  658. { Instructions::i32_eqz, "i32.eqz" },
  659. { Instructions::i32_eq, "i32.eq" },
  660. { Instructions::i32_ne, "i32.ne" },
  661. { Instructions::i32_lts, "i32.lts" },
  662. { Instructions::i32_ltu, "i32.ltu" },
  663. { Instructions::i32_gts, "i32.gts" },
  664. { Instructions::i32_gtu, "i32.gtu" },
  665. { Instructions::i32_les, "i32.les" },
  666. { Instructions::i32_leu, "i32.leu" },
  667. { Instructions::i32_ges, "i32.ges" },
  668. { Instructions::i32_geu, "i32.geu" },
  669. { Instructions::i64_eqz, "i64.eqz" },
  670. { Instructions::i64_eq, "i64.eq" },
  671. { Instructions::i64_ne, "i64.ne" },
  672. { Instructions::i64_lts, "i64.lts" },
  673. { Instructions::i64_ltu, "i64.ltu" },
  674. { Instructions::i64_gts, "i64.gts" },
  675. { Instructions::i64_gtu, "i64.gtu" },
  676. { Instructions::i64_les, "i64.les" },
  677. { Instructions::i64_leu, "i64.leu" },
  678. { Instructions::i64_ges, "i64.ges" },
  679. { Instructions::i64_geu, "i64.geu" },
  680. { Instructions::f32_eq, "f32.eq" },
  681. { Instructions::f32_ne, "f32.ne" },
  682. { Instructions::f32_lt, "f32.lt" },
  683. { Instructions::f32_gt, "f32.gt" },
  684. { Instructions::f32_le, "f32.le" },
  685. { Instructions::f32_ge, "f32.ge" },
  686. { Instructions::f64_eq, "f64.eq" },
  687. { Instructions::f64_ne, "f64.ne" },
  688. { Instructions::f64_lt, "f64.lt" },
  689. { Instructions::f64_gt, "f64.gt" },
  690. { Instructions::f64_le, "f64.le" },
  691. { Instructions::f64_ge, "f64.ge" },
  692. { Instructions::i32_clz, "i32.clz" },
  693. { Instructions::i32_ctz, "i32.ctz" },
  694. { Instructions::i32_popcnt, "i32.popcnt" },
  695. { Instructions::i32_add, "i32.add" },
  696. { Instructions::i32_sub, "i32.sub" },
  697. { Instructions::i32_mul, "i32.mul" },
  698. { Instructions::i32_divs, "i32.divs" },
  699. { Instructions::i32_divu, "i32.divu" },
  700. { Instructions::i32_rems, "i32.rems" },
  701. { Instructions::i32_remu, "i32.remu" },
  702. { Instructions::i32_and, "i32.and" },
  703. { Instructions::i32_or, "i32.or" },
  704. { Instructions::i32_xor, "i32.xor" },
  705. { Instructions::i32_shl, "i32.shl" },
  706. { Instructions::i32_shrs, "i32.shrs" },
  707. { Instructions::i32_shru, "i32.shru" },
  708. { Instructions::i32_rotl, "i32.rotl" },
  709. { Instructions::i32_rotr, "i32.rotr" },
  710. { Instructions::i64_clz, "i64.clz" },
  711. { Instructions::i64_ctz, "i64.ctz" },
  712. { Instructions::i64_popcnt, "i64.popcnt" },
  713. { Instructions::i64_add, "i64.add" },
  714. { Instructions::i64_sub, "i64.sub" },
  715. { Instructions::i64_mul, "i64.mul" },
  716. { Instructions::i64_divs, "i64.divs" },
  717. { Instructions::i64_divu, "i64.divu" },
  718. { Instructions::i64_rems, "i64.rems" },
  719. { Instructions::i64_remu, "i64.remu" },
  720. { Instructions::i64_and, "i64.and" },
  721. { Instructions::i64_or, "i64.or" },
  722. { Instructions::i64_xor, "i64.xor" },
  723. { Instructions::i64_shl, "i64.shl" },
  724. { Instructions::i64_shrs, "i64.shrs" },
  725. { Instructions::i64_shru, "i64.shru" },
  726. { Instructions::i64_rotl, "i64.rotl" },
  727. { Instructions::i64_rotr, "i64.rotr" },
  728. { Instructions::f32_abs, "f32.abs" },
  729. { Instructions::f32_neg, "f32.neg" },
  730. { Instructions::f32_ceil, "f32.ceil" },
  731. { Instructions::f32_floor, "f32.floor" },
  732. { Instructions::f32_trunc, "f32.trunc" },
  733. { Instructions::f32_nearest, "f32.nearest" },
  734. { Instructions::f32_sqrt, "f32.sqrt" },
  735. { Instructions::f32_add, "f32.add" },
  736. { Instructions::f32_sub, "f32.sub" },
  737. { Instructions::f32_mul, "f32.mul" },
  738. { Instructions::f32_div, "f32.div" },
  739. { Instructions::f32_min, "f32.min" },
  740. { Instructions::f32_max, "f32.max" },
  741. { Instructions::f32_copysign, "f32.copysign" },
  742. { Instructions::f64_abs, "f64.abs" },
  743. { Instructions::f64_neg, "f64.neg" },
  744. { Instructions::f64_ceil, "f64.ceil" },
  745. { Instructions::f64_floor, "f64.floor" },
  746. { Instructions::f64_trunc, "f64.trunc" },
  747. { Instructions::f64_nearest, "f64.nearest" },
  748. { Instructions::f64_sqrt, "f64.sqrt" },
  749. { Instructions::f64_add, "f64.add" },
  750. { Instructions::f64_sub, "f64.sub" },
  751. { Instructions::f64_mul, "f64.mul" },
  752. { Instructions::f64_div, "f64.div" },
  753. { Instructions::f64_min, "f64.min" },
  754. { Instructions::f64_max, "f64.max" },
  755. { Instructions::f64_copysign, "f64.copysign" },
  756. { Instructions::i32_wrap_i64, "i32.wrap_i64" },
  757. { Instructions::i32_trunc_sf32, "i32.trunc_sf32" },
  758. { Instructions::i32_trunc_uf32, "i32.trunc_uf32" },
  759. { Instructions::i32_trunc_sf64, "i32.trunc_sf64" },
  760. { Instructions::i32_trunc_uf64, "i32.trunc_uf64" },
  761. { Instructions::i64_extend_si32, "i64.extend_si32" },
  762. { Instructions::i64_extend_ui32, "i64.extend_ui32" },
  763. { Instructions::i64_trunc_sf32, "i64.trunc_sf32" },
  764. { Instructions::i64_trunc_uf32, "i64.trunc_uf32" },
  765. { Instructions::i64_trunc_sf64, "i64.trunc_sf64" },
  766. { Instructions::i64_trunc_uf64, "i64.trunc_uf64" },
  767. { Instructions::f32_convert_si32, "f32.convert_si32" },
  768. { Instructions::f32_convert_ui32, "f32.convert_ui32" },
  769. { Instructions::f32_convert_si64, "f32.convert_si64" },
  770. { Instructions::f32_convert_ui64, "f32.convert_ui64" },
  771. { Instructions::f32_demote_f64, "f32.demote_f64" },
  772. { Instructions::f64_convert_si32, "f64.convert_si32" },
  773. { Instructions::f64_convert_ui32, "f64.convert_ui32" },
  774. { Instructions::f64_convert_si64, "f64.convert_si64" },
  775. { Instructions::f64_convert_ui64, "f64.convert_ui64" },
  776. { Instructions::f64_promote_f32, "f64.promote_f32" },
  777. { Instructions::i32_reinterpret_f32, "i32.reinterpret_f32" },
  778. { Instructions::i64_reinterpret_f64, "i64.reinterpret_f64" },
  779. { Instructions::f32_reinterpret_i32, "f32.reinterpret_i32" },
  780. { Instructions::f64_reinterpret_i64, "f64.reinterpret_i64" },
  781. { Instructions::i32_extend8_s, "i32.extend8_s" },
  782. { Instructions::i32_extend16_s, "i32.extend16_s" },
  783. { Instructions::i64_extend8_s, "i64.extend8_s" },
  784. { Instructions::i64_extend16_s, "i64.extend16_s" },
  785. { Instructions::i64_extend32_s, "i64.extend32_s" },
  786. { Instructions::ref_null, "ref.null" },
  787. { Instructions::ref_is_null, "ref.is.null" },
  788. { Instructions::ref_func, "ref.func" },
  789. { Instructions::i32_trunc_sat_f32_s, "i32.trunc_sat_f32_s" },
  790. { Instructions::i32_trunc_sat_f32_u, "i32.trunc_sat_f32_u" },
  791. { Instructions::i32_trunc_sat_f64_s, "i32.trunc_sat_f64_s" },
  792. { Instructions::i32_trunc_sat_f64_u, "i32.trunc_sat_f64_u" },
  793. { Instructions::i64_trunc_sat_f32_s, "i64.trunc_sat_f32_s" },
  794. { Instructions::i64_trunc_sat_f32_u, "i64.trunc_sat_f32_u" },
  795. { Instructions::i64_trunc_sat_f64_s, "i64.trunc_sat_f64_s" },
  796. { Instructions::i64_trunc_sat_f64_u, "i64.trunc_sat_f64_u" },
  797. { Instructions::memory_init, "memory.init" },
  798. { Instructions::data_drop, "data.drop" },
  799. { Instructions::memory_copy, "memory.copy" },
  800. { Instructions::memory_fill, "memory.fill" },
  801. { Instructions::table_init, "table.init" },
  802. { Instructions::elem_drop, "elem.drop" },
  803. { Instructions::table_copy, "table.copy" },
  804. { Instructions::table_grow, "table.grow" },
  805. { Instructions::table_size, "table.size" },
  806. { Instructions::table_fill, "table.fill" },
  807. { Instructions::v128_load, "v128.load" },
  808. { Instructions::v128_load8x8_s, "v128.load8x8_s" },
  809. { Instructions::v128_load8x8_u, "v128.load8x8_u" },
  810. { Instructions::v128_load16x4_s, "v128.load16x4_s" },
  811. { Instructions::v128_load16x4_u, "v128.load16x4_u" },
  812. { Instructions::v128_load32x2_s, "v128.load32x2_s" },
  813. { Instructions::v128_load32x2_u, "v128.load32x2_u" },
  814. { Instructions::v128_load8_splat, "v128.load8_splat" },
  815. { Instructions::v128_load16_splat, "v128.load16_splat" },
  816. { Instructions::v128_load32_splat, "v128.load32_splat" },
  817. { Instructions::v128_load64_splat, "v128.load64_splat" },
  818. { Instructions::v128_store, "v128.store" },
  819. { Instructions::v128_const, "v128.const" },
  820. { Instructions::i8x16_shuffle, "i8x16.shuffle" },
  821. { Instructions::i8x16_swizzle, "i8x16.swizzle" },
  822. { Instructions::i8x16_splat, "i8x16.splat" },
  823. { Instructions::i16x8_splat, "i16x8.splat" },
  824. { Instructions::i32x4_splat, "i32x4.splat" },
  825. { Instructions::i64x2_splat, "i64x2.splat" },
  826. { Instructions::f32x4_splat, "f32x4.splat" },
  827. { Instructions::f64x2_splat, "f64x2.splat" },
  828. { Instructions::i8x16_extract_lane_s, "i8x16.extract_lane_s" },
  829. { Instructions::i8x16_extract_lane_u, "i8x16.extract_lane_u" },
  830. { Instructions::i8x16_replace_lane, "i8x16.replace_lane" },
  831. { Instructions::i16x8_extract_lane_s, "i16x8.extract_lane_s" },
  832. { Instructions::i16x8_extract_lane_u, "i16x8.extract_lane_u" },
  833. { Instructions::i16x8_replace_lane, "i16x8.replace_lane" },
  834. { Instructions::i32x4_extract_lane, "i32x4.extract_lane" },
  835. { Instructions::i32x4_replace_lane, "i32x4.replace_lane" },
  836. { Instructions::i64x2_extract_lane, "i64x2.extract_lane" },
  837. { Instructions::i64x2_replace_lane, "i64x2.replace_lane" },
  838. { Instructions::f32x4_extract_lane, "f32x4.extract_lane" },
  839. { Instructions::f32x4_replace_lane, "f32x4.replace_lane" },
  840. { Instructions::f64x2_extract_lane, "f64x2.extract_lane" },
  841. { Instructions::f64x2_replace_lane, "f64x2.replace_lane" },
  842. { Instructions::i8x16_eq, "i8x16.eq" },
  843. { Instructions::i8x16_ne, "i8x16.ne" },
  844. { Instructions::i8x16_lt_s, "i8x16.lt_s" },
  845. { Instructions::i8x16_lt_u, "i8x16.lt_u" },
  846. { Instructions::i8x16_gt_s, "i8x16.gt_s" },
  847. { Instructions::i8x16_gt_u, "i8x16.gt_u" },
  848. { Instructions::i8x16_le_s, "i8x16.le_s" },
  849. { Instructions::i8x16_le_u, "i8x16.le_u" },
  850. { Instructions::i8x16_ge_s, "i8x16.ge_s" },
  851. { Instructions::i8x16_ge_u, "i8x16.ge_u" },
  852. { Instructions::i16x8_eq, "i16x8.eq" },
  853. { Instructions::i16x8_ne, "i16x8.ne" },
  854. { Instructions::i16x8_lt_s, "i16x8.lt_s" },
  855. { Instructions::i16x8_lt_u, "i16x8.lt_u" },
  856. { Instructions::i16x8_gt_s, "i16x8.gt_s" },
  857. { Instructions::i16x8_gt_u, "i16x8.gt_u" },
  858. { Instructions::i16x8_le_s, "i16x8.le_s" },
  859. { Instructions::i16x8_le_u, "i16x8.le_u" },
  860. { Instructions::i16x8_ge_s, "i16x8.ge_s" },
  861. { Instructions::i16x8_ge_u, "i16x8.ge_u" },
  862. { Instructions::i32x4_eq, "i32x4.eq" },
  863. { Instructions::i32x4_ne, "i32x4.ne" },
  864. { Instructions::i32x4_lt_s, "i32x4.lt_s" },
  865. { Instructions::i32x4_lt_u, "i32x4.lt_u" },
  866. { Instructions::i32x4_gt_s, "i32x4.gt_s" },
  867. { Instructions::i32x4_gt_u, "i32x4.gt_u" },
  868. { Instructions::i32x4_le_s, "i32x4.le_s" },
  869. { Instructions::i32x4_le_u, "i32x4.le_u" },
  870. { Instructions::i32x4_ge_s, "i32x4.ge_s" },
  871. { Instructions::i32x4_ge_u, "i32x4.ge_u" },
  872. { Instructions::f32x4_eq, "f32x4.eq" },
  873. { Instructions::f32x4_ne, "f32x4.ne" },
  874. { Instructions::f32x4_lt, "f32x4.lt" },
  875. { Instructions::f32x4_gt, "f32x4.gt" },
  876. { Instructions::f32x4_le, "f32x4.le" },
  877. { Instructions::f32x4_ge, "f32x4.ge" },
  878. { Instructions::f64x2_eq, "f64x2.eq" },
  879. { Instructions::f64x2_ne, "f64x2.ne" },
  880. { Instructions::f64x2_lt, "f64x2.lt" },
  881. { Instructions::f64x2_gt, "f64x2.gt" },
  882. { Instructions::f64x2_le, "f64x2.le" },
  883. { Instructions::f64x2_ge, "f64x2.ge" },
  884. { Instructions::v128_not, "v128.not" },
  885. { Instructions::v128_and, "v128.and" },
  886. { Instructions::v128_andnot, "v128.andnot" },
  887. { Instructions::v128_or, "v128.or" },
  888. { Instructions::v128_xor, "v128.xor" },
  889. { Instructions::v128_bitselect, "v128.bitselect" },
  890. { Instructions::v128_any_true, "v128.any_true" },
  891. { Instructions::v128_load8_lane, "v128.load8_lane" },
  892. { Instructions::v128_load16_lane, "v128.load16_lane" },
  893. { Instructions::v128_load32_lane, "v128.load32_lane" },
  894. { Instructions::v128_load64_lane, "v128.load64_lane" },
  895. { Instructions::v128_store8_lane, "v128.store8_lane" },
  896. { Instructions::v128_store16_lane, "v128.store16_lane" },
  897. { Instructions::v128_store32_lane, "v128.store32_lane" },
  898. { Instructions::v128_store64_lane, "v128.store64_lane" },
  899. { Instructions::v128_load32_zero, "v128.load32_zero" },
  900. { Instructions::v128_load64_zero, "v128.load64_zero" },
  901. { Instructions::f32x4_demote_f64x2_zero, "f32x4.demote_f64x2_zero" },
  902. { Instructions::f64x2_promote_low_f32x4, "f64x2.promote_low_f32x4" },
  903. { Instructions::i8x16_abs, "i8x16.abs" },
  904. { Instructions::i8x16_neg, "i8x16.neg" },
  905. { Instructions::i8x16_popcnt, "i8x16.popcnt" },
  906. { Instructions::i8x16_all_true, "i8x16.all_true" },
  907. { Instructions::i8x16_bitmask, "i8x16.bitmask" },
  908. { Instructions::i8x16_narrow_i16x8_s, "i8x16.narrow_i16x8_s" },
  909. { Instructions::i8x16_narrow_i16x8_u, "i8x16.narrow_i16x8_u" },
  910. { Instructions::f32x4_ceil, "f32x4.ceil" },
  911. { Instructions::f32x4_floor, "f32x4.floor" },
  912. { Instructions::f32x4_trunc, "f32x4.trunc" },
  913. { Instructions::f32x4_nearest, "f32x4.nearest" },
  914. { Instructions::i8x16_shl, "i8x16.shl" },
  915. { Instructions::i8x16_shr_s, "i8x16.shr_s" },
  916. { Instructions::i8x16_shr_u, "i8x16.shr_u" },
  917. { Instructions::i8x16_add, "i8x16.add" },
  918. { Instructions::i8x16_add_sat_s, "i8x16.add_sat_s" },
  919. { Instructions::i8x16_add_sat_u, "i8x16.add_sat_u" },
  920. { Instructions::i8x16_sub, "i8x16.sub" },
  921. { Instructions::i8x16_sub_sat_s, "i8x16.sub_sat_s" },
  922. { Instructions::i8x16_sub_sat_u, "i8x16.sub_sat_u" },
  923. { Instructions::f64x2_ceil, "f64x2.ceil" },
  924. { Instructions::f64x2_floor, "f64x2.floor" },
  925. { Instructions::i8x16_min_s, "i8x16.min_s" },
  926. { Instructions::i8x16_min_u, "i8x16.min_u" },
  927. { Instructions::i8x16_max_s, "i8x16.max_s" },
  928. { Instructions::i8x16_max_u, "i8x16.max_u" },
  929. { Instructions::f64x2_trunc, "f64x2.trunc" },
  930. { Instructions::i8x16_avgr_u, "i8x16.avgr_u" },
  931. { Instructions::i16x8_extadd_pairwise_i8x16_s, "i16x8.extadd_pairwise_i8x16_s" },
  932. { Instructions::i16x8_extadd_pairwise_i8x16_u, "i16x8.extadd_pairwise_i8x16_u" },
  933. { Instructions::i32x4_extadd_pairwise_i16x8_s, "i32x4.extadd_pairwise_i16x8_s" },
  934. { Instructions::i32x4_extadd_pairwise_i16x8_u, "i32x4.extadd_pairwise_i16x8_u" },
  935. { Instructions::i16x8_abs, "i16x8.abs" },
  936. { Instructions::i16x8_neg, "i16x8.neg" },
  937. { Instructions::i16x8_q15mulr_sat_s, "i16x8.q15mulr_sat_s" },
  938. { Instructions::i16x8_all_true, "i16x8.all_true" },
  939. { Instructions::i16x8_bitmask, "i16x8.bitmask" },
  940. { Instructions::i16x8_narrow_i32x4_s, "i16x8.narrow_i32x4_s" },
  941. { Instructions::i16x8_narrow_i32x4_u, "i16x8.narrow_i32x4_u" },
  942. { Instructions::i16x8_extend_low_i8x16_s, "i16x8.extend_low_i8x16_s" },
  943. { Instructions::i16x8_extend_high_i8x16_s, "i16x8.extend_high_i8x16_s" },
  944. { Instructions::i16x8_extend_low_i8x16_u, "i16x8.extend_low_i8x16_u" },
  945. { Instructions::i16x8_extend_high_i8x16_u, "i16x8.extend_high_i8x16_u" },
  946. { Instructions::i16x8_shl, "i16x8.shl" },
  947. { Instructions::i16x8_shr_s, "i16x8.shr_s" },
  948. { Instructions::i16x8_shr_u, "i16x8.shr_u" },
  949. { Instructions::i16x8_add, "i16x8.add" },
  950. { Instructions::i16x8_add_sat_s, "i16x8.add_sat_s" },
  951. { Instructions::i16x8_add_sat_u, "i16x8.add_sat_u" },
  952. { Instructions::i16x8_sub, "i16x8.sub" },
  953. { Instructions::i16x8_sub_sat_s, "i16x8.sub_sat_s" },
  954. { Instructions::i16x8_sub_sat_u, "i16x8.sub_sat_u" },
  955. { Instructions::f64x2_nearest, "f64x2.nearest" },
  956. { Instructions::i16x8_mul, "i16x8.mul" },
  957. { Instructions::i16x8_min_s, "i16x8.min_s" },
  958. { Instructions::i16x8_min_u, "i16x8.min_u" },
  959. { Instructions::i16x8_max_s, "i16x8.max_s" },
  960. { Instructions::i16x8_max_u, "i16x8.max_u" },
  961. { Instructions::i16x8_avgr_u, "i16x8.avgr_u" },
  962. { Instructions::i16x8_extmul_low_i8x16_s, "i16x8.extmul_low_i8x16_s" },
  963. { Instructions::i16x8_extmul_high_i8x16_s, "i16x8.extmul_high_i8x16_s" },
  964. { Instructions::i16x8_extmul_low_i8x16_u, "i16x8.extmul_low_i8x16_u" },
  965. { Instructions::i16x8_extmul_high_i8x16_u, "i16x8.extmul_high_i8x16_u" },
  966. { Instructions::i32x4_abs, "i32x4.abs" },
  967. { Instructions::i32x4_neg, "i32x4.neg" },
  968. { Instructions::i32x4_all_true, "i32x4.all_true" },
  969. { Instructions::i32x4_bitmask, "i32x4.bitmask" },
  970. { Instructions::i32x4_extend_low_i16x8_s, "i32x4.extend_low_i16x8_s" },
  971. { Instructions::i32x4_extend_high_i16x8_s, "i32x4.extend_high_i16x8_s" },
  972. { Instructions::i32x4_extend_low_i16x8_u, "i32x4.extend_low_i16x8_u" },
  973. { Instructions::i32x4_extend_high_i16x8_u, "i32x4.extend_high_i16x8_u" },
  974. { Instructions::i32x4_shl, "i32x4.shl" },
  975. { Instructions::i32x4_shr_s, "i32x4.shr_s" },
  976. { Instructions::i32x4_shr_u, "i32x4.shr_u" },
  977. { Instructions::i32x4_add, "i32x4.add" },
  978. { Instructions::i32x4_sub, "i32x4.sub" },
  979. { Instructions::i32x4_mul, "i32x4.mul" },
  980. { Instructions::i32x4_min_s, "i32x4.min_s" },
  981. { Instructions::i32x4_min_u, "i32x4.min_u" },
  982. { Instructions::i32x4_max_s, "i32x4.max_s" },
  983. { Instructions::i32x4_max_u, "i32x4.max_u" },
  984. { Instructions::i32x4_dot_i16x8_s, "i32x4.dot_i16x8_s" },
  985. { Instructions::i32x4_extmul_low_i16x8_s, "i32x4.extmul_low_i16x8_s" },
  986. { Instructions::i32x4_extmul_high_i16x8_s, "i32x4.extmul_high_i16x8_s" },
  987. { Instructions::i32x4_extmul_low_i16x8_u, "i32x4.extmul_low_i16x8_u" },
  988. { Instructions::i32x4_extmul_high_i16x8_u, "i32x4.extmul_high_i16x8_u" },
  989. { Instructions::i64x2_abs, "i64x2.abs" },
  990. { Instructions::i64x2_neg, "i64x2.neg" },
  991. { Instructions::i64x2_all_true, "i64x2.all_true" },
  992. { Instructions::i64x2_bitmask, "i64x2.bitmask" },
  993. { Instructions::i64x2_extend_low_i32x4_s, "i64x2.extend_low_i32x4_s" },
  994. { Instructions::i64x2_extend_high_i32x4_s, "i64x2.extend_high_i32x4_s" },
  995. { Instructions::i64x2_extend_low_i32x4_u, "i64x2.extend_low_i32x4_u" },
  996. { Instructions::i64x2_extend_high_i32x4_u, "i64x2.extend_high_i32x4_u" },
  997. { Instructions::i64x2_shl, "i64x2.shl" },
  998. { Instructions::i64x2_shr_s, "i64x2.shr_s" },
  999. { Instructions::i64x2_shr_u, "i64x2.shr_u" },
  1000. { Instructions::i64x2_add, "i64x2.add" },
  1001. { Instructions::i64x2_sub, "i64x2.sub" },
  1002. { Instructions::i64x2_mul, "i64x2.mul" },
  1003. { Instructions::i64x2_eq, "i64x2.eq" },
  1004. { Instructions::i64x2_ne, "i64x2.ne" },
  1005. { Instructions::i64x2_lt_s, "i64x2.lt_s" },
  1006. { Instructions::i64x2_gt_s, "i64x2.gt_s" },
  1007. { Instructions::i64x2_le_s, "i64x2.le_s" },
  1008. { Instructions::i64x2_ge_s, "i64x2.ge_s" },
  1009. { Instructions::i64x2_extmul_low_i32x4_s, "i64x2.extmul_low_i32x4_s" },
  1010. { Instructions::i64x2_extmul_high_i32x4_s, "i64x2.extmul_high_i32x4_s" },
  1011. { Instructions::i64x2_extmul_low_i32x4_u, "i64x2.extmul_low_i32x4_u" },
  1012. { Instructions::i64x2_extmul_high_i32x4_u, "i64x2.extmul_high_i32x4_u" },
  1013. { Instructions::f32x4_abs, "f32x4.abs" },
  1014. { Instructions::f32x4_neg, "f32x4.neg" },
  1015. { Instructions::f32x4_sqrt, "f32x4.sqrt" },
  1016. { Instructions::f32x4_add, "f32x4.add" },
  1017. { Instructions::f32x4_sub, "f32x4.sub" },
  1018. { Instructions::f32x4_mul, "f32x4.mul" },
  1019. { Instructions::f32x4_div, "f32x4.div" },
  1020. { Instructions::f32x4_min, "f32x4.min" },
  1021. { Instructions::f32x4_max, "f32x4.max" },
  1022. { Instructions::f32x4_pmin, "f32x4.pmin" },
  1023. { Instructions::f32x4_pmax, "f32x4.pmax" },
  1024. { Instructions::f64x2_abs, "f64x2.abs" },
  1025. { Instructions::f64x2_neg, "f64x2.neg" },
  1026. { Instructions::f64x2_sqrt, "f64x2.sqrt" },
  1027. { Instructions::f64x2_add, "f64x2.add" },
  1028. { Instructions::f64x2_sub, "f64x2.sub" },
  1029. { Instructions::f64x2_mul, "f64x2.mul" },
  1030. { Instructions::f64x2_div, "f64x2.div" },
  1031. { Instructions::f64x2_min, "f64x2.min" },
  1032. { Instructions::f64x2_max, "f64x2.max" },
  1033. { Instructions::f64x2_pmin, "f64x2.pmin" },
  1034. { Instructions::f64x2_pmax, "f64x2.pmax" },
  1035. { Instructions::i32x4_trunc_sat_f32x4_s, "i32x4.trunc_sat_f32x4_s" },
  1036. { Instructions::i32x4_trunc_sat_f32x4_u, "i32x4.trunc_sat_f32x4_u" },
  1037. { Instructions::f32x4_convert_i32x4_s, "f32x4.convert_i32x4_s" },
  1038. { Instructions::f32x4_convert_i32x4_u, "f32x4.convert_i32x4_u" },
  1039. { Instructions::i32x4_trunc_sat_f64x2_s_zero, "i32x4.trunc_sat_f64x2_s_zero" },
  1040. { Instructions::i32x4_trunc_sat_f64x2_u_zero, "i32x4.trunc_sat_f64x2_u_zero" },
  1041. { Instructions::f64x2_convert_low_i32x4_s, "f64x2.convert_low_i32x4_s" },
  1042. { Instructions::f64x2_convert_low_i32x4_u, "f64x2.convert_low_i32x4_u" },
  1043. { Instructions::structured_else, "synthetic:else" },
  1044. { Instructions::structured_end, "synthetic:end" },
  1045. };
  1046. HashMap<ByteString, Wasm::OpCode> Wasm::Names::instructions_by_name;