当前位置: 首页>>代码示例>>C#>>正文


C# Int32Value.AllBitsValid方法代码示例

本文整理汇总了C#中de4dot.blocks.cflow.Int32Value.AllBitsValid方法的典型用法代码示例。如果您正苦于以下问题:C# Int32Value.AllBitsValid方法的具体用法?C# Int32Value.AllBitsValid怎么用?C# Int32Value.AllBitsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de4dot.blocks.cflow.Int32Value的用法示例。


在下文中一共展示了Int32Value.AllBitsValid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
 }
开发者ID:kakkerlakgly,项目名称:de4dot,代码行数:8,代码来源:Int32Value.cs

示例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];
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:10,代码来源:CflowUtils.cs

示例3: Add_Ovf

 public static Int32Value Add_Ovf(Int32Value a, Int32Value b)
 {
     if (a.AllBitsValid() && b.AllBitsValid()) {
         try {
             return new Int32Value(checked(a.Value + b.Value));
         }
         catch (OverflowException) {
         }
     }
     return CreateUnknown();
 }
开发者ID:kakkerlakgly,项目名称:de4dot,代码行数:11,代码来源:Int32Value.cs

示例4:

		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;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:11,代码来源:BabelMethodCallInliner.cs

示例5: Add_Ovf_Un

 public static Int32Value Add_Ovf_Un(Int32Value a, Int32Value b)
 {
     if (a.AllBitsValid() && b.AllBitsValid()) {
         uint aa = (uint)a.Value, bb = (uint)b.Value;
         try {
             return new Int32Value((int)checked(aa + bb));
         }
         catch (OverflowException) {
         }
     }
     return CreateUnknown();
 }
开发者ID:kakkerlakgly,项目名称:de4dot,代码行数:12,代码来源:Int32Value.cs

示例6: 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;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:9,代码来源:Int32Value.cs

示例7: 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;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:9,代码来源:Int32Value.cs

示例8: 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;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:9,代码来源:Int32Value.cs

示例9: 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 (((uint)a.Value & a.ValidMask & b.ValidMask) != ((uint)b.Value & a.ValidMask & b.ValidMask))
				return Bool3.True;
			return Bool3.Unknown;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:9,代码来源:Int32Value.cs

示例10: Neg

		public static Int32Value Neg(Int32Value a) {
			if (a.AllBitsValid())
				return new Int32Value(-a.Value);
			return CreateUnknown();
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:5,代码来源:Int32Value.cs

示例11: 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();
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:13,代码来源:Int32Value.cs

示例12: 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();
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:11,代码来源:Int32Value.cs

示例13: 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();
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:7,代码来源:Int32Value.cs

示例14: Conv_R8

		public static Real8Value Conv_R8(Int32Value a) {
			if (a.AllBitsValid())
				return new Real8Value((double)(int)a.Value);
			return Real8Value.CreateUnknown();
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:5,代码来源:Int32Value.cs

示例15: Conv_R_Un

		public static Real8Value Conv_R_Un(Int32Value a) {
			if (a.AllBitsValid())
				return new Real8Value((float)(uint)a.Value);
			return Real8Value.CreateUnknown();
		}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:5,代码来源:Int32Value.cs


注:本文中的de4dot.blocks.cflow.Int32Value.AllBitsValid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。