summaryrefslogtreecommitdiff
path: root/src/wasm-features.h
diff options
context:
space:
mode:
authorAshley Nelson <nashley@google.com>2022-08-25 13:35:46 -0700
committerGitHub <noreply@github.com>2022-08-25 13:35:46 -0700
commit8b81405778eb85fccbfdbe789beeba5108cf1021 (patch)
tree0263c08a9453021cb30712a199d9b8917e944fa6 /src/wasm-features.h
parent37b457a00a46e5604b2a8a388efaf0813b3d1170 (diff)
downloadbinaryen-8b81405778eb85fccbfdbe789beeba5108cf1021.tar.gz
binaryen-8b81405778eb85fccbfdbe789beeba5108cf1021.tar.bz2
binaryen-8b81405778eb85fccbfdbe789beeba5108cf1021.zip
Adding Multi-Memories Wasm Feature (#4968)
Adding multi-memories to the the list of wasm-features.
Diffstat (limited to 'src/wasm-features.h')
-rw-r--r--src/wasm-features.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm-features.h b/src/wasm-features.h
index 10e4ac4c7..4b3f7c85a 100644
--- a/src/wasm-features.h
+++ b/src/wasm-features.h
@@ -44,11 +44,12 @@ struct FeatureSet {
RelaxedSIMD = 1 << 14,
ExtendedConst = 1 << 15,
Strings = 1 << 16,
+ MultiMemories = 1 << 17,
// GCNNLocals are opt-in: merely asking for "All" does not apply them. To
// get all possible values use AllPossible. See setAll() below for more
// details.
- All = ((1 << 17) - 1) & ~GCNNLocals,
- AllPossible = (1 << 17) - 1,
+ All = ((1 << 18) - 1) & ~GCNNLocals,
+ AllPossible = (1 << 18) - 1,
};
static std::string toString(Feature f) {
@@ -87,6 +88,8 @@ struct FeatureSet {
return "extended-const";
case Strings:
return "strings";
+ case MultiMemories:
+ return "multi-memories";
default:
WASM_UNREACHABLE("unexpected feature");
}
@@ -134,6 +137,7 @@ struct FeatureSet {
bool hasRelaxedSIMD() const { return (features & RelaxedSIMD) != 0; }
bool hasExtendedConst() const { return (features & ExtendedConst) != 0; }
bool hasStrings() const { return (features & Strings) != 0; }
+ bool hasMultiMemories() const { return (features & MultiMemories) != 0; }
bool hasAll() const { return (features & AllPossible) != 0; }
void set(FeatureSet f, bool v = true) {
@@ -158,6 +162,7 @@ struct FeatureSet {
void setRelaxedSIMD(bool v = true) { set(RelaxedSIMD, v); }
void setExtendedConst(bool v = true) { set(ExtendedConst, v); }
void setStrings(bool v = true) { set(Strings, v); }
+ void setMultiMemories(bool v = true) { set(MultiMemories, v); }
void setMVP() { features = MVP; }
void setAll() {
// Do not set GCNNLocals, which forces the user to opt in to that feature