public override void Execute() { // Fetch operands List <byte[]> DestSource = Fetch(); // AND the operands and discard the result FlagSet ResultFlags = Bitwise.And(DestSource[0], DestSource[1], out _); // Set the flags to the result. ControlUnit.SetFlags(ResultFlags); }
public override void Execute() { // Fetch operands List <byte[]> DestSource = Fetch(); // Perform AND. The position of the two arguments is not important. byte[] Result; FlagSet ResultFlags = Bitwise.And(DestSource[0], DestSource[1], out Result); // Set results Set(Result); ControlUnit.SetFlags(ResultFlags); }
internal static void ConditionalArrayPartialFoldingKernel( Index1D index, ArrayView <int> buffer, int constant) { int[] values = new[] { 0, 1 }; if (Bitwise.And(index == values[1], constant == values[0])) { buffer[index] = 42; } else { buffer[index] = 24; } }
internal static void IsPredicateF32Kernel( Index1D index, ArrayView1D <int, Stride1D.Dense> data, float value) { #if NETFRAMEWORK data[index + 0] = Bitwise.And(!float.IsNaN(value), !float.IsInfinity(value)) ? 1 : 0; #else data[index + 0] = float.IsFinite(value) ? 1 : 0; #endif data[index + 1] = float.IsInfinity(value) ? 1 : 0; data[index + 2] = float.IsPositiveInfinity(value) ? 1 : 0; data[index + 3] = float.IsNegativeInfinity(value) ? 1 : 0; data[index + 4] = float.IsNaN(value) ? 1 : 0; }
public static bool IsFinite(Half half) => Bitwise.And(!IsNaN(half), !IsInfinity(half));
public static void AssertIntIndexRange(long range) => Trace.Assert( Bitwise.And(range >= int.MinValue, range <= int.MaxValue), "32-bit index out of range");
public static void AssertIntIndex(long index) => Trace.Assert( Bitwise.And(index >= int.MinValue, index <= int.MaxValue), "32-bit index expected");