diff options
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 366b75200..92b07b547 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -46,11 +46,12 @@ struct FeatureSet { MultiMemory = 1 << 15, TypedContinuations = 1 << 16, SharedEverything = 1 << 17, + FP16 = 1 << 18, MVP = None, // Keep in sync with llvm default features: // https://github.com/llvm/llvm-project/blob/c7576cb89d6c95f03968076e902d3adfd1996577/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L153 Default = SignExt | MutableGlobals, - All = (1 << 18) - 1, + All = (1 << 19) - 1, }; static std::string toString(Feature f) { @@ -91,6 +92,8 @@ struct FeatureSet { return "typed-continuations"; case SharedEverything: return "shared-everything"; + case FP16: + return "fp16"; default: WASM_UNREACHABLE("unexpected feature"); } @@ -141,6 +144,7 @@ struct FeatureSet { bool hasSharedEverything() const { return (features & SharedEverything) != 0; } + bool hasFP16() const { return (features & FP16) != 0; } bool hasAll() const { return (features & All) != 0; } void set(FeatureSet f, bool v = true) { @@ -164,6 +168,7 @@ struct FeatureSet { void setMultiMemory(bool v = true) { set(MultiMemory, v); } void setTypedContinuations(bool v = true) { set(TypedContinuations, v); } void setSharedEverything(bool v = true) { set(SharedEverything, v); } + void setFP16(bool v = true) { set(FP16, v); } void setMVP() { features = MVP; } void setAll() { features = All; } |