[PATCH] D125728: [WebAssembly] Update supported features in -mcpu=generic

Dan Gohman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 16 14:49:46 PDT 2022


sunfish created this revision.
Herald added subscribers: pmatos, asb, ecnelises, jgravelle-google, sbc100, dschuff.
Herald added a project: All.
sunfish requested review of this revision.
Herald added a subscriber: aheejin.
Herald added a project: clang.

Enable nontrapping-fptoint, sign-ext, bulk-memory, and mutable-globals in -mcpu=generic. This makes these features enabled by default.

These features are all [finished proposals], and all major wasm engines support them.

[finished proposals]: https://github.com/WebAssembly/proposals/blob/main/finished-proposals.md


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125728

Files:
  clang/lib/Basic/Targets/WebAssembly.cpp


Index: clang/lib/Basic/Targets/WebAssembly.cpp
===================================================================
--- clang/lib/Basic/Targets/WebAssembly.cpp
+++ clang/lib/Basic/Targets/WebAssembly.cpp
@@ -144,6 +144,11 @@
     Features["mutable-globals"] = true;
     Features["tail-call"] = true;
     setSIMDLevel(Features, SIMD128, true);
+  } else if (CPU == "generic") {
+    Features["nontrapping-fptoint"] = true;
+    Features["sign-ext"] = true;
+    Features["bulk-memory"] = true;
+    Features["mutable-globals"] = true;
   }
 
   return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125728.429866.patch
Type: text/x-patch
Size: 615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220516/133f70ce/attachment.bin>


More information about the cfe-commits mailing list