]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/arm/iwmmxt.c
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / sim / arm / iwmmxt.c
index b48f788b69335c83cb8641d9cb3d6558caaa84ee..acf0b62b5938c354769652745a7ced2f63e188fd 100644 (file)
@@ -1,5 +1,5 @@
 /*  iwmmxt.c -- Intel(r) Wireless MMX(tm) technology co-processor interface.
-    Copyright (C) 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
+    Copyright (C) 2002-2013 Free Software Foundation, Inc.
     Contributed by matthew green (mrg@redhat.com).
  
     This program is free software; you can redistribute it and/or modify
@@ -1743,11 +1743,12 @@ WCMPGT (ARMul_State * state, ARMword instr)
            {
              signed long a, b;
 
-             a = wRWORD (BITS (16, 19), i);
-             b = wRWORD (BITS (0, 3), i);
+             a = EXTEND32 (wRWORD (BITS (16, 19), i));
+             b = EXTEND32 (wRWORD (BITS (0, 3), i));
 
              s = (a > b) ? 0xffffffff : 0;
              r |= s << (i * 32);
+
              SIMD32_SET (psr, NBIT32 (s), SIMD_NBIT, i);
              SIMD32_SET (psr, ZBIT32 (s), SIMD_ZBIT, i);
            }
@@ -2127,13 +2128,15 @@ WMAC (ARMword instr)
         }
     }
 
-  if (BIT (20))
-    wR [BITS (12, 15)] = 0;
+  if (BIT (21))
+    t = EXTEND32 (t);
+  else
+    t &= 0xffffffff;
 
-  if (BIT (21))        /* Signed.  */
-    wR[BITS (12, 15)] += t;
+  if (BIT (20))
+    wR [BITS (12, 15)] = t;
   else
-    wR [BITS (12, 15)] += t;
+    wR[BITS (12, 15)] += t;
 
   wC [wCon] |= WCON_MUP;
 
@@ -2903,7 +2906,7 @@ WSRA (ARMul_State * state, ARMword instr)
            t = (wRWORD (BITS (16, 19), i) & 0x80000000) ? 0xffffffff : 0;
          else
            {
-             t = wRWORD (BITS (16, 19), i);
+             t = EXTEND32 (wRWORD (BITS (16, 19), i));
              t >>= shift;
            }
          s = t;