From 13ac951004c0b8765bf14b5597c22102ec6be789 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 6 Sep 2019 09:54:19 -0700 Subject: [PATCH] Allow global initialization of SIMD vectors --- cranelift/wasm/src/translation_utils.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cranelift/wasm/src/translation_utils.rs b/cranelift/wasm/src/translation_utils.rs index f033b8660c..726d6f7c63 100644 --- a/cranelift/wasm/src/translation_utils.rs +++ b/cranelift/wasm/src/translation_utils.rs @@ -65,7 +65,7 @@ pub struct Global { pub initializer: GlobalInit, } -/// Globals are initialized via the four `const` operators or by referring to another import. +/// Globals are initialized via the `const` operators or by referring to another import. #[derive(Debug, Clone, Copy, Hash)] pub enum GlobalInit { /// An `i32.const`. @@ -76,6 +76,8 @@ pub enum GlobalInit { F32Const(u32), /// An `f64.const`. F64Const(u64), + /// A `vconst`. + V128Const([u8; 16]), /// A `get_global` of another global. GetGlobal(GlobalIndex), ///< The global is imported from, and thus initialized by, a different module.