summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index a16dab478..5f38b2a2e 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -46,7 +46,8 @@ struct FeatureSet {
TruncSat = 1 << 2,
SIMD = 1 << 3,
BulkMemory = 1 << 4,
- All = Atomics | MutableGlobals | TruncSat | SIMD | BulkMemory
+ SignExt = 1 << 5,
+ All = Atomics | MutableGlobals | TruncSat | SIMD | BulkMemory | SignExt
};
FeatureSet() : features(MVP) {}
@@ -59,6 +60,7 @@ struct FeatureSet {
bool hasTruncSat() const { return features & TruncSat; }
bool hasSIMD() const { return features & SIMD; }
bool hasBulkMemory() const { return features & BulkMemory; }
+ bool hasSignExt() const { return features & SignExt; }
bool hasAll() const { return features & All; }
void makeMVP() { features = MVP; }
@@ -68,6 +70,7 @@ struct FeatureSet {
void setTruncSat(bool v = true) { set(TruncSat, v); }
void setSIMD(bool v = true) { set(SIMD, v); }
void setBulkMemory(bool v = true) { set(BulkMemory, v); }
+ void setSignExt(bool v = true) { set(SignExt, v); }
void setAll(bool v = true) { features = v ? All : MVP; }
bool operator<=(const FeatureSet& other) {
@@ -114,7 +117,6 @@ enum UnaryOp {
PromoteFloat32, // f32 to f64
DemoteFloat64, // f64 to f32
ReinterpretInt32, ReinterpretInt64, // reinterpret bits to float
- // The following sign-extention operators go along with wasm atomics support.
// Extend signed subword-sized integer. This differs from e.g. ExtendSInt32
// because the input integer is in an i64 value insetad of an i32 value.
ExtendS8Int32, ExtendS16Int32, ExtendS8Int64, ExtendS16Int64, ExtendS32Int64,