aboutsummaryrefslogtreecommitdiff
path: root/sim/mcore
diff options
context:
space:
mode:
Diffstat (limited to 'sim/mcore')
-rw-r--r--sim/mcore/interp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index 53cfdad..48d9ff8 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -641,8 +641,8 @@ step_once (SIM_DESC sd, SIM_CPU *cpu)
{
long tmp;
tmp = gr[RD];
- tmp <<= 24;
- tmp >>= 24;
+ tmp <<= (sizeof (tmp) * 8) - 8;
+ tmp >>= (sizeof (tmp) * 8) - 8;
gr[RD] = tmp;
}
break;
@@ -653,8 +653,8 @@ step_once (SIM_DESC sd, SIM_CPU *cpu)
{
long tmp;
tmp = gr[RD];
- tmp <<= 16;
- tmp >>= 16;
+ tmp <<= (sizeof (tmp) * 8) - 16;
+ tmp >>= (sizeof (tmp) * 8) - 16;
gr[RD] = tmp;
}
break;