Example #1
0
        public void Barrel_ASR()
        {
            uint x = 0xe0000000;
            int  y = (int)~x;

            y = ~y;
            Assert.IsTrue(BarrelShifter.ShiftByCode(y, 3, (char)1) == x >> 3);
        }
Example #2
0
        public void Barrel_ROR()
        {
            int x = 0x0e000010;

            Assert.IsTrue(BarrelShifter.ShiftByCode(x, 12, (char)3) == 0x0100e000);
        }
Example #3
0
 public void Barrel_LSR()
 {
     Assert.IsTrue(BarrelShifter.ShiftByCode(2, 3, (char)2) == 2 >> 3);
 }
Example #4
0
 public void Barrel_LSL()
 {
     Assert.IsTrue(BarrelShifter.ShiftByCode(2, 3, (char)0) == 2 << 3);
 }