aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/riscv/vector_helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index 39f44d1..793af99 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -151,8 +151,8 @@ static void vext_clear(void *tail, uint32_t cnt, uint32_t tot)
if (cnt % 8) {
part1 = 8 - (cnt % 8);
part2 = tot - cnt - part1;
- memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
- memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
+ memset(QEMU_ALIGN_PTR_DOWN(tail, 8), 0, part1);
+ memset(QEMU_ALIGN_PTR_UP(tail, 8), 0, part2);
} else {
memset(tail, 0, part2);
}