From 5e37d11b1f2add1d8d21d84beac3d8ec8f05edd3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 1 Jul 2023 19:43:28 +0900 Subject: [PATCH] give exec_instruction_desc arrays larger alignment hopefully this might give a bit more stable performance. cf. the commit message in 3cd51c0a24d47369325c7614a1e1f985c1531c02 --- lib/insn.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/insn.c b/lib/insn.c index 149f9e9e..44057116 100644 --- a/lib/insn.c +++ b/lib/insn.c @@ -638,23 +638,28 @@ static int fetch_exec_next_insn_fe(const uint8_t *p, struct cell *stack, .fetch_exec = fetch_exec_next_insn_##n, \ }, -const static struct exec_instruction_desc exec_instructions_fc[] = { +#define __exec_table_align __aligned(64) + +const static struct exec_instruction_desc + exec_instructions_fc[] __exec_table_align = { #include "insn_list_fc.h" }; #if defined(TOYWASM_ENABLE_WASM_SIMD) -const static struct exec_instruction_desc exec_instructions_fd[] = { +const static struct exec_instruction_desc + exec_instructions_fd[] __exec_table_align = { #include "insn_list_simd.h" }; #endif #if defined(TOYWASM_ENABLE_WASM_THREADS) -const static struct exec_instruction_desc exec_instructions_fe[] = { +const static struct exec_instruction_desc + exec_instructions_fe[] __exec_table_align = { #include "insn_list_threads.h" }; #endif -const struct exec_instruction_desc exec_instructions[] = { +const struct exec_instruction_desc exec_instructions[] __exec_table_align = { #include "insn_list_base.h" #if defined(TOYWASM_ENABLE_WASM_TAILCALL) #include "insn_list_tailcall.h"