Skip to content

Commit 72a1fc0

Browse files
author
Yanzhang Wang
committed
Add misaligned memory access for spike.
The spec does not forbid the misaligned memory access. And the gcc will generate vector load/store to access misaligned memory by default. Currently the QEMU supports this feature, so to support in spike is also make sense. Reference test case: gcc/gcc/testsuite/gcc.dg/vect/vect-align-1.c
1 parent fcc49c7 commit 72a1fc0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/wrapper/spike/riscv64-unknown-linux-gnu-run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ varch="$(march-to-cpu-opt --elf-file-path $1 --print-spike-varch)"
66

77
isa_option="--isa=${isa}"
88
varch_option=""
9+
memory_option="--misaligned"
910

1011
[[ ! -z ${varch} ]] && varch_option="--varch=${varch}"
1112

12-
spike ${isa_option} ${varch_option} ${PK_PATH}/pk${xlen} "$@"
13+
spike ${memory_option} ${isa_option} ${varch_option} ${PK_PATH}/pk${xlen} "$@"

0 commit comments

Comments
 (0)