diff options
author | Dave Brolley <brolley@redhat.com> | 2003-09-09 22:28:33 +0000 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2003-09-09 22:28:33 +0000 |
commit | f9e18f5a11abe959220c570da56b09cc0fd6fd62 (patch) | |
tree | b70b0ca7aa0aefe7a627f94e32da9e98ae25ae69 /sim | |
parent | 964869950a2bed7d939a629f9e6cda4bc66011f0 (diff) | |
download | gdb-f9e18f5a11abe959220c570da56b09cc0fd6fd62.zip gdb-f9e18f5a11abe959220c570da56b09cc0fd6fd62.tar.gz gdb-f9e18f5a11abe959220c570da56b09cc0fd6fd62.tar.bz2 |
2003-09-09 Dave Brolley <brolley@redhat.com>
* frv.c (do_media_average): Select machine using a switch.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/frv/ChangeLog | 4 | ||||
-rw-r--r-- | sim/frv/frv.c | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog index 91f636a..34d685c 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,7 @@ +2003-09-09 Dave Brolley <brolley@redhat.com> + + * frv.c (do_media_average): Select machine using a switch. + 2003-09-08 Dave Brolley <brolley@redhat.com> On behalf of Doug Evans <dje@sebabeach.org> diff --git a/sim/frv/frv.c b/sim/frv/frv.c index a13af6b..bd3220d 100644 --- a/sim/frv/frv.c +++ b/sim/frv/frv.c @@ -1,5 +1,5 @@ /* frv simulator support code - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by Red Hat. This file is part of the GNU simulators. @@ -1049,14 +1049,17 @@ do_media_average (SIM_CPU *current_cpu, HI arg1, HI arg2) SIM_DESC sd = CPU_STATE (current_cpu); SI sum = (arg1 + arg2); HI result = sum >> 1; + int rounding_value; /* On fr400, check the rounding mode. On other machines rounding is always toward negative infinity and the result is already correctly rounded. */ - if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_fr400) + switch (STATE_ARCHITECTURE (sd)->mach) { + /* Need to check rounding mode. */ + case bfd_mach_fr400: /* Check whether rounding will be required. Rounding will be required if the sum is an odd number. */ - int rounding_value = sum & 1; + rounding_value = sum & 1; if (rounding_value) { USI msr0 = GET_MSR (0); @@ -1098,6 +1101,9 @@ do_media_average (SIM_CPU *current_cpu, HI arg1, HI arg2) ++result; } } + break; + default: + break; } return result; |