diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-10-19 02:47:02 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-10-19 02:47:02 +0000 |
commit | 917317f4c6550f3f3e0001d0a9e5a6acd6a2d1be (patch) | |
tree | 3ecc5a5d86fef50ae8715adacf956a2011797441 /sim | |
parent | 446a06c9b8819b20be7704f0b540471d76959c66 (diff) | |
download | gdb-917317f4c6550f3f3e0001d0a9e5a6acd6a2d1be.zip gdb-917317f4c6550f3f3e0001d0a9e5a6acd6a2d1be.tar.gz gdb-917317f4c6550f3f3e0001d0a9e5a6acd6a2d1be.tar.bz2 |
import gdb-1999-10-18 snapshot
Diffstat (limited to 'sim')
-rw-r--r-- | sim/common/ChangeLog | 16 | ||||
-rw-r--r-- | sim/common/cgen-accfp.c | 5 | ||||
-rw-r--r-- | sim/common/cgen-engine.h | 20 | ||||
-rw-r--r-- | sim/common/cgen-par.c | 28 | ||||
-rw-r--r-- | sim/common/cgen-par.h | 13 |
5 files changed, 63 insertions, 19 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 9cdbd7b..a1df5fe 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,19 @@ +1999-10-18 Dave Brolley <brolley@cygnus.com> + + * cgen-par.h (CGEN_MEM_DI_WRITE): New enumerator. + (CGEN_MEM_DF_WRITE): New enumerator. + (mem_di_write): New union member. + (mem_df_write): New union member. + * cgen-par.c (sim_queue_mem_di_write): New function. + (sim_queue_mem_df_write): New function. + (cgen_write_queue_element_execute): Handle CGEN_MEM_DI_WRITE and + CGEN_MEM_DF_WRITE. + * cgen-accfp.c (divsf): Check for division errors. + +1999-10-14 Doug Evans <devans@casey.cygnus.com> + + * cgen-engine.h (EXTRACT_INT,EXTRACT_UINT): Delete. + 1999-10-07 Dave Brolley <brolley@cygnus.com> * cgen-par.h (CGEN_FN_HI_WRITE): New enumerator. diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c index 9ce204f..0ef61fd 100644 --- a/sim/common/cgen-accfp.c +++ b/sim/common/cgen-accfp.c @@ -74,10 +74,13 @@ divsf (CGEN_FPU* fpu, SF x, SF y) sim_fpu op2; sim_fpu ans; unsigned32 res; + sim_fpu_status status; sim_fpu_32to (&op1, x); sim_fpu_32to (&op2, y); - sim_fpu_div (&ans, &op1, &op2); + status = sim_fpu_div (&ans, &op1, &op2); + if (status != 0) + (*fpu->ops->error) (fpu, status); sim_fpu_to32 (&res, &ans); return res; diff --git a/sim/common/cgen-engine.h b/sim/common/cgen-engine.h index d8bda1a..a0daf80 100644 --- a/sim/common/cgen-engine.h +++ b/sim/common/cgen-engine.h @@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* This file must be included after eng.h and before ${cpu}.h. */ +/* This file must be included after eng.h and before ${cpu}.h. + ??? A lot of this could be moved to genmloop.sh to be put in eng.h + and thus remove some conditional compilation. Worth it? */ /* Semantic functions come in six versions on two axes: fast/full-featured, and using one of the simple/scache/compilation engines. @@ -61,22 +63,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define EXTRACT_LSB0_UINT(val, total, start, length) \ (((UINT) (val) << ((sizeof (UINT) * 8) - (start) - 1)) \ >> ((sizeof (UINT) * 8) - (length))) - -#if CGEN_INSN_LSB0_P - -#define EXTRACT_INT(val, total, start, length) \ - EXTRACT_LSB0_INT ((val), (total), (start), (length)) -#define EXTRACT_UINT(val, total, start, length) \ - EXTRACT_LSB0_UINT ((val), (total), (start), (length)) - -#else - -#define EXTRACT_INT(val, total, start, length) \ - EXTRACT_MSB0_INT ((val), (total), (start), (length)) -#define EXTRACT_UINT(val, total, start, length) \ - EXTRACT_MSB0_UINT ((val), (total), (start), (length)) - -#endif /* Semantic routines. */ diff --git a/sim/common/cgen-par.c b/sim/common/cgen-par.c index 1919aea..d6450db 100644 --- a/sim/common/cgen-par.c +++ b/sim/common/cgen-par.c @@ -155,6 +155,24 @@ void sim_queue_mem_si_write (SIM_CPU *cpu, SI address, SI value) element->kinds.mem_si_write.value = value; } +void sim_queue_mem_di_write (SIM_CPU *cpu, SI address, DI value) +{ + CGEN_WRITE_QUEUE *q = CPU_WRITE_QUEUE (cpu); + CGEN_WRITE_QUEUE_ELEMENT *element = CGEN_WRITE_QUEUE_NEXT (q); + element->kind = CGEN_MEM_DI_WRITE; + element->kinds.mem_di_write.address = address; + element->kinds.mem_di_write.value = value; +} + +void sim_queue_mem_df_write (SIM_CPU *cpu, SI address, DF value) +{ + CGEN_WRITE_QUEUE *q = CPU_WRITE_QUEUE (cpu); + CGEN_WRITE_QUEUE_ELEMENT *element = CGEN_WRITE_QUEUE_NEXT (q); + element->kind = CGEN_MEM_DF_WRITE; + element->kinds.mem_df_write.address = address; + element->kinds.mem_df_write.value = value; +} + /* Execute a write stored on the write queue. */ void cgen_write_queue_element_execute (SIM_CPU *cpu, CGEN_WRITE_QUEUE_ELEMENT *item) @@ -212,6 +230,16 @@ cgen_write_queue_element_execute (SIM_CPU *cpu, CGEN_WRITE_QUEUE_ELEMENT *item) SETMEMSI (cpu, pc, item->kinds.mem_si_write.address, item->kinds.mem_si_write.value); break; + case CGEN_MEM_DI_WRITE: + pc = CPU_PC_GET (cpu); + SETMEMDI (cpu, pc, item->kinds.mem_di_write.address, + item->kinds.mem_di_write.value); + break; + case CGEN_MEM_DF_WRITE: + pc = CPU_PC_GET (cpu); + SETMEMDF (cpu, pc, item->kinds.mem_df_write.address, + item->kinds.mem_df_write.value); + break; default: break; /* FIXME: for now....print message later. */ } diff --git a/sim/common/cgen-par.h b/sim/common/cgen-par.h index f0edfa6..c786d1c 100644 --- a/sim/common/cgen-par.h +++ b/sim/common/cgen-par.h @@ -26,7 +26,8 @@ enum cgen_write_queue_kind { CGEN_BI_WRITE, CGEN_QI_WRITE, CGEN_SI_WRITE, CGEN_SF_WRITE, CGEN_PC_WRITE, CGEN_FN_HI_WRITE, CGEN_FN_SI_WRITE, CGEN_FN_DI_WRITE, CGEN_FN_DF_WRITE, - CGEN_MEM_QI_WRITE, CGEN_MEM_HI_WRITE, CGEN_MEM_SI_WRITE, + CGEN_MEM_QI_WRITE, CGEN_MEM_HI_WRITE, CGEN_MEM_SI_WRITE, CGEN_MEM_DI_WRITE, + CGEN_MEM_DF_WRITE, CGEN_NUM_WRITE_KINDS }; @@ -85,6 +86,14 @@ typedef struct { SI address; SI value; } mem_si_write; + struct { + SI address; + DI value; + } mem_di_write; + struct { + SI address; + DI value; + } mem_df_write; } kinds; } CGEN_WRITE_QUEUE_ELEMENT; @@ -131,5 +140,7 @@ extern void sim_queue_fn_df_write (SIM_CPU *, void (*)(SIM_CPU *, UINT, DI), UIN extern void sim_queue_mem_qi_write (SIM_CPU *, SI, QI); extern void sim_queue_mem_hi_write (SIM_CPU *, SI, HI); extern void sim_queue_mem_si_write (SIM_CPU *, SI, SI); +extern void sim_queue_mem_di_write (SIM_CPU *, SI, DI); +extern void sim_queue_mem_df_write (SIM_CPU *, SI, DF); #endif /* CGEN_PAR_H */ |