@@ -55,11 +55,12 @@ struct FeatureSet {
5555 // it does nothing. Binaryen always accepts LEB call-indirect encodings.
5656 CallIndirectOverlong = 1 << 20 ,
5757 CustomDescriptors = 1 << 21 ,
58+ RelaxedAtomics = 1 << 22 ,
5859 MVP = None,
5960 // Keep in sync with llvm default features:
6061 // https://github.com/llvm/llvm-project/blob/c7576cb89d6c95f03968076e902d3adfd1996577/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L153
6162 Default = SignExt | MutableGlobals,
62- All = (1 << 22 ) - 1 ,
63+ All = (1 << 23 ) - 1 ,
6364 };
6465
6566 static std::string toString (Feature f) {
@@ -108,6 +109,8 @@ struct FeatureSet {
108109 return " call-indirect-overlong" ;
109110 case CustomDescriptors:
110111 return " custom-descriptors" ;
112+ case RelaxedAtomics:
113+ return " relaxed-atomics" ;
111114 case MVP:
112115 case Default:
113116 case All:
@@ -168,6 +171,7 @@ struct FeatureSet {
168171 bool hasCustomDescriptors () const {
169172 return (features & CustomDescriptors) != 0 ;
170173 }
174+ bool hasRelaxedAtomics () const { return (features & RelaxedAtomics) != 0 ; }
171175 bool hasAll () const { return (features & All) != 0 ; }
172176
173177 void set (FeatureSet f, bool v = true ) {
@@ -194,6 +198,7 @@ struct FeatureSet {
194198 void setFP16 (bool v = true ) { set (FP16, v); }
195199 void setBulkMemoryOpt (bool v = true ) { set (BulkMemoryOpt, v); }
196200 void setCustomDescriptors (bool v = true ) { set (CustomDescriptors, v); }
201+ void setRelaxedAtomics (bool v = true ) { set (RelaxedAtomics, v); }
197202 void setMVP () { features = MVP; }
198203 void setAll () { features = All; }
199204
0 commit comments