Compute write back value for post increment loads before
authorNick Clifton <nickc@redhat.com>
Tue, 15 Aug 2000 00:10:52 +0000 (00:10 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 15 Aug 2000 00:10:52 +0000 (00:10 +0000)
performing the load in case the offset register is overwritten.

sim/arm/ChangeLog
sim/arm/armemu.c

index 6dc8bd5021a5dbc09dec75bb897d21e3842a1923..2f1d531f05ef2b13f56257201ede7834b410ecc2 100644 (file)
@@ -1,3 +1,9 @@
+2000-08-14  Nick Clifton  <nickc@redhat.com>
+
+       * armemu.c (LHPOSTDOWN): Compute write back value before
+       performing load in case the offset register is overwritten.
+       (LHPOSTUP): Ditto.
+
 2000-07-14  Fernando Nasser <fnasser@cygnus.com>
 
        * wrapper.c (sim_create_inferior): Fix typo in the previous patch.
index 7152023d25b752f2c46eb7bc1bc722451c5c8c53..9d3dcba60d435113413cec0dd5350fb75f963795 100644 (file)
@@ -106,60 +106,67 @@ extern int stop_simulator;
   if (StoreHalfWord(state, instr, temp))                \
      LSBase = temp ;
 
-/* load post decrement writeback */
+/* Load post decrement writeback.  */
 #define LHPOSTDOWN()                                    \
 {                                                       \
-  int done = 1 ;                                        \
-  lhs = LHS ;                                           \
-  switch (BITS(5,6)) {                                  \
+  int done = 1;                                                \
+  lhs = LHS;                                           \
+  temp = lhs - GetLS7RHS (state, instr);               \
+                                                       \
+  switch (BITS (5, 6))                                 \
+    {                                                          \
     case 1: /* H */                                     \
-      if (LoadHalfWord(state,instr,lhs,LUNSIGNED))      \
-         LSBase = lhs - GetLS7RHS(state,instr) ;        \
-      break ;                                           \
+      if (LoadHalfWord (state, instr, lhs, LUNSIGNED))  \
+         LSBase = temp;                                        \
+      break;                                                   \
     case 2: /* SB */                                    \
-      if (LoadByte(state,instr,lhs,LSIGNED))            \
-         LSBase = lhs - GetLS7RHS(state,instr) ;        \
-      break ;                                           \
+      if (LoadByte (state, instr, lhs, LSIGNED))        \
+         LSBase = temp;                                        \
+      break;                                                   \
     case 3: /* SH */                                    \
-      if (LoadHalfWord(state,instr,lhs,LSIGNED))        \
-         LSBase = lhs - GetLS7RHS(state,instr) ;        \
-      break ;                                           \
-    case 0: /* SWP handled elsewhere */                 \
+      if (LoadHalfWord (state, instr, lhs, LSIGNED))    \
+         LSBase = temp;                                        \
+      break;                                                   \
+    case 0: /* SWP handled elsewhere.  */               \
     default:                                            \
-      done = 0 ;                                        \
-      break ;                                           \
+      done = 0;                                                \
+      break;                                                   \
     }                                                   \
   if (done)                                             \
-     break ;                                            \
+     break;                                                    \
 }
 
-/* load post increment writeback */
+/* Load post increment writeback.  */
 #define LHPOSTUP()                                      \
 {                                                       \
-  int done = 1 ;                                        \
-  lhs = LHS ;                                           \
-  switch (BITS(5,6)) {                                  \
+  int done = 1;                                                \
+  lhs = LHS;                                                   \
+  temp = lhs + GetLS7RHS (state, instr);               \
+                                                       \
+  switch (BITS (5, 6))                                 \
+    {                                                          \
     case 1: /* H */                                     \
-      if (LoadHalfWord(state,instr,lhs,LUNSIGNED))      \
-         LSBase = lhs + GetLS7RHS(state,instr) ;        \
-      break ;                                           \
+      if (LoadHalfWord (state, instr, lhs, LUNSIGNED))  \
+         LSBase = temp;                                        \
+      break;                                                   \
     case 2: /* SB */                                    \
-      if (LoadByte(state,instr,lhs,LSIGNED))            \
-         LSBase = lhs + GetLS7RHS(state,instr) ;        \
-      break ;                                           \
+      if (LoadByte (state, instr, lhs, LSIGNED))        \
+         LSBase = temp;                                        \
+      break;                                                   \
     case 3: /* SH */                                    \
-      if (LoadHalfWord(state,instr,lhs,LSIGNED))        \
-         LSBase = lhs + GetLS7RHS(state,instr) ;        \
-      break ;                                           \
-    case 0: /* SWP handled elsewhere */                 \
+      if (LoadHalfWord (state, instr, lhs, LSIGNED))    \
+         LSBase = temp;                                        \
+      break;                                                   \
+    case 0: /* SWP handled elsewhere.  */               \
     default:                                            \
-      done = 0 ;                                        \
-      break ;                                           \
+      done = 0;                                                \
+      break;                                                   \
     }                                                   \
   if (done)                                             \
-     break ;                                            \
+     break;                                                    \
 }
 
+
 /* load pre decrement */
 #define LHPREDOWN()                                     \
 {                                                       \