+2011-06-18  Robin Getz  <robin.getz@analog.com>
+
+       * bfin-sim.c (decode_dsp32shift_0): Clear ASTAT[AV] if val is 0,
+       else set it.  Set ASTAT[AVS] if val is 0.  Do this for LSHIFT and
+       ASHIFT accumulator insns.
+
 2011-06-18  Robin Getz  <robin.getz@analog.com>
 
        * bfin-sim.c (ashiftrt): If size is 40, do not call SET_ASTATREG.
 
 
       STORE (AXREG (HLs), (val >> 32) & 0xff);
       STORE (AWREG (HLs), (val & 0xffffffff));
+      STORE (ASTATREG (av[HLs]), val == 0);
+      if (val == 0)
+       STORE (ASTATREG (avs[HLs]), 1);
     }
   else if (sop == 1 && sopcde == 3 && (HLs == 0 || HLs == 1))
     {
 
       STORE (AXREG (HLs), (val >> 32) & 0xff);
       STORE (AWREG (HLs), (val & 0xffffffff));
+      STORE (ASTATREG (av[HLs]), val == 0);
+      if (val == 0)
+       STORE (ASTATREG (avs[HLs]), 1);
     }
   else if ((sop == 0 || sop == 1) && sopcde == 1)
     {