@@ -827,21 +827,14 @@ macro_rules! define_for_each_non_simd_operator {
827
827
$m! { $( $t) * }
828
828
}
829
829
}
830
-
831
- // When simd is disabled then this macro is additionally the
832
- // `for_each_operator!` macro implementation
833
- #[ cfg( not( feature = "simd" ) ) ]
834
- #[ doc( hidden) ]
835
- pub use _for_each_visit_operator_impl as _for_each_operator_impl;
836
830
} ;
837
831
}
838
832
_for_each_operator_group ! ( define_for_each_non_simd_operator) ;
839
833
840
834
/// When the simd feature is enabled then `_for_each_operator_impl` is defined
841
835
/// to be the same as the above `define_for_each_non_simd_operator` macro except
842
836
/// with all proposals thrown in.
843
- #[ cfg( feature = "simd" ) ]
844
- macro_rules! define_for_each_operator_impl_with_simd {
837
+ macro_rules! define_for_each_operator_impl {
845
838
(
846
839
$(
847
840
@$proposal: ident {
@@ -864,14 +857,12 @@ macro_rules! define_for_each_operator_impl_with_simd {
864
857
}
865
858
} ;
866
859
}
867
- #[ cfg( feature = "simd" ) ]
868
- _for_each_operator_group ! ( define_for_each_operator_impl_with_simd) ;
860
+ _for_each_operator_group ! ( define_for_each_operator_impl) ;
869
861
870
862
/// Helper macro to define the `_for_each_simd_operator_impl` macro.
871
863
///
872
864
/// This is basically the same as `define_for_each_non_simd_operator` above
873
865
/// except that it's filtering on different proposals.
874
- #[ cfg( feature = "simd" ) ]
875
866
macro_rules! define_for_each_simd_operator {
876
867
// Switch to "tt muncher" mode
877
868
( @ $( $t: tt) * ) => { define_for_each_simd_operator!( filter [ ] @ $( $t) * ) ; } ;
@@ -924,7 +915,7 @@ macro_rules! define_for_each_simd_operator {
924
915
}
925
916
} ;
926
917
}
927
- # [ cfg ( feature = "simd" ) ]
918
+
928
919
_for_each_operator_group ! ( define_for_each_simd_operator) ;
929
920
930
921
/// Used to implement routines for the [`Operator`] enum.
@@ -1085,10 +1076,10 @@ pub use _for_each_operator_impl as for_each_operator;
1085
1076
/// - `@stack_switching`: [Wasm `stack-switching` proposal]
1086
1077
/// - `@wide_arithmetic`: [Wasm `wide-arithmetic` proposal]
1087
1078
///
1088
- /// Note that this macro does not iterate over the SIMD-related proposals. Those
1089
- /// are provided in [`VisitSimdOperator `] and [`for_each_visit_simd_operator`].
1090
- /// This macro only handles non-SIMD related operators and so users wanting to
1091
- /// handle the SIMD-class of operators need to use that trait/macro as well.
1079
+ /// Note that this macro does not iterate over the SIMD-related proposals. To include SIMD
1080
+ /// instructions use [`for_each_visit_simd_operator `] or [`for_each_operator`] instead. This macro
1081
+ /// only handles non-SIMD related operators and so users wanting to handle the SIMD-class of
1082
+ /// operators need to use that trait/macro as well.
1092
1083
///
1093
1084
/// [Wasm `exception-handling` proposal]:
1094
1085
/// https://github.com/WebAssembly/exception-handling
@@ -1218,7 +1209,7 @@ pub use _for_each_operator_impl as for_each_operator;
1218
1209
#[ doc( inline) ]
1219
1210
pub use _for_each_visit_operator_impl as for_each_visit_operator;
1220
1211
1221
- /// Used to implement the [`VisitSimdOperator`] trait.
1212
+ /// Used to implement the methods for simd extension of `VisitOperator` trait.
1222
1213
///
1223
1214
/// The list of specializable Wasm proposals is as follows:
1224
1215
///
@@ -1234,22 +1225,12 @@ pub use _for_each_visit_operator_impl as for_each_visit_operator;
1234
1225
/// [Wasm `relaxed-simd` proposal]:
1235
1226
/// https://github.com/WebAssembly/relaxed-simd
1236
1227
///
1237
- /// [`VisitSimdOperator`]: crate::VisitSimdOperator
1238
- ///
1239
1228
/// ```
1240
1229
/// # macro_rules! define_visit_operator {
1241
1230
/// # ($( @$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident ($($ann:tt)*))*) => {
1242
1231
/// # $( fn $visit(&mut self $($(,$arg: $argty)*)?) {} )*
1243
1232
/// # }
1244
1233
/// # }
1245
- /// pub struct VisitAndDoNothing;
1246
- ///
1247
- /// impl<'a> wasmparser::VisitOperator<'a> for VisitAndDoNothing {
1248
- /// type Output = ();
1249
- ///
1250
- /// // implement all the visit methods ..
1251
- /// # wasmparser::for_each_visit_operator!(define_visit_operator);
1252
- /// }
1253
1234
///
1254
1235
/// macro_rules! define_visit_simd_operator {
1255
1236
/// // The outer layer of repetition represents how all operators are
@@ -1267,12 +1248,16 @@ pub use _for_each_visit_operator_impl as for_each_visit_operator;
1267
1248
/// )*
1268
1249
/// }
1269
1250
/// }
1251
+ /// pub struct VisitAndDoNothing;
1252
+ ///
1253
+ /// impl<'a> wasmparser::VisitOperator<'a> for VisitAndDoNothing {
1254
+ /// type Output = ();
1270
1255
///
1271
- /// impl<'a> wasmparser::VisitSimdOperator<'a> for VisitAndDoNothing {
1256
+ /// // implement all the visit methods ..
1257
+ /// wasmparser::for_each_visit_operator!(define_visit_operator);
1272
1258
/// wasmparser::for_each_visit_simd_operator!(define_visit_simd_operator);
1273
1259
/// }
1274
1260
/// ```
1275
- #[ cfg( feature = "simd" ) ]
1276
1261
#[ doc( inline) ]
1277
1262
pub use _for_each_visit_simd_operator_impl as for_each_visit_simd_operator;
1278
1263
0 commit comments