From 95d18eb74d629b32e817a629fbbf8421d3fbd690 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 10 Dec 1996 22:10:07 +0000 Subject: [PATCH] * simops.c (REG0_4): Define. Use REG0_4 for indexed loads/stores. Fixes bugs exposed after minor codegen improvements in the compiler. --- sim/mn10300/ChangeLog | 5 +++++ sim/mn10300/simops.c | 17 +++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 974e3127624..3f726c8a141 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 10 15:05:37 1996 Jeffrey A Law (law@cygnus.com) + + * simops.c (REG0_4): Define. + Use REG0_4 for indexed loads/stores. + Sat Dec 7 09:50:28 1996 Jeffrey A Law (law@cygnus.com) * simops.c (REG0_16): Fix typo. diff --git a/sim/mn10300/simops.c b/sim/mn10300/simops.c index 24bdfca26f1..02bf7b2ad5c 100644 --- a/sim/mn10300/simops.c +++ b/sim/mn10300/simops.c @@ -15,6 +15,7 @@ #define REG0(X) ((X) & 0x3) #define REG1(X) (((X) & 0xc) >> 2) +#define REG0_4(X) (((X) & 0x30) >> 4) #define REG0_8(X) (((X) & 0x300) >> 8) #define REG1_8(X) (((X) & 0xc00) >> 10) #define REG0_16(X) (((X) & 0x30000) >> 16) @@ -167,7 +168,7 @@ void OP_FCB40000 (insn, extension) void OP_F300 (insn, extension) unsigned long insn, extension; { - State.regs[REG_D0 + REG0_8 (insn)] + State.regs[REG_D0 + REG0_4 (insn)] = load_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 4); } @@ -250,7 +251,7 @@ void OP_FCB00000 (insn, extension) void OP_F380 (insn, extension) unsigned long insn, extension; { - State.regs[REG_A0 + REG0_8 (insn)] + State.regs[REG_A0 + REG0_4 (insn)] = load_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 4); } @@ -344,7 +345,7 @@ void OP_F340 (insn, extension) { store_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 4, - State.regs[REG_D0 + REG0_8 (insn)]); + State.regs[REG_D0 + REG0_4 (insn)]); } /* mov dm, (abs16) */ @@ -426,7 +427,7 @@ void OP_F3C0 (insn, extension) { store_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 4, - State.regs[REG_A0 + REG0_8 (insn)]); + State.regs[REG_A0 + REG0_4 (insn)]); } /* mov am, (abs16) */ @@ -554,7 +555,7 @@ void OP_FCB80000 (insn, extension) void OP_F400 (insn, extension) unsigned long insn, extension; { - State.regs[REG_D0 + REG0_8 (insn)] + State.regs[REG_D0 + REG0_4 (insn)] = load_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 1); } @@ -639,7 +640,7 @@ void OP_F440 (insn, extension) { store_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 1, - State.regs[REG_D0 + REG0_8 (insn)]); + State.regs[REG_D0 + REG0_4 (insn)]); } /* movbu dm, (abs16) */ @@ -719,7 +720,7 @@ void OP_FCBC0000 (insn, extension) void OP_F480 (insn, extension) unsigned long insn, extension; { - State.regs[REG_D0 + REG0_8 (insn)] + State.regs[REG_D0 + REG0_4 (insn)] = load_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 2); } @@ -804,7 +805,7 @@ void OP_F4C0 (insn, extension) { store_mem ((State.regs[REG_A0 + REG0 (insn)] + State.regs[REG_D0 + REG1 (insn)]), 2, - State.regs[REG_D0 + REG0_8 (insn)]); + State.regs[REG_D0 + REG0_4 (insn)]); } /* movhu dm, (abs16) */ -- 2.30.2