aboutsummaryrefslogtreecommitdiff
path: root/sim/m32r/sem.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>1998-02-12 02:54:20 +0000
committerDoug Evans <dje@google.com>1998-02-12 02:54:20 +0000
commite0bd6e186c1523ae7c8e9719d4b3bf84c590d76b (patch)
tree3f35c61b7692b4e2e51fb9e8a5eeff1681bce3a6 /sim/m32r/sem.c
parent42d56c40a2001a3b2fdcd8573d9c4326c49f8caf (diff)
downloadgdb-e0bd6e186c1523ae7c8e9719d4b3bf84c590d76b.zip
gdb-e0bd6e186c1523ae7c8e9719d4b3bf84c590d76b.tar.gz
gdb-e0bd6e186c1523ae7c8e9719d4b3bf84c590d76b.tar.bz2
* decode.c, decode.h, sem.c, sem-switch.c, model.c: Regenerate.
* cpux.c, decodex.c, decodex.h, readx.c, semx.c, modelx.c: Regenerate.
Diffstat (limited to 'sim/m32r/sem.c')
-rw-r--r--sim/m32r/sem.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/sim/m32r/sem.c b/sim/m32r/sem.c
index 3e5d4db..7ba6f3c 100644
--- a/sim/m32r/sem.c
+++ b/sim/m32r/sem.c
@@ -950,6 +950,32 @@ if (NESI (* FLD (f_r2), 0)) {
#undef FLD
}
+/* Perform divh: divh $dr,$sr. */
+CIA
+SEM_FN_NAME (m32r,divh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
+{
+#define FLD(f) abuf->fields.fmt_18_div.f
+ ARGBUF *abuf = SEM_ARGBUF (sem_arg);
+ CIA new_pc = SEM_NEXT_PC (sem_arg);
+
+if (NESI (* FLD (f_r2), 0)) {
+* FLD (f_r1) = DIVSI (EXTHISI (TRUNCSIHI (* FLD (f_r1))), * FLD (f_r2));
+ TRACE_RESULT (current_cpu, "dr", 'x', * FLD (f_r1));
+}
+
+#if WITH_PROFILE_MODEL_P
+ if (PROFILE_MODEL_P (current_cpu))
+ {
+ m32r_model_mark_get_h_gr (current_cpu, abuf);
+ m32r_model_mark_set_h_gr (current_cpu, abuf);
+ m32r_model_profile_insn (current_cpu, abuf);
+ }
+#endif
+
+ return new_pc;
+#undef FLD
+}
+
/* Perform jl: jl $sr. */
CIA
SEM_FN_NAME (m32r,jl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
@@ -960,7 +986,7 @@ SEM_FN_NAME (m32r,jl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
int taken_p = 0;
do {
- USI temp1;SI temp0;
+ SI temp1;SI temp0;
temp0 = ADDSI (ANDSI (CPU (h_pc), -4), 4);
temp1 = * FLD (f_r2);
CPU (h_gr[14]) = temp0;
@@ -1841,18 +1867,9 @@ SEM_FN_NAME (m32r,rac) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
do {
DI tmp_tmp1;
- tmp_tmp1 = ANDDI (CPU (h_accum), MAKEDI (16777215, 0xffffffff));
-if (ANDIFSI (GEDI (tmp_tmp1, MAKEDI (16383, 0xffff8000)), LEDI (tmp_tmp1, MAKEDI (8388607, 0xffffffff)))) {
- tmp_tmp1 = MAKEDI (16383, 0xffff8000);
-} else {
-if (ANDIFSI (GEDI (tmp_tmp1, MAKEDI (8388608, 0)), LEDI (tmp_tmp1, MAKEDI (16760832, 0)))) {
- tmp_tmp1 = MAKEDI (16760832, 0);
-} else {
- tmp_tmp1 = ANDDI (ADDDI (CPU (h_accum), MAKEDI (0, 16384)), MAKEDI (16777215, 0xffff8000));
-}
-}
- tmp_tmp1 = SLLDI (tmp_tmp1, 1);
- CPU (h_accum) = SRADI (SLLDI (tmp_tmp1, 7), 7);
+ tmp_tmp1 = SLLDI (CPU (h_accum), 1);
+ tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 32768));
+ CPU (h_accum) = (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0xffff0000)));
TRACE_RESULT (current_cpu, "accum", 'D', CPU (h_accum));
} while (0);
@@ -2496,10 +2513,7 @@ do_unlock (current_cpu, * FLD (f_r1), * FLD (f_r2));
#undef FLD
}
-/* FIXME: Add "no return" attribute to illegal insn handlers.
- They all call longjmp. */
-
-PCADDR
+CIA
SEM_FN_NAME (m32r,illegal) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
{
sim_engine_illegal_insn (current_cpu, NULL_CIA /*FIXME*/);