diff --git a/compiler/gen_wasm/src/wasm_module/code_builder.rs b/compiler/gen_wasm/src/wasm_module/code_builder.rs index 18e92f9d8b..759ff7559a 100644 --- a/compiler/gen_wasm/src/wasm_module/code_builder.rs +++ b/compiler/gen_wasm/src/wasm_module/code_builder.rs @@ -84,7 +84,9 @@ impl std::fmt::Debug for VmBlock<'_> { } } -/// Wasm memory alignment. (Rust representation matches Wasm encoding) +/// Wasm memory alignment for load/store instructions. +/// Rust representation matches Wasm encoding. +/// It's an error to specify alignment higher than the "natural" alignment of the instruction #[repr(u8)] #[derive(Clone, Copy, Debug)] pub enum Align { @@ -92,10 +94,6 @@ pub enum Align { Bytes2 = 1, Bytes4 = 2, Bytes8 = 3, - Bytes16 = 4, - Bytes32 = 5, - Bytes64 = 6, - // ... we can add more if we need them ... } impl From for Align { @@ -105,9 +103,6 @@ impl From for Align { 2 => Align::Bytes2, 4 => Align::Bytes4, 8 => Align::Bytes8, - 16 => Align::Bytes16, - 32 => Align::Bytes32, - 64 => Align::Bytes64, _ => panic!("{:?}-byte alignment not supported", x), } }