diff options
author | Nick Clifton <nickc@redhat.com> | 2003-12-11 11:33:44 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-12-11 11:33:44 +0000 |
commit | 16b47b253e65a3d447c57a0dc7a4d0490a3d6628 (patch) | |
tree | 70e5368bb1b0c30a9e9f3f1bf3c787f4f4b242b9 /sim/m32r/sem.c | |
parent | 8bfdb6721b9ed6da6f768f074fd1fd138e16e900 (diff) | |
download | gdb-16b47b253e65a3d447c57a0dc7a4d0490a3d6628.zip gdb-16b47b253e65a3d447c57a0dc7a4d0490a3d6628.tar.gz gdb-16b47b253e65a3d447c57a0dc7a4d0490a3d6628.tar.bz2 |
Add support for the m32r2 processor
Diffstat (limited to 'sim/m32r/sem.c')
-rw-r--r-- | sim/m32r/sem.c | 112 |
1 files changed, 111 insertions, 1 deletions
diff --git a/sim/m32r/sem.c b/sim/m32r/sem.c index 7360933..b06c9f0 100644 --- a/sim/m32r/sem.c +++ b/sim/m32r/sem.c @@ -2,7 +2,7 @@ THIS FILE IS MACHINE GENERATED WITH CGEN. -Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU simulators. @@ -2563,6 +2563,111 @@ if (CPU (h_lock)) { #undef FLD } +/* clrpsw: clrpsw $uimm8 */ + +static SEM_PC +SEM_FN_NAME (m32rbf,clrpsw) (SIM_CPU *current_cpu, SEM_ARG sem_arg) +{ +#define FLD(f) abuf->fields.sfmt_clrpsw.f + ARGBUF *abuf = SEM_ARGBUF (sem_arg); + int UNUSED written = 0; + IADDR UNUSED pc = abuf->addr; + SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); + + { + SI opval = ANDSI (GET_H_CR (((UINT) 0)), ORSI (INVBI (FLD (f_uimm8)), 65280)); + SET_H_CR (((UINT) 0), opval); + TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval); + } + + return vpc; +#undef FLD +} + +/* setpsw: setpsw $uimm8 */ + +static SEM_PC +SEM_FN_NAME (m32rbf,setpsw) (SIM_CPU *current_cpu, SEM_ARG sem_arg) +{ +#define FLD(f) abuf->fields.sfmt_clrpsw.f + ARGBUF *abuf = SEM_ARGBUF (sem_arg); + int UNUSED written = 0; + IADDR UNUSED pc = abuf->addr; + SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); + + { + SI opval = FLD (f_uimm8); + SET_H_CR (((UINT) 0), opval); + TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval); + } + + return vpc; +#undef FLD +} + +/* bset: bset $uimm3,@($slo16,$sr) */ + +static SEM_PC +SEM_FN_NAME (m32rbf,bset) (SIM_CPU *current_cpu, SEM_ARG sem_arg) +{ +#define FLD(f) abuf->fields.sfmt_bset.f + ARGBUF *abuf = SEM_ARGBUF (sem_arg); + int UNUSED written = 0; + IADDR UNUSED pc = abuf->addr; + SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); + + { + QI opval = ORQI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))), SLLSI (1, SUBSI (7, FLD (f_uimm3)))); + SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)), opval); + TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); + } + + return vpc; +#undef FLD +} + +/* bclr: bclr $uimm3,@($slo16,$sr) */ + +static SEM_PC +SEM_FN_NAME (m32rbf,bclr) (SIM_CPU *current_cpu, SEM_ARG sem_arg) +{ +#define FLD(f) abuf->fields.sfmt_bset.f + ARGBUF *abuf = SEM_ARGBUF (sem_arg); + int UNUSED written = 0; + IADDR UNUSED pc = abuf->addr; + SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4); + + { + QI opval = ANDQI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))), INVQI (SLLSI (1, SUBSI (7, FLD (f_uimm3))))); + SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)), opval); + TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval); + } + + return vpc; +#undef FLD +} + +/* btst: btst $uimm3,$sr */ + +static SEM_PC +SEM_FN_NAME (m32rbf,btst) (SIM_CPU *current_cpu, SEM_ARG sem_arg) +{ +#define FLD(f) abuf->fields.sfmt_bset.f + ARGBUF *abuf = SEM_ARGBUF (sem_arg); + int UNUSED written = 0; + IADDR UNUSED pc = abuf->addr; + SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2); + + { + BI opval = ANDQI (SRLSI (* FLD (i_sr), SUBSI (7, FLD (f_uimm3))), 1); + CPU (h_cond) = opval; + TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval); + } + + return vpc; +#undef FLD +} + /* Table of all semantic fns. */ static const struct sem_fn_desc sem_fns[] = { @@ -2671,6 +2776,11 @@ static const struct sem_fn_desc sem_fns[] = { { M32RBF_INSN_SUBX, SEM_FN_NAME (m32rbf,subx) }, { M32RBF_INSN_TRAP, SEM_FN_NAME (m32rbf,trap) }, { M32RBF_INSN_UNLOCK, SEM_FN_NAME (m32rbf,unlock) }, + { M32RBF_INSN_CLRPSW, SEM_FN_NAME (m32rbf,clrpsw) }, + { M32RBF_INSN_SETPSW, SEM_FN_NAME (m32rbf,setpsw) }, + { M32RBF_INSN_BSET, SEM_FN_NAME (m32rbf,bset) }, + { M32RBF_INSN_BCLR, SEM_FN_NAME (m32rbf,bclr) }, + { M32RBF_INSN_BTST, SEM_FN_NAME (m32rbf,btst) }, { 0, 0 } }; |