Repository: bytecodealliance/wasm-tools
Pull request #1824 (2024-09-25 18:14:43)

Deny unknown fields in wasm-smith configuration
This helps catch typos in configuration such as using `foo_bar` instead of `foo-bar`.


Patch:
diff --git a/crates/wasm-smith/src/config.rs b/crates/wasm-smith/src/config.rs
index 97c707a0..b6ced3ff 100644
--- a/crates/wasm-smith/src/config.rs
+++ b/crates/wasm-smith/src/config.rs
@@ -116,7 +116,7 @@ macro_rules! define_config {
         #[cfg(feature = "_internal_cli")]
         #[doc(hidden)]
         #[derive(Clone, Debug, Default, clap::Parser, serde_derive::Deserialize)]
-        #[serde(rename_all = "kebab-case")]
+        #[serde(rename_all = "kebab-case", deny_unknown_fields)]
         pub struct InternalOptionalConfig {
             /// The imports that may be used when generating the module.
             ///
@@ -253,6 +253,11 @@ define_config! {
         /// specification](https://webassembly.github.io/spec/core/syntax/instructions.html);
         /// e.g., numeric, vector, control, memory, etc.
         ///
+        /// Additionally, we include finer-grained categories which exclude floating point
+        /// instructions, e.g. [`InstructionKind::NumericInt`] is a subset of
+        /// [`InstructionKind::Numeric`] consisting of all numeric instructions which
+        /// don't involve floats.
+        ///
         /// Note that modifying this setting is separate from the proposal
         /// flags; that is, if `simd_enabled() == true` but
         /// `allowed_instruction()` does not include vector instructions, the
@@ -260,6 +265,11 @@ define_config! {
         /// contain vector types.
         pub allowed_instructions: InstructionKinds = InstructionKinds::all(),
 
+        /// Determines whether we generate floating point instructions and types.
+        ///
+        /// Defaults to `true`.
+        pub allow_floats: bool = true,
+
         /// Determines whether the bulk memory proposal is enabled for
         /// generating instructions.
         ///
@@ -652,11 +662,7 @@ impl<'a> Arbitrary<'a> for Config {
     fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
         const MAX_MAXIMUM: usize = 1000;
 
-        let reference_types_enabled: bool = u.arbitrary()?;
-        let max_tables = if reference_types_enabled { 100 } else { 1 };
-        let simd_enabled: bool = u.arbitrary()?;
-
-        Ok(Config {
+        let mut config = Config {
             max_types: u.int_in_range(0..=MAX_MAXIMUM)?,
             max_imports: u.int_in_range(0..=MAX_MAXIMUM)?,
             max_tags: u.int_in_range(0..=MAX_MAXIMUM)?,
@@ -668,23 +674,23 @@ impl<'a> Arbitrary<'a> for Config {
             max_data_segments: u.int_in_range(0..=MAX_MAXIMUM)?,
             max_instructions: u.int_in_range(0..=MAX_MAXIMUM)?,
             max_memories: u.int_in_range(0..=100)?,
-            max_tables,
+            max_tables: u.int_in_range(0..=100)?,
             max_memory32_bytes: u.int_in_range(0..=u32::MAX as u64 + 1)?,
             max_memory64_bytes: u.int_in_range(0..=u64::MAX as u128 + 1)?,
             min_uleb_size: u.int_in_range(0..=5)?,
             bulk_memory_enabled: u.arbitrary()?,
-            reference_types_enabled,
+            reference_types_enabled: u.arbitrary()?,
             simd_enabled: u.arbitrary()?,
             multi_value_enabled: u.arbitrary()?,
             max_aliases: u.int_in_range(0..=MAX_MAXIMUM)?,
             max_nesting_depth: u.int_in_range(0..=10)?,
             saturating_float_to_int_enabled: u.arbitrary()?,
             sign_extension_ops_enabled: u.arbitrary()?,
-            relaxed_simd_enabled: simd_enabled && u.arbitrary()?,
+            relaxed_simd_enabled: u.arbitrary()?,
             exceptions_enabled: u.arbitrary()?,
             threads_enabled: u.arbitrary()?,
             tail_call_enabled: u.arbitrary()?,
-            gc_enabled: reference_types_enabled && u.arbitrary()?,
+            gc_enabled: u.arbitrary()?,
             allowed_instructions: {
                 use flagset::Flags;
                 let mut allowed = Vec::new();
@@ -698,6 +704,7 @@ impl<'a> Arbitrary<'a> for Config {
             table_max_size_required: u.arbitrary()?,
             max_table_elements: u.int_in_range(0..=1_000_000)?,
             disallow_traps: u.arbitrary()?,
+            allow_floats: u.arbitrary()?,
 
             // These fields, unlike the ones above, are less useful to set.
             // They either make weird inputs or are for features not widely
@@ -731,6 +738,37 @@ impl<'a> Arbitrary<'a> for Config {
             // Proposals that are not stage4+ are disabled by default.
             memory64_enabled: false,
             custom_page_sizes_enabled: false,
-        })
+        };
+        config.sanitize();
+        Ok(config)
+    }
+}
+
+impl Config {
+    /// "Shrink" this `Config` where appropriate to ensure its configuration is
+    /// valid for wasm-smith.
+    ///
+    /// This method will take the arbitrary state that this `Config` is in and
+    /// will possibly mutate dependent options as needed by `wasm-smith`. For
+    /// example if the `reference_types_enabled` field is turned off then
+    /// `wasm-smith`, as of the time of this writing, additionally requires that
+    /// the `gc_enabled` is not turned on.
+    ///
+    /// This method will not enable anything that isn't already enabled or
+    /// increase any limit of an item, but it may turn features off or shrink
+    /// limits from what they're previously specified as.
+    pub(crate) fn sanitize(&mut self) {
+        // If reference types are disabled then automatically flag tables as
+        // capped at 1 and disable gc as well.
+        if !self.reference_types_enabled {
+            self.max_tables = self.max_tables.min(1);
+            self.gc_enabled = false;
+        }
+
+        // If simd is disabled then disable all relaxed simd instructions as
+        // well.
+        if !self.simd_enabled {
+            self.relaxed_simd_enabled = false;
+        }
     }
 }
diff --git a/crates/wasm-smith/src/core.rs b/crates/wasm-smith/src/core.rs
index 2b0fc10b..449a6c1a 100644
--- a/crates/wasm-smith/src/core.rs
+++ b/crates/wasm-smith/src/core.rs
@@ -202,7 +202,8 @@ impl Module {
         Ok(module)
     }
 
-    fn empty(config: Config, duplicate_imports_behavior: DuplicateImportsBehavior) -> Self {
+    fn empty(mut config: Config, duplicate_imports_behavior: DuplicateImportsBehavior) -> Self {
+        config.sanitize();
         Module {
             config,
             duplicate_imports_behavior,
@@ -1465,7 +1466,7 @@ impl Module {
     }
 
     fn arbitrary_valtype(&self, u: &mut Unstructured) -> Result<ValType> {
-        #[derive(Arbitrary)]
+        #[derive(PartialEq, Eq, PartialOrd, Ord)]
         enum ValTypeClass {
             I32,
             I64,
@@ -1475,25 +1476,28 @@ impl Module {
             Ref,
         }
 
-        match u.arbitrary::<ValTypeClass>()? {
+        let mut val_classes: Vec<_> = self
+            .valtypes
+            .iter()
+            .map(|vt| match vt {
+                ValType::I32 => ValTypeClass::I32,
+                ValType::I64 => ValTypeClass::I64,
+                ValType::F32 => ValTypeClass::F32,
+                ValType::F64 => ValTypeClass::F64,
+                ValType::V128 => ValTypeClass::V128,
+                ValType::Ref(_) => ValTypeClass::Ref,
+            })
+            .collect();
+        val_classes.sort_unstable();
+        val_classes.dedup();
+
+        match u.choose(&val_classes)? {
             ValTypeClass::I32 => Ok(ValType::I32),
             ValTypeClass::I64 => Ok(ValType::I64),
             ValTypeClass::F32 => Ok(ValType::F32),
             ValTypeClass::F64 => Ok(ValType::F64),
-            ValTypeClass::V128 => {
-                if self.config.simd_enabled {
-                    Ok(ValType::V128)
-                } else {
-                    Ok(ValType::I32)
-                }
-            }
-            ValTypeClass::Ref => {
-                if self.config.reference_types_enabled {
-                    Ok(ValType::Ref(self.arbitrary_ref_type(u)?))
-                } else {
-                    Ok(ValType::I32)
-                }
-            }
+            ValTypeClass::V128 => Ok(ValType::V128),
+            ValTypeClass::Ref => Ok(ValType::Ref(self.arbitrary_ref_type(u)?)),
         }
     }
 
@@ -2482,12 +2486,14 @@ pub(crate) fn configured_valtypes(config: &Config) -> Vec<ValType> {
     let mut valtypes = Vec::with_capacity(25);
     valtypes.push(ValType::I32);
     valtypes.push(ValType::I64);
-    valtypes.push(ValType::F32);
-    valtypes.push(ValType::F64);
+    if config.allow_floats {
+        valtypes.push(ValType::F32);
+        valtypes.push(ValType::F64);
+    }
     if config.simd_enabled {
         valtypes.push(ValType::V128);
     }
-    if config.gc_enabled {
+    if config.gc_enabled && config.reference_types_enabled {
         for nullable in [
             // TODO: For now, only create allow nullable reference
             // types. Eventually we should support non-nullable reference types,
@@ -2808,6 +2814,24 @@ impl InstructionKinds {
     pub fn contains(&self, kind: InstructionKind) -> bool {
         self.0.contains(kind)
     }
+
+    /// Restrict each [InstructionKind] to its subset not involving floats
+    pub fn without_floats(&self) -> Self {
+        let mut floatless = self.0;
+        if floatless.contains(InstructionKind::Numeric) {
+            floatless -= InstructionKind::Numeric;
+            floatless |= InstructionKind::NumericInt;
+        }
+        if floatless.contains(InstructionKind::Vector) {
+            floatless -= InstructionKind::Vector;
+            floatless |= InstructionKind::VectorInt;
+        }
+        if floatless.contains(InstructionKind::Memory) {
+            floatless -= InstructionKind::Memory;
+            floatless |= InstructionKind::MemoryInt;
+        }
+        Self(floatless)
+    }
 }
 
 flags! {
@@ -2816,15 +2840,18 @@ flags! {
     #[allow(missing_docs)]
     #[cfg_attr(feature = "_internal_cli", derive(serde_derive::Deserialize))]
     pub enum InstructionKind: u16 {
-        Numeric,
-        Vector,
-        Reference,
-        Parametric,
-        Variable,
-        Table,
-        Memory,
-        Control,
-        Aggregate,
+        NumericInt = 1 << 0,
+        Numeric = (1 << 1) | (1 << 0),
+        VectorInt = 1 << 2,
+        Vector = (1 << 3) | (1 << 2),
+        Reference = 1 << 4,
+        Parametric = 1 << 5,
+        Variable = 1 << 6,
+        Table = 1 << 7,
+        MemoryInt = 1 << 8,
+        Memory = (1 << 9) | (1 << 8),
+        Control = 1 << 10,
+        Aggregate = 1 << 11,
     }
 }
 
@@ -2844,12 +2871,15 @@ impl FromStr for InstructionKind {
     type Err = String;
     fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
         match s.to_lowercase().as_str() {
+            "numeric_non_float" => Ok(InstructionKind::NumericInt),
             "numeric" => Ok(InstructionKind::Numeric),
+            "vector_non_float" => Ok(InstructionKind::VectorInt),
             "vector" => Ok(InstructionKind::Vector),
             "reference" => Ok(InstructionKind::Reference),
             "parametric" => Ok(InstructionKind::Parametric),
             "variable" => Ok(InstructionKind::Variable),
             "table" => Ok(InstructionKind::Table),
+            "memory_non_float" => Ok(InstructionKind::MemoryInt),
             "memory" => Ok(InstructionKind::Memory),
             "control" => Ok(InstructionKind::Control),
             _ => Err(format!("unknown instruction kind: {}", s)),
diff --git a/crates/wasm-smith/src/core/code_builder.rs b/crates/wasm-smith/src/core/code_builder.rs
index f06340ae..8f63a196 100644
--- a/crates/wasm-smith/src/core/code_builder.rs
+++ b/crates/wasm-smith/src/core/code_builder.rs
@@ -126,62 +126,62 @@ instructions! {
     (Some(global_get_valid), global_get, Variable),
     (Some(global_set_valid), global_set, Variable),
     // Memory instructions.
-    (Some(have_memory_and_offset), i32_load, Memory),
-    (Some(have_memory_and_offset), i64_load, Memory),
+    (Some(have_memory_and_offset), i32_load, MemoryInt),
+    (Some(have_memory_and_offset), i64_load, MemoryInt),
     (Some(have_memory_and_offset), f32_load, Memory),
     (Some(have_memory_and_offset), f64_load, Memory),
-    (Some(have_memory_and_offset), i32_load_8_s, Memory),
-    (Some(have_memory_and_offset), i32_load_8_u, Memory),
-    (Some(have_memory_and_offset), i32_load_16_s, Memory),
-    (Some(have_memory_and_offset), i32_load_16_u, Memory),
-    (Some(have_memory_and_offset), i64_load_8_s, Memory),
-    (Some(have_memory_and_offset), i64_load_16_s, Memory),
-    (Some(have_memory_and_offset), i64_load_32_s, Memory),
-    (Some(have_memory_and_offset), i64_load_8_u, Memory),
-    (Some(have_memory_and_offset), i64_load_16_u, Memory),
-    (Some(have_memory_and_offset), i64_load_32_u, Memory),
-    (Some(i32_store_valid), i32_store, Memory),
-    (Some(i64_store_valid), i64_store, Memory),
+    (Some(have_memory_and_offset), i32_load_8_s, MemoryInt),
+    (Some(have_memory_and_offset), i32_load_8_u, MemoryInt),
+    (Some(have_memory_and_offset), i32_load_16_s, MemoryInt),
+    (Some(have_memory_and_offset), i32_load_16_u, MemoryInt),
+    (Some(have_memory_and_offset), i64_load_8_s, MemoryInt),
+    (Some(have_memory_and_offset), i64_load_16_s, MemoryInt),
+    (Some(have_memory_and_offset), i64_load_32_s, MemoryInt),
+    (Some(have_memory_and_offset), i64_load_8_u, MemoryInt),
+    (Some(have_memory_and_offset), i64_load_16_u, MemoryInt),
+    (Some(have_memory_and_offset), i64_load_32_u, MemoryInt),
+    (Some(i32_store_valid), i32_store, MemoryInt),
+    (Some(i64_store_valid), i64_store, MemoryInt),
     (Some(f32_store_valid), f32_store, Memory),
     (Some(f64_store_valid), f64_store, Memory),
-    (Some(i32_store_valid), i32_store_8, Memory),
-    (Some(i32_store_valid), i32_store_16, Memory),
-    (Some(i64_store_valid), i64_store_8, Memory),
-    (Some(i64_store_valid), i64_store_16, Memory),
-    (Some(i64_store_valid), i64_store_32, Memory),
-    (Some(have_memory), memory_size, Memory),
-    (Some(memory_grow_valid), memory_grow, Memory),
-    (Some(memory_init_valid), memory_init, Memory),
-    (Some(data_drop_valid), data_drop, Memory),
-    (Some(memory_copy_valid), memory_copy, Memory),
-    (Some(memory_fill_valid), memory_fill, Memory),
+    (Some(i32_store_valid), i32_store_8, MemoryInt),
+    (Some(i32_store_valid), i32_store_16, MemoryInt),
+    (Some(i64_store_valid), i64_store_8, MemoryInt),
+    (Some(i64_store_valid), i64_store_16, MemoryInt),
+    (Some(i64_store_valid), i64_store_32, MemoryInt),
+    (Some(have_memory), memory_size, MemoryInt),
+    (Some(memory_grow_valid), memory_grow, MemoryInt),
+    (Some(memory_init_valid), memory_init, MemoryInt),
+    (Some(data_drop_valid), data_drop, MemoryInt),
+    (Some(memory_copy_valid), memory_copy, MemoryInt),
+    (Some(memory_fill_valid), memory_fill, MemoryInt),
     // Numeric instructions.
-    (None, i32_const, Numeric),
-    (None, i64_const, Numeric),
+    (None, i32_const, NumericInt),
+    (None, i64_const, NumericInt),
     (None, f32_const, Numeric),
     (None, f64_const, Numeric),
-    (Some(i32_on_stack), i32_eqz, Numeric),
-    (Some(i32_i32_on_stack), i32_eq, Numeric),
-    (Some(i32_i32_on_stack), i32_ne, Numeric),
-    (Some(i32_i32_on_stack), i32_lt_s, Numeric),
-    (Some(i32_i32_on_stack), i32_lt_u, Numeric),
-    (Some(i32_i32_on_stack), i32_gt_s, Numeric),
-    (Some(i32_i32_on_stack), i32_gt_u, Numeric),
-    (Some(i32_i32_on_stack), i32_le_s, Numeric),
-    (Some(i32_i32_on_stack), i32_le_u, Numeric),
-    (Some(i32_i32_on_stack), i32_ge_s, Numeric),
-    (Some(i32_i32_on_stack), i32_ge_u, Numeric),
-    (Some(i64_on_stack), i64_eqz, Numeric),
-    (Some(i64_i64_on_stack), i64_eq, Numeric),
-    (Some(i64_i64_on_stack), i64_ne, Numeric),
-    (Some(i64_i64_on_stack), i64_lt_s, Numeric),
-    (Some(i64_i64_on_stack), i64_lt_u, Numeric),
-    (Some(i64_i64_on_stack), i64_gt_s, Numeric),
-    (Some(i64_i64_on_stack), i64_gt_u, Numeric),
-    (Some(i64_i64_on_stack), i64_le_s, Numeric),
-    (Some(i64_i64_on_stack), i64_le_u, Numeric),
-    (Some(i64_i64_on_stack), i64_ge_s, Numeric),
-    (Some(i64_i64_on_stack), i64_ge_u, Numeric),
+    (Some(i32_on_stack), i32_eqz, NumericInt),
+    (Some(i32_i32_on_stack), i32_eq, NumericInt),
+    (Some(i32_i32_on_stack), i32_ne, NumericInt),
+    (Some(i32_i32_on_stack), i32_lt_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_lt_u, NumericInt),
+    (Some(i32_i32_on_stack), i32_gt_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_gt_u, NumericInt),
+    (Some(i32_i32_on_stack), i32_le_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_le_u, NumericInt),
+    (Some(i32_i32_on_stack), i32_ge_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_ge_u, NumericInt),
+    (Some(i64_on_stack), i64_eqz, NumericInt),
+    (Some(i64_i64_on_stack), i64_eq, NumericInt),
+    (Some(i64_i64_on_stack), i64_ne, NumericInt),
+    (Some(i64_i64_on_stack), i64_lt_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_lt_u, NumericInt),
+    (Some(i64_i64_on_stack), i64_gt_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_gt_u, NumericInt),
+    (Some(i64_i64_on_stack), i64_le_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_le_u, NumericInt),
+    (Some(i64_i64_on_stack), i64_ge_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_ge_u, NumericInt),
     (Some(f32_f32_on_stack), f32_eq, Numeric),
     (Some(f32_f32_on_stack), f32_ne, Numeric),
     (Some(f32_f32_on_stack), f32_lt, Numeric),
@@ -194,42 +194,42 @@ instructions! {
     (Some(f64_f64_on_stack), f64_gt, Numeric),
     (Some(f64_f64_on_stack), f64_le, Numeric),
     (Some(f64_f64_on_stack), f64_ge, Numeric),
-    (Some(i32_on_stack), i32_clz, Numeric),
-    (Some(i32_on_stack), i32_ctz, Numeric),
-    (Some(i32_on_stack), i32_popcnt, Numeric),
-    (Some(i32_i32_on_stack), i32_add, Numeric),
-    (Some(i32_i32_on_stack), i32_sub, Numeric),
-    (Some(i32_i32_on_stack), i32_mul, Numeric),
-    (Some(i32_i32_on_stack), i32_div_s, Numeric),
-    (Some(i32_i32_on_stack), i32_div_u, Numeric),
-    (Some(i32_i32_on_stack), i32_rem_s, Numeric),
-    (Some(i32_i32_on_stack), i32_rem_u, Numeric),
-    (Some(i32_i32_on_stack), i32_and, Numeric),
-    (Some(i32_i32_on_stack), i32_or, Numeric),
-    (Some(i32_i32_on_stack), i32_xor, Numeric),
-    (Some(i32_i32_on_stack), i32_shl, Numeric),
-    (Some(i32_i32_on_stack), i32_shr_s, Numeric),
-    (Some(i32_i32_on_stack), i32_shr_u, Numeric),
-    (Some(i32_i32_on_stack), i32_rotl, Numeric),
-    (Some(i32_i32_on_stack), i32_rotr, Numeric),
-    (Some(i64_on_stack), i64_clz, Numeric),
-    (Some(i64_on_stack), i64_ctz, Numeric),
-    (Some(i64_on_stack), i64_popcnt, Numeric),
-    (Some(i64_i64_on_stack), i64_add, Numeric),
-    (Some(i64_i64_on_stack), i64_sub, Numeric),
-    (Some(i64_i64_on_stack), i64_mul, Numeric),
-    (Some(i64_i64_on_stack), i64_div_s, Numeric),
-    (Some(i64_i64_on_stack), i64_div_u, Numeric),
-    (Some(i64_i64_on_stack), i64_rem_s, Numeric),
-    (Some(i64_i64_on_stack), i64_rem_u, Numeric),
-    (Some(i64_i64_on_stack), i64_and, Numeric),
-    (Some(i64_i64_on_stack), i64_or, Numeric),
-    (Some(i64_i64_on_stack), i64_xor, Numeric),
-    (Some(i64_i64_on_stack), i64_shl, Numeric),
-    (Some(i64_i64_on_stack), i64_shr_s, Numeric),
-    (Some(i64_i64_on_stack), i64_shr_u, Numeric),
-    (Some(i64_i64_on_stack), i64_rotl, Numeric),
-    (Some(i64_i64_on_stack), i64_rotr, Numeric),
+    (Some(i32_on_stack), i32_clz, NumericInt),
+    (Some(i32_on_stack), i32_ctz, NumericInt),
+    (Some(i32_on_stack), i32_popcnt, NumericInt),
+    (Some(i32_i32_on_stack), i32_add, NumericInt),
+    (Some(i32_i32_on_stack), i32_sub, NumericInt),
+    (Some(i32_i32_on_stack), i32_mul, NumericInt),
+    (Some(i32_i32_on_stack), i32_div_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_div_u, NumericInt),
+    (Some(i32_i32_on_stack), i32_rem_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_rem_u, NumericInt),
+    (Some(i32_i32_on_stack), i32_and, NumericInt),
+    (Some(i32_i32_on_stack), i32_or, NumericInt),
+    (Some(i32_i32_on_stack), i32_xor, NumericInt),
+    (Some(i32_i32_on_stack), i32_shl, NumericInt),
+    (Some(i32_i32_on_stack), i32_shr_s, NumericInt),
+    (Some(i32_i32_on_stack), i32_shr_u, NumericInt),
+    (Some(i32_i32_on_stack), i32_rotl, NumericInt),
+    (Some(i32_i32_on_stack), i32_rotr, NumericInt),
+    (Some(i64_on_stack), i64_clz, NumericInt),
+    (Some(i64_on_stack), i64_ctz, NumericInt),
+    (Some(i64_on_stack), i64_popcnt, NumericInt),
+    (Some(i64_i64_on_stack), i64_add, NumericInt),
+    (Some(i64_i64_on_stack), i64_sub, NumericInt),
+    (Some(i64_i64_on_stack), i64_mul, NumericInt),
+    (Some(i64_i64_on_stack), i64_div_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_div_u, NumericInt),
+    (Some(i64_i64_on_stack), i64_rem_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_rem_u, NumericInt),
+    (Some(i64_i64_on_stack), i64_and, NumericInt),
+    (Some(i64_i64_on_stack), i64_or, NumericInt),
+    (Some(i64_i64_on_stack), i64_xor, NumericInt),
+    (Some(i64_i64_on_stack), i64_shl, NumericInt),
+    (Some(i64_i64_on_stack), i64_shr_s, NumericInt),
+    (Some(i64_i64_on_stack), i64_shr_u, NumericInt),
+    (Some(i64_i64_on_stack), i64_rotl, NumericInt),
+    (Some(i64_i64_on_stack), i64_rotr, NumericInt),
     (Some(f32_on_stack), f32_abs, Numeric),
     (Some(f32_on_stack), f32_neg, Numeric),
     (Some(f32_on_stack), f32_ceil, Numeric),
@@ -258,13 +258,13 @@ instructions! {
     (Some(f64_f64_on_stack), f64_min, Numeric),
     (Some(f64_f64_on_stack), f64_max, Numeric),
     (Some(f64_f64_on_stack), f64_copysign, Numeric),
-    (Some(i64_on_stack), i32_wrap_i64, Numeric),
+    (Some(i64_on_stack), i32_wrap_i64, NumericInt),
     (Some(f32_on_stack), i32_trunc_f32_s, Numeric),
     (Some(f32_on_stack), i32_trunc_f32_u, Numeric),
     (Some(f64_on_stack), i32_trunc_f64_s, Numeric),
     (Some(f64_on_stack), i32_trunc_f64_u, Numeric),
-    (Some(i32_on_stack), i64_extend_i32_s, Numeric),
-    (Some(i32_on_stack), i64_extend_i32_u, Numeric),
+    (Some(i32_on_stack), i64_extend_i32_s, NumericInt),
+    (Some(i32_on_stack), i64_extend_i32_u, NumericInt),
     (Some(f32_on_stack), i64_trunc_f32_s, Numeric),
     (Some(f32_on_stack), i64_trunc_f32_u, Numeric),
     (Some(f64_on_stack), i64_trunc_f64_s, Numeric),
@@ -283,11 +283,11 @@ instructions! {
     (Some(f64_on_stack), i64_reinterpret_f64, Numeric),
     (Some(i32_on_stack), f32_reinterpret_i32, Numeric),
     (Some(i64_on_stack), f64_reinterpret_i64, Numeric),
-    (Some(extendable_i32_on_stack), i32_extend_8_s, Numeric),
-    (Some(extendable_i32_on_stack), i32_extend_16_s, Numeric),
-    (Some(extendable_i64_on_stack), i64_extend_8_s, Numeric),
-    (Some(extendable_i64_on_stack), i64_extend_16_s, Numeric),
-    (Some(extendable_i64_on_stack), i64_extend_32_s, Numeric),
+    (Some(extendable_i32_on_stack), i32_extend_8_s, NumericInt),
+    (Some(extendable_i32_on_stack), i32_extend_16_s, NumericInt),
+    (Some(extendable_i64_on_stack), i64_extend_8_s, NumericInt),
+    (Some(extendable_i64_on_stack), i64_extend_16_s, NumericInt),
+    (Some(extendable_i64_on_stack), i64_extend_32_s, NumericInt),
     (Some(nontrapping_f32_on_stack), i32_trunc_sat_f32_s, Numeric),
     (Some(nontrapping_f32_on_stack), i32_trunc_sat_f32_u, Numeric),
     (Some(nontrapping_f64_on_stack), i32_trunc_sat_f64_s, Numeric),
@@ -334,93 +334,93 @@ instructions! {
     (Some(any_convert_extern_valid), any_convert_extern, Aggregate),
     (Some(extern_convert_any_valid), extern_convert_any, Aggregate),
     // SIMD instructions.
-    (Some(simd_have_memory_and_offset), v128_load, Vector),
-    (Some(simd_have_memory_and_offset), v128_load8x8s, Vector),
-    (Some(simd_have_memory_and_offset), v128_load8x8u, Vector),
-    (Some(simd_have_memory_and_offset), v128_load16x4s, Vector),
-    (Some(simd_have_memory_and_offset), v128_load16x4u, Vector),
-    (Some(simd_have_memory_and_offset), v128_load32x2s, Vector),
-    (Some(simd_have_memory_and_offset), v128_load32x2u, Vector),
-    (Some(simd_have_memory_and_offset), v128_load8_splat, Vector),
-    (Some(simd_have_memory_and_offset), v128_load16_splat, Vector),
-    (Some(simd_have_memory_and_offset), v128_load32_splat, Vector),
-    (Some(simd_have_memory_and_offset), v128_load64_splat, Vector),
-    (Some(simd_have_memory_and_offset), v128_load32_zero, Vector),
-    (Some(simd_have_memory_and_offset), v128_load64_zero, Vector),
-    (Some(simd_v128_store_valid), v128_store, Vector),
-    (Some(simd_load_lane_valid), v128_load8_lane, Vector),
-    (Some(simd_load_lane_valid), v128_load16_lane, Vector),
-    (Some(simd_load_lane_valid), v128_load32_lane, Vector),
-    (Some(simd_load_lane_valid), v128_load64_lane, Vector),
-    (Some(simd_store_lane_valid), v128_store8_lane, Vector),
-    (Some(simd_store_lane_valid), v128_store16_lane, Vector),
-    (Some(simd_store_lane_valid), v128_store32_lane, Vector),
-    (Some(simd_store_lane_valid), v128_store64_lane, Vector),
-    (Some(simd_enabled), v128_const, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_shuffle, Vector),
-    (Some(simd_v128_on_stack), i8x16_extract_lane_s, Vector),
-    (Some(simd_v128_on_stack), i8x16_extract_lane_u, Vector),
-    (Some(simd_v128_i32_on_stack), i8x16_replace_lane, Vector),
-    (Some(simd_v128_on_stack), i16x8_extract_lane_s, Vector),
-    (Some(simd_v128_on_stack), i16x8_extract_lane_u, Vector),
-    (Some(simd_v128_i32_on_stack), i16x8_replace_lane, Vector),
-    (Some(simd_v128_on_stack), i32x4_extract_lane, Vector),
-    (Some(simd_v128_i32_on_stack), i32x4_replace_lane, Vector),
-    (Some(simd_v128_on_stack), i64x2_extract_lane, Vector),
-    (Some(simd_v128_i64_on_stack), i64x2_replace_lane, Vector),
+    (Some(simd_have_memory_and_offset), v128_load, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load8x8s, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load8x8u, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load16x4s, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load16x4u, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load32x2s, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load32x2u, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load8_splat, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load16_splat, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load32_splat, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load64_splat, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load32_zero, VectorInt),
+    (Some(simd_have_memory_and_offset), v128_load64_zero, VectorInt),
+    (Some(simd_v128_store_valid), v128_store, VectorInt),
+    (Some(simd_load_lane_valid), v128_load8_lane, VectorInt),
+    (Some(simd_load_lane_valid), v128_load16_lane, VectorInt),
+    (Some(simd_load_lane_valid), v128_load32_lane, VectorInt),
+    (Some(simd_load_lane_valid), v128_load64_lane, VectorInt),
+    (Some(simd_store_lane_valid), v128_store8_lane, VectorInt),
+    (Some(simd_store_lane_valid), v128_store16_lane, VectorInt),
+    (Some(simd_store_lane_valid), v128_store32_lane, VectorInt),
+    (Some(simd_store_lane_valid), v128_store64_lane, VectorInt),
+    (Some(simd_enabled), v128_const, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_shuffle, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_extract_lane_s, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_extract_lane_u, VectorInt),
+    (Some(simd_v128_i32_on_stack), i8x16_replace_lane, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extract_lane_s, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extract_lane_u, VectorInt),
+    (Some(simd_v128_i32_on_stack), i16x8_replace_lane, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extract_lane, VectorInt),
+    (Some(simd_v128_i32_on_stack), i32x4_replace_lane, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_extract_lane, VectorInt),
+    (Some(simd_v128_i64_on_stack), i64x2_replace_lane, VectorInt),
     (Some(simd_v128_on_stack), f32x4_extract_lane, Vector),
     (Some(simd_v128_f32_on_stack), f32x4_replace_lane, Vector),
     (Some(simd_v128_on_stack), f64x2_extract_lane, Vector),
     (Some(simd_v128_f64_on_stack), f64x2_replace_lane, Vector),
-    (Some(simd_i32_on_stack), i8x16_splat, Vector),
-    (Some(simd_i32_on_stack), i16x8_splat, Vector),
-    (Some(simd_i32_on_stack), i32x4_splat, Vector),
-    (Some(simd_i64_on_stack), i64x2_splat, Vector),
+    (Some(simd_i32_on_stack), i8x16_splat, VectorInt),
+    (Some(simd_i32_on_stack), i16x8_splat, VectorInt),
+    (Some(simd_i32_on_stack), i32x4_splat, VectorInt),
+    (Some(simd_i64_on_stack), i64x2_splat, VectorInt),
     (Some(simd_f32_on_stack), f32x4_splat, Vector),
     (Some(simd_f64_on_stack), f64x2_splat, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_swizzle, Vector),
-    (Some(simd_v128_v128_on_stack_relaxed), i8x16_relaxed_swizzle, Vector),
-    (Some(simd_v128_v128_v128_on_stack), v128_bitselect, Vector),
-    (Some(simd_v128_v128_v128_on_stack_relaxed), i8x16_relaxed_laneselect, Vector),
-    (Some(simd_v128_v128_v128_on_stack_relaxed), i16x8_relaxed_laneselect, Vector),
-    (Some(simd_v128_v128_v128_on_stack_relaxed), i32x4_relaxed_laneselect, Vector),
-    (Some(simd_v128_v128_v128_on_stack_relaxed), i64x2_relaxed_laneselect, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_eq, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_ne, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_lt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_lt_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_gt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_gt_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_le_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_le_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_ge_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_ge_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_eq, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_ne, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_lt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_lt_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_gt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_gt_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_le_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_le_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_ge_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_ge_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_eq, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_ne, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_lt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_lt_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_gt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_gt_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_le_s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_le_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_ge_s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_ge_u, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_eq, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_ne, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_lt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_gt_s, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_le_s, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_ge_s, Vector),
+    (Some(simd_v128_v128_on_stack), i8x16_swizzle, VectorInt),
+    (Some(simd_v128_v128_on_stack_relaxed), i8x16_relaxed_swizzle, VectorInt),
+    (Some(simd_v128_v128_v128_on_stack), v128_bitselect, VectorInt),
+    (Some(simd_v128_v128_v128_on_stack_relaxed), i8x16_relaxed_laneselect, VectorInt),
+    (Some(simd_v128_v128_v128_on_stack_relaxed), i16x8_relaxed_laneselect, VectorInt),
+    (Some(simd_v128_v128_v128_on_stack_relaxed), i32x4_relaxed_laneselect, VectorInt),
+    (Some(simd_v128_v128_v128_on_stack_relaxed), i64x2_relaxed_laneselect, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_eq, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_ne, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_lt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_lt_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_gt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_gt_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_le_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_le_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_ge_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_ge_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_eq, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_ne, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_lt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_lt_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_gt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_gt_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_le_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_le_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_ge_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_ge_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_eq, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_ne, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_lt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_lt_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_gt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_gt_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_le_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_le_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_ge_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_ge_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_eq, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_ne, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_lt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_gt_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_le_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_ge_s, VectorInt),
     (Some(simd_v128_v128_on_stack), f32x4_eq, Vector),
     (Some(simd_v128_v128_on_stack), f32x4_ne, Vector),
     (Some(simd_v128_v128_on_stack), f32x4_lt, Vector),
@@ -433,108 +433,108 @@ instructions! {
     (Some(simd_v128_v128_on_stack), f64x2_gt, Vector),
     (Some(simd_v128_v128_on_stack), f64x2_le, Vector),
     (Some(simd_v128_v128_on_stack), f64x2_ge, Vector),
-    (Some(simd_v128_on_stack), v128_not, Vector),
-    (Some(simd_v128_v128_on_stack), v128_and, Vector),
-    (Some(simd_v128_v128_on_stack), v128_and_not, Vector),
-    (Some(simd_v128_v128_on_stack), v128_or, Vector),
-    (Some(simd_v128_v128_on_stack), v128_xor, Vector),
-    (Some(simd_v128_v128_on_stack), v128_any_true, Vector),
-    (Some(simd_v128_on_stack), i8x16_abs, Vector),
-    (Some(simd_v128_on_stack), i8x16_neg, Vector),
-    (Some(simd_v128_on_stack), i8x16_popcnt, Vector),
-    (Some(simd_v128_on_stack), i8x16_all_true, Vector),
-    (Some(simd_v128_on_stack), i8x16_bitmask, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_narrow_i16x8s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_narrow_i16x8u, Vector),
-    (Some(simd_v128_i32_on_stack), i8x16_shl, Vector),
-    (Some(simd_v128_i32_on_stack), i8x16_shr_s, Vector),
-    (Some(simd_v128_i32_on_stack), i8x16_shr_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_add, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_add_sat_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_add_sat_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_sub, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_sub_sat_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_sub_sat_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_min_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_min_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_max_s, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_max_u, Vector),
-    (Some(simd_v128_v128_on_stack), i8x16_avgr_u, Vector),
-    (Some(simd_v128_on_stack), i16x8_extadd_pairwise_i8x16s, Vector),
-    (Some(simd_v128_on_stack), i16x8_extadd_pairwise_i8x16u, Vector),
-    (Some(simd_v128_on_stack), i16x8_abs, Vector),
-    (Some(simd_v128_on_stack), i16x8_neg, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8q15_mulr_sat_s, Vector),
-    (Some(simd_v128_on_stack), i16x8_all_true, Vector),
-    (Some(simd_v128_on_stack), i16x8_bitmask, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_narrow_i32x4s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_narrow_i32x4u, Vector),
-    (Some(simd_v128_on_stack), i16x8_extend_low_i8x16s, Vector),
-    (Some(simd_v128_on_stack), i16x8_extend_high_i8x16s, Vector),
-    (Some(simd_v128_on_stack), i16x8_extend_low_i8x16u, Vector),
-    (Some(simd_v128_on_stack), i16x8_extend_high_i8x16u, Vector),
-    (Some(simd_v128_i32_on_stack), i16x8_shl, Vector),
-    (Some(simd_v128_i32_on_stack), i16x8_shr_s, Vector),
-    (Some(simd_v128_i32_on_stack), i16x8_shr_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_add, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_add_sat_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_add_sat_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_sub, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_sub_sat_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_sub_sat_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_mul, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_min_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_min_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_max_s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_max_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_avgr_u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_extmul_low_i8x16s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_extmul_high_i8x16s, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_extmul_low_i8x16u, Vector),
-    (Some(simd_v128_v128_on_stack), i16x8_extmul_high_i8x16u, Vector),
-    (Some(simd_v128_on_stack), i32x4_extadd_pairwise_i16x8s, Vector),
-    (Some(simd_v128_on_stack), i32x4_extadd_pairwise_i16x8u, Vector),
-    (Some(simd_v128_on_stack), i32x4_abs, Vector),
-    (Some(simd_v128_on_stack), i32x4_neg, Vector),
-    (Some(simd_v128_on_stack), i32x4_all_true, Vector),
-    (Some(simd_v128_on_stack), i32x4_bitmask, Vector),
-    (Some(simd_v128_on_stack), i32x4_extend_low_i16x8s, Vector),
-    (Some(simd_v128_on_stack), i32x4_extend_high_i16x8s, Vector),
-    (Some(simd_v128_on_stack), i32x4_extend_low_i16x8u, Vector),
-    (Some(simd_v128_on_stack), i32x4_extend_high_i16x8u, Vector),
-    (Some(simd_v128_i32_on_stack), i32x4_shl, Vector),
-    (Some(simd_v128_i32_on_stack), i32x4_shr_s, Vector),
-    (Some(simd_v128_i32_on_stack), i32x4_shr_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_add, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_sub, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_mul, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_min_s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_min_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_max_s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_max_u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_dot_i16x8s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_extmul_low_i16x8s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_extmul_high_i16x8s, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_extmul_low_i16x8u, Vector),
-    (Some(simd_v128_v128_on_stack), i32x4_extmul_high_i16x8u, Vector),
-    (Some(simd_v128_on_stack), i64x2_abs, Vector),
-    (Some(simd_v128_on_stack), i64x2_neg, Vector),
-    (Some(simd_v128_on_stack), i64x2_all_true, Vector),
-    (Some(simd_v128_on_stack), i64x2_bitmask, Vector),
-    (Some(simd_v128_on_stack), i64x2_extend_low_i32x4s, Vector),
-    (Some(simd_v128_on_stack), i64x2_extend_high_i32x4s, Vector),
-    (Some(simd_v128_on_stack), i64x2_extend_low_i32x4u, Vector),
-    (Some(simd_v128_on_stack), i64x2_extend_high_i32x4u, Vector),
-    (Some(simd_v128_i32_on_stack), i64x2_shl, Vector),
-    (Some(simd_v128_i32_on_stack), i64x2_shr_s, Vector),
-    (Some(simd_v128_i32_on_stack), i64x2_shr_u, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_add, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_sub, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_mul, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_extmul_low_i32x4s, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_extmul_high_i32x4s, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_extmul_low_i32x4u, Vector),
-    (Some(simd_v128_v128_on_stack), i64x2_extmul_high_i32x4u, Vector),
+    (Some(simd_v128_on_stack), v128_not, VectorInt),
+    (Some(simd_v128_v128_on_stack), v128_and, VectorInt),
+    (Some(simd_v128_v128_on_stack), v128_and_not, VectorInt),
+    (Some(simd_v128_v128_on_stack), v128_or, VectorInt),
+    (Some(simd_v128_v128_on_stack), v128_xor, VectorInt),
+    (Some(simd_v128_v128_on_stack), v128_any_true, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_abs, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_neg, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_popcnt, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_all_true, VectorInt),
+    (Some(simd_v128_on_stack), i8x16_bitmask, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_narrow_i16x8s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_narrow_i16x8u, VectorInt),
+    (Some(simd_v128_i32_on_stack), i8x16_shl, VectorInt),
+    (Some(simd_v128_i32_on_stack), i8x16_shr_s, VectorInt),
+    (Some(simd_v128_i32_on_stack), i8x16_shr_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_add, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_add_sat_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_add_sat_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_sub, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_sub_sat_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_sub_sat_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_min_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_min_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_max_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_max_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i8x16_avgr_u, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extadd_pairwise_i8x16s, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extadd_pairwise_i8x16u, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_abs, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_neg, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8q15_mulr_sat_s, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_all_true, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_bitmask, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_narrow_i32x4s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_narrow_i32x4u, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extend_low_i8x16s, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extend_high_i8x16s, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extend_low_i8x16u, VectorInt),
+    (Some(simd_v128_on_stack), i16x8_extend_high_i8x16u, VectorInt),
+    (Some(simd_v128_i32_on_stack), i16x8_shl, VectorInt),
+    (Some(simd_v128_i32_on_stack), i16x8_shr_s, VectorInt),
+    (Some(simd_v128_i32_on_stack), i16x8_shr_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_add, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_add_sat_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_add_sat_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_sub, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_sub_sat_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_sub_sat_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_mul, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_min_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_min_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_max_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_max_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_avgr_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_extmul_low_i8x16s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_extmul_high_i8x16s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_extmul_low_i8x16u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i16x8_extmul_high_i8x16u, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extadd_pairwise_i16x8s, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extadd_pairwise_i16x8u, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_abs, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_neg, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_all_true, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_bitmask, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extend_low_i16x8s, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extend_high_i16x8s, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extend_low_i16x8u, VectorInt),
+    (Some(simd_v128_on_stack), i32x4_extend_high_i16x8u, VectorInt),
+    (Some(simd_v128_i32_on_stack), i32x4_shl, VectorInt),
+    (Some(simd_v128_i32_on_stack), i32x4_shr_s, VectorInt),
+    (Some(simd_v128_i32_on_stack), i32x4_shr_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_add, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_sub, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_mul, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_min_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_min_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_max_s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_max_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_dot_i16x8s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_extmul_low_i16x8s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_extmul_high_i16x8s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_extmul_low_i16x8u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i32x4_extmul_high_i16x8u, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_abs, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_neg, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_all_true, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_bitmask, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_extend_low_i32x4s, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_extend_high_i32x4s, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_extend_low_i32x4u, VectorInt),
+    (Some(simd_v128_on_stack), i64x2_extend_high_i32x4u, VectorInt),
+    (Some(simd_v128_i32_on_stack), i64x2_shl, VectorInt),
+    (Some(simd_v128_i32_on_stack), i64x2_shr_s, VectorInt),
+    (Some(simd_v128_i32_on_stack), i64x2_shr_u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_add, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_sub, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_mul, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_extmul_low_i32x4s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_extmul_high_i32x4s, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_extmul_low_i32x4u, VectorInt),
+    (Some(simd_v128_v128_on_stack), i64x2_extmul_high_i32x4u, VectorInt),
     (Some(simd_v128_on_stack), f32x4_ceil, Vector),
     (Some(simd_v128_on_stack), f32x4_floor, Vector),
     (Some(simd_v128_on_stack), f32x4_trunc, Vector),
@@ -587,9 +587,9 @@ instructions! {
     (Some(simd_v128_v128_on_stack_relaxed), f32x4_relaxed_max, Vector),
     (Some(simd_v128_v128_on_stack_relaxed), f64x2_relaxed_min, Vector),
     (Some(simd_v128_v128_on_stack_relaxed), f64x2_relaxed_max, Vector),
-    (Some(simd_v128_v128_on_stack_relaxed), i16x8_relaxed_q15mulr_s, Vector),
-    (Some(simd_v128_v128_on_stack_relaxed), i16x8_relaxed_dot_i8x16_i7x16_s, Vector),
-    (Some(simd_v128_v128_v128_on_stack_relaxed), i32x4_relaxed_dot_i8x16_i7x16_add_s, Vector),
+    (Some(simd_v128_v128_on_stack_relaxed), i16x8_relaxed_q15mulr_s, VectorInt),
+    (Some(simd_v128_v128_on_stack_relaxed), i16x8_relaxed_dot_i8x16_i7x16_s, VectorInt),
+    (Some(simd_v128_v128_v128_on_stack_relaxed), i32x4_relaxed_dot_i8x16_i7x16_add_s, VectorInt),
 }
 
 pub(crate) struct CodeBuilderAllocations {
@@ -1239,7 +1239,11 @@ impl CodeBuilder<'_> {
         module: &Module,
     ) -> Result<Vec<Instruction>> {
         let max_instructions = module.config.max_instructions;
-        let allowed_instructions = module.config.allowed_instructions;
+        let allowed_instructions = if module.config.allow_floats {
+            module.config.allowed_instructions
+        } else {
+            module.config.allowed_instructions.without_floats()
+        };
         let mut instructions = vec![];
 
         while !self.allocs.controls.is_empty() {


Test patch:
diff --git a/crates/wasm-smith/tests/core.rs b/crates/wasm-smith/tests/core.rs
index 279dca2f..d78d7876 100644
--- a/crates/wasm-smith/tests/core.rs
+++ b/crates/wasm-smith/tests/core.rs
@@ -124,6 +124,45 @@ fn smoke_test_no_trapping_mode() {
     }
 }
 
+#[test]
+fn smoke_test_disallow_floats() {
+    let mut rng = SmallRng::seed_from_u64(0);
+    let mut buf = vec![0; 2048];
+    for _ in 0..1024 {
+        rng.fill_bytes(&mut buf);
+        let mut u = Unstructured::new(&buf);
+        let mut cfg = Config::arbitrary(&mut u).unwrap();
+        cfg.allow_floats = false;
+        if let Ok(module) = Module::new(cfg, &mut u) {
+            let wasm_bytes = module.to_bytes();
+            let mut features = wasm_features();
+            features.remove(WasmFeatures::FLOATS);
+            let mut validator = Validator::new_with_features(features);
+            validate(&mut validator, &wasm_bytes);
+        }
+    }
+}
+
+#[test]
+fn smoke_test_reference_types() {
+    let mut rng = SmallRng::seed_from_u64(0);
+    let mut buf = vec![0; 2048];
+    for _ in 0..1024 {
+        rng.fill_bytes(&mut buf);
+        let mut u = Unstructured::new(&buf);
+        let mut cfg = Config::arbitrary(&mut u).unwrap();
+        cfg.reference_types_enabled = false;
+        cfg.max_tables = 1;
+        if let Ok(module) = Module::new(cfg, &mut u) {
+            let wasm_bytes = module.to_bytes();
+            let mut features = wasm_features();
+            features.remove(WasmFeatures::REFERENCE_TYPES);
+            let mut validator = Validator::new_with_features(features);
+            validate(&mut validator, &wasm_bytes);
+        }
+    }
+}
+
 #[test]
 fn smoke_test_wasm_gc() {
     let mut rng = SmallRng::seed_from_u64(0);