Skip to content

Commit

Permalink
give exec_instruction_desc arrays larger alignment
Browse files Browse the repository at this point in the history
hopefully this might give a bit more stable performance.

cf. the commit message in 3cd51c0
  • Loading branch information
yamt committed Jul 3, 2023
1 parent f0dd501 commit 5e37d11
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/insn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5e37d11

Please sign in to comment.