public static Int64Value Shr(Int64Value a, Int32Value b)
        {
            if (b.hasUnknownBits())
            {
                return(createUnknown());
            }
            if (b.value == 0)
            {
                return(a);
            }
            if (b.value < 0 || b.value >= sizeof(long) * 8)
            {
                return(createUnknown());
            }
            int   shift     = b.value;
            ulong validMask = a.validMask >> shift;

            if (a.isBitValid(sizeof(long) * 8 - 1))
            {
                validMask |= (ulong.MaxValue << (sizeof(long) * 8 - shift));
            }
            return(new Int64Value(a.value >> shift, validMask));
        }
Exemple #2
0
 public static Int64Value Shr(Int64Value a, Int32Value b)
 {
     if (b.hasUnknownBits())
         return createUnknown();
     if (b.value == 0)
         return a;
     if (b.value < 0 || b.value >= sizeof(long) * 8)
         return createUnknown();
     int shift = b.value;
     ulong validMask = a.validMask >> shift;
     if (a.isBitValid(sizeof(long) * 8 - 1))
         validMask |= (ulong.MaxValue << (sizeof(long) * 8 - shift));
     return new Int64Value(a.value >> shift, validMask);
 }