From 1fe983dcdfa028f072cccfd9f8566bb437d7bb99 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 29 Aug 1996 19:53:37 +0000 Subject: [PATCH] * simops.c: Add logicals, mov, movhi, movea, add, addi, sub and subr. No condition codes yet. --- sim/v850/ChangeLog | 5 ++ sim/v850/simops.c | 182 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 147 insertions(+), 40 deletions(-) diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 22655509ce4..bfb99467b4b 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 29 13:53:29 1996 Jeffrey A Law (law@cygnus.com) + + * simops.c: Add logicals, mov, movhi, movea, add, addi, sub + and subr. No condition codes yet. + Wed Aug 28 13:53:22 1996 Jeffrey A Law (law@cygnus.com) * ChangeLog, Makefile.in, configure, configure.in, v850_sim.h, diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 0eb54d85d7d..f286e70faa9 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -2,11 +2,6 @@ #include "v850_sim.h" #include "simops.h" -void -OP_1A0 () -{ -} - void OP_280 () { @@ -32,11 +27,6 @@ OP_760 () { } -void -OP_6A0 () -{ -} - void OP_580 () { @@ -148,72 +138,100 @@ OP_660 () } void -OP_100 () +OP_E0 () { } void -OP_E0 () +OP_16087E0 () { } void -OP_16087E0 () +OP_16007E0 () { } +/* add reg, reg + + XXX condition codes. */ void -OP_16007E0 () +OP_1C0 () { + State.regs[OP[1]] += State.regs[OP[0]]; } +/* add sign_extend(imm5), reg + + XXX condition codes. */ void -OP_600 () +OP_240 () { + int value = OP[0]; + + value = (value << 27) >> 27; + + State.regs[OP[1]] += value; } +/* addi sign_extend(imm16), reg, reg + + XXX condition codes. */ void -OP_1C0 () +OP_600 () { + int value = OP[0]; + + value = (value << 16) >> 16; + + State.regs[OP[2]] = State.regs[OP[1]] + value; } +/* sub reg1, reg2 + + XXX condition codes */ void -OP_8007E0 () +OP_1A0 () { + State.regs[OP[1]] -= State.regs[OP[0]]; } +/* subr reg1, reg2 + + XXX condition codes */ void -OP_C007E0 () +OP_180 () { + State.regs[OP[1]] = State.regs[OP[0]] - State.regs[OP[1]]; } void -OP_12007E0 () +OP_8007E0 () { } void -OP_240 () +OP_C007E0 () { } void -OP_4007E0 () +OP_12007E0 () { } void -OP_10720 () +OP_4007E0 () { } void -OP_780 () +OP_10720 () { } void -OP_6C0 () +OP_780 () { } @@ -237,43 +255,58 @@ OP_87C0 () { } -void -OP_180 () -{ -} - void OP_300 () { } +/* mov reg, reg */ void OP_0 () { + State.regs[OP[1]] = State.regs[OP[0]]; } +/* mov sign_extend(imm5), reg */ void -OP_680 () +OP_200 () { + int value = OP[0]; + + value = (value << 27) >> 27; + State.regs[OP[1]] = value; } +/* movea sign_extend(imm16), reg, reg */ + void -OP_7C0 () +OP_620 () { + int value = OP[0]; + + value = (value << 16) >> 16; + + State.regs[OP[2]] = State.regs[OP[1]] + value; } +/* movhi imm16, reg, reg */ void -OP_120 () +OP_640 () { + int value = OP[0]; + + value = (value & 0xffff) << 16; + + State.regs[OP[2]] = State.regs[OP[1]] + value; } void -OP_1687E0 () +OP_7C0 () { } void -OP_620 () +OP_1687E0 () { } @@ -292,11 +325,6 @@ OP_260 () { } -void -OP_200 () -{ -} - void OP_6E0 () { @@ -317,9 +345,13 @@ OP_14007E0 () { } +/* not reg1, reg2 + + XXX condition codes */ void OP_20 () { + State.regs[OP[1]] = ~State.regs[OP[0]]; } void @@ -357,14 +389,70 @@ OP_7E0 () { } +/* or reg, reg + + XXX condition codes. */ +void +OP_100 () +{ + State.regs[OP[1]] |= State.regs[OP[0]]; +} + +/* ori zero_extend(imm16), reg, reg + + XXX condition codes */ +void +OP_680 () +{ + int value = OP[0]; + + value &= 0xffff; + + State.regs[OP[2]] = State.regs[OP[1]] | value; +} + +/* and reg, reg + + XXX condition codes. */ void OP_140 () { + State.regs[OP[1]] &= State.regs[OP[0]]; } +/* andi zero_extend(imm16), reg, reg + + XXX condition codes. */ void -OP_640 () +OP_6C0 () +{ + int value = OP[0]; + + value &= 0xffff; + + State.regs[OP[2]] = State.regs[OP[1]] & value; +} + +/* xor reg, reg + + XXX condition codes. */ +void +OP_120 () { + State.regs[OP[1]] ^= State.regs[OP[0]]; +} + +/* xori zero_extend(imm16), reg, reg + + XXX condition codes. */ +void +OP_6A0 () +{ + int value = OP[0]; + + value &= 0xffff; + + State.regs[OP[2]] = State.regs[OP[1]] ^ value; } void @@ -372,3 +460,17 @@ OP_C0 () { } +void +OP_480 () +{ +} + +void +OP_380 () +{ +} + +void +OP_501 () +{ +} -- 2.30.2