From 3aa80988430f41847e1b78d165440ac03503b6d0 Mon Sep 17 00:00:00 2001 From: "Edgar E. Iglesias" Date: Thu, 3 Sep 2009 22:28:21 +0200 Subject: microblaze: Compute masks for alignment checks at translation time. Thanks to Blue Swirl for reporting. Signed-off-by: Edgar E. Iglesias --- target-microblaze/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'target-microblaze/translate.c') diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 3c6916013..b180d24b0 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -814,7 +814,7 @@ static void dec_load(DisasContext *dc) /* Verify alignment if needed. */ if ((dc->env->pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { gen_helper_memalign(*addr, tcg_const_tl(dc->rd), - tcg_const_tl(0), tcg_const_tl(size)); + tcg_const_tl(0), tcg_const_tl(size - 1)); } if (dc->rd) { @@ -858,7 +858,7 @@ static void dec_store(DisasContext *dc) /* Verify alignment if needed. */ if ((dc->env->pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { gen_helper_memalign(*addr, tcg_const_tl(dc->rd), - tcg_const_tl(1), tcg_const_tl(size)); + tcg_const_tl(1), tcg_const_tl(size - 1)); } gen_store(dc, *addr, cpu_R[dc->rd], size); -- cgit v1.2.3