diff options
author | Ng Zhi An <zhin@chromium.org> | 2021-09-23 12:38:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 12:38:06 -0700 |
commit | 31252873463fd142a1eabb71b965da04a23a00e2 (patch) | |
tree | 0fe663c3e5ec0d95a0148e888837b50790e6ac29 /src/wasm-features.h | |
parent | 675295888609a688ee81dc9ad2024169da5aa7ed (diff) | |
download | binaryen-31252873463fd142a1eabb71b965da04a23a00e2.tar.gz binaryen-31252873463fd142a1eabb71b965da04a23a00e2.tar.bz2 binaryen-31252873463fd142a1eabb71b965da04a23a00e2.zip |
Add feature flag for relaxed-simd (#4183)
Diffstat (limited to 'src/wasm-features.h')
-rw-r--r-- | src/wasm-features.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm-features.h b/src/wasm-features.h index e28dcf4d1..7311aadd3 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -41,7 +41,8 @@ struct FeatureSet { TypedFunctionReferences = 1 << 12, // TODO: Remove this feature when the wasm spec stabilizes. GCNNLocals = 1 << 13, - All = (1 << 14) - 1 + RelaxedSIMD = 1 << 14, + All = (1 << 15) - 1 }; static std::string toString(Feature f) { @@ -74,6 +75,8 @@ struct FeatureSet { return "typed-function-references"; case GCNNLocals: return "gc-nn-locals"; + case RelaxedSIMD: + return "relaxed-simd"; default: WASM_UNREACHABLE("unexpected feature"); } @@ -118,6 +121,7 @@ struct FeatureSet { return (features & TypedFunctionReferences) != 0; } bool hasGCNNLocals() const { return (features & GCNNLocals) != 0; } + bool hasRelaxedSIMD() const { return (features & RelaxedSIMD) != 0; } bool hasAll() const { return (features & All) != 0; } void set(FeatureSet f, bool v = true) { @@ -139,6 +143,7 @@ struct FeatureSet { set(TypedFunctionReferences, v); } void setGCNNLocals(bool v = true) { set(GCNNLocals, v); } + void setRelaxedSIMD(bool v = true) { set(RelaxedSIMD, v); } void setMVP() { features = MVP; } void setAll() { // Do not set GCNNLocals, which forces the user to opt in to that feature |