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)); }
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); }