From 6ea4a6c875a2c0902fc19d560ef33228daa88603 Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Wed, 11 Jul 2007 16:43:30 +0000 Subject: More alignment checks git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3060 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/op.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'target-sparc/op.c') diff --git a/target-sparc/op.c b/target-sparc/op.c index 4ab0667797..f1f6ccefc5 100644 --- a/target-sparc/op.c +++ b/target-sparc/op.c @@ -1518,10 +1518,7 @@ void OPPROTO op_movl_npc_im(void) void OPPROTO op_movl_npc_T0(void) { - if (T0 & 0x3) - raise_exception(TT_UNALIGNED); - else - env->npc = T0; + env->npc = T0; } void OPPROTO op_mov_pc_npc(void) @@ -2368,3 +2365,15 @@ VIS_CMPOP(op_fcmple, FCMPLE) VIS_CMPOP(op_fcmpne, FCMPNE) #endif + +#define CHECK_ALIGN_OP(align) \ + void OPPROTO op_check_align_T0_ ## align (void) \ + { \ + if (T0 & align) \ + raise_exception(TT_UNALIGNED); \ + FORCE_RET(); \ + } + +CHECK_ALIGN_OP(1) +CHECK_ALIGN_OP(3) +CHECK_ALIGN_OP(7) -- cgit v1.2.3