本文整理汇总了C#中de4dot.blocks.cflow.Int32Value.allBitsValid方法的典型用法代码示例。如果您正苦于以下问题:C# Int32Value.allBitsValid方法的具体用法?C# Int32Value.allBitsValid怎么用?C# Int32Value.allBitsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de4dot.blocks.cflow.Int32Value
的用法示例。
在下文中一共展示了Int32Value.allBitsValid方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public static Int32Value Add(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return new Int32Value(a.value + b.value);
if (ReferenceEquals(a, b))
return new Int32Value(a.value << 1, (a.validMask << 1) | 1);
return createUnknown();
}
示例2: getSwitchTarget
public static Block getSwitchTarget(IList<Block> targets, Block fallThrough, Int32Value intValue)
{
if (!intValue.allBitsValid())
return null;
int index = intValue.value;
if (targets == null || index < 0 || index >= targets.Count)
return fallThrough;
else
return targets[index];
}
示例3:
bool IBranchHandler.handleSwitch(Int32Value switchIndex)
{
if (!switchIndex.allBitsValid())
return false;
var instr = instructions[emulateIndex];
var targets = (Instruction[])instr.Operand;
if (switchIndex.value >= 0 && switchIndex.value < targets.Length)
emulateIndex = instructions.IndexOf(targets[switchIndex.value]);
else
emulateIndex++;
return true;
}
示例4: Sub
public static Int32Value Sub(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return new Int32Value(a.value - b.value);
if (ReferenceEquals(a, b))
return zero;
return createUnknown();
}
示例5: Rem_Un
public static Int32Value Rem_Un(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid()) {
try {
return new Int32Value((int)((uint)a.value % (uint)b.value));
}
catch (ArithmeticException) {
return createUnknown();
}
}
if ((ReferenceEquals(a, b) && a.isNonZero()) || b.hasValue(1))
return zero;
return createUnknown();
}
示例6: Neg
public static Int32Value Neg(Int32Value a)
{
if (a.allBitsValid())
return new Int32Value(-a.value);
return createUnknown();
}
示例7: Mul
public static Int32Value Mul(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return new Int32Value(a.value * b.value);
if (a.isZero() || b.isZero())
return zero;
if (a.hasValue(1))
return b;
if (b.hasValue(1))
return a;
return createUnknown();
}
示例8: Div
public static Int32Value Div(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid()) {
try {
return new Int32Value(a.value / b.value);
}
catch (ArithmeticException) {
return createUnknown();
}
}
if (ReferenceEquals(a, b) && a.isNonZero())
return one;
if (b.hasValue(1))
return a;
return createUnknown();
}
示例9: compareTrue
public static Bool3 compareTrue(Int32Value a)
{
if (a.allBitsValid())
return a.value != 0 ? Bool3.True : Bool3.False;
if ((a.value & a.validMask) != 0)
return Bool3.True;
return Bool3.Unknown;
}
示例10: compareNeq
public static Bool3 compareNeq(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return a.value != b.value ? Bool3.True : Bool3.False;
if (ReferenceEquals(a, b))
return Bool3.False;
if ((a.value & a.validMask & b.validMask) != (b.value & a.validMask & b.validMask))
return Bool3.True;
return Bool3.Unknown;
}
示例11: compareLt_Un
public static Bool3 compareLt_Un(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return (uint)a.value < (uint)b.value ? Bool3.True : Bool3.False;
if (a.hasValue(uint.MaxValue))
return Bool3.False; // max < x => false
if (b.hasValue(uint.MinValue))
return Bool3.False; // x < min => false
return Bool3.Unknown;
}
示例12: compareLe_Un
public static Bool3 compareLe_Un(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return (uint)a.value <= (uint)b.value ? Bool3.True : Bool3.False;
if (a.hasValue(uint.MinValue))
return Bool3.True; // min <= x => true
if (b.hasValue(uint.MaxValue))
return Bool3.True; // x <= max => true
return Bool3.Unknown;
}
示例13: compareGt
public static Bool3 compareGt(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return a.value > b.value ? Bool3.True : Bool3.False;
if (a.hasValue(int.MinValue))
return Bool3.False; // min > x => false
if (b.hasValue(int.MaxValue))
return Bool3.False; // x > max => false
return Bool3.Unknown;
}
示例14: compareGe
public static Bool3 compareGe(Int32Value a, Int32Value b)
{
if (a.allBitsValid() && b.allBitsValid())
return a.value >= b.value ? Bool3.True : Bool3.False;
if (a.hasValue(int.MaxValue))
return Bool3.True; // max >= x => true
if (b.hasValue(int.MinValue))
return Bool3.True; // x >= min => true
return Bool3.Unknown;
}