Skip to content

Commit 0ccab07

Browse files
committed
fixup! Introduce WASM_CPU_SUPPORTS_UNALIGNED_SIMD_ACCESS for V128 load/store
Make simd_store alignment consistent with simd_load. The simd_load function was updated to use conditional alignment based on target_supports_unaligned_simd, but simd_store was missed. Apply the same logic: targets with native unaligned SIMD support (x86_64, aarch64, hexagon) use align 1, others use the WASM alignment hint.
1 parent fe7bf09 commit 0ccab07

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

core/iwasm/compilation/simd/simd_load_store.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ simd_store(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx, uint32 align,
310310
return false;
311311
}
312312

313-
LLVMSetAlignment(result, 1);
313+
/* Mirror the alignment logic in simd_load: targets with native
314+
* unaligned SIMD support use align 1, others use the WASM hint. */
315+
if (comp_ctx->target_supports_unaligned_simd)
316+
LLVMSetAlignment(result, 1);
317+
else
318+
LLVMSetAlignment(result, 1 << align);
314319

315320
return true;
316321
}

0 commit comments

Comments
 (0)