Пример #1
0
 public static Real8Value Conv_R8(Int64Value a)
 {
     if (a.AllBitsValid())
     {
         return(new Real8Value((double)(long)a.Value));
     }
     return(Real8Value.CreateUnknown());
 }
Пример #2
0
 public static Int32Value Conv_U2(Real8Value a)
 {
     if (!a.IsValid)
     {
         return(CreateUnknownUInt16());
     }
     return(new Int32Value((int)(ushort)a.Value));
 }
Пример #3
0
 public static Real8Value Conv_R_Un(Int64Value a)
 {
     if (a.AllBitsValid())
     {
         return(new Real8Value((float)(ulong)a.Value));
     }
     return(Real8Value.CreateUnknown());
 }
Пример #4
0
 public static Real8Value Conv_R4(Int32Value a)
 {
     if (a.AllBitsValid())
     {
         return(new Real8Value((double)(int)a.Value));
     }
     return(Real8Value.CreateUnknown());
 }
Пример #5
0
 public static Int32Value Conv_I4(Real8Value a)
 {
     if (!a.IsValid)
     {
         return(CreateUnknown());
     }
     return(new Int32Value((int)a.Value));
 }
Пример #6
0
 public static Int64Value Conv_U8(Real8Value a)
 {
     if (!a.IsValid)
     {
         return(CreateUnknown());
     }
     return(new Int64Value((long)(ulong)a.Value));
 }
Пример #7
0
 public static Int32Value Conv_U1(Real8Value a)
 {
     if (!a.IsValid)
     {
         return(CreateUnknownUInt8());
     }
     return(new Int32Value((int)(byte)a.Value));
 }
Пример #8
0
        void emulate_Neg(Instruction instr)
        {
            var val1 = valueStack.pop();

            if (val1.isInt32())
            {
                valueStack.push(Int32Value.Neg((Int32Value)val1));
            }
            else if (val1.isInt64())
            {
                valueStack.push(Int64Value.Neg((Int64Value)val1));
            }
            else if (val1.isReal8())
            {
                valueStack.push(Real8Value.Neg((Real8Value)val1));
            }
            else
            {
                valueStack.pushUnknown();
            }
        }
Пример #9
0
        void emulate_Rem(Instruction instr)
        {
            var val2 = valueStack.pop();
            var val1 = valueStack.pop();

            if (val1.isInt32() && val2.isInt32())
            {
                valueStack.push(Int32Value.Rem((Int32Value)val1, (Int32Value)val2));
            }
            else if (val1.isInt64() && val2.isInt64())
            {
                valueStack.push(Int64Value.Rem((Int64Value)val1, (Int64Value)val2));
            }
            else if (val1.isReal8() && val2.isReal8())
            {
                valueStack.push(Real8Value.Rem((Real8Value)val1, (Real8Value)val2));
            }
            else
            {
                valueStack.pushUnknown();
            }
        }
Пример #10
0
        bool Emulate_Blt_Un()
        {
            var val2 = instructionEmulator.Pop();
            var val1 = instructionEmulator.Pop();

            if (val1.IsInt32() && val2.IsInt32())
            {
                return(EmulateBranch(2, Int32Value.CompareLt_Un((Int32Value)val1, (Int32Value)val2)));
            }
            else if (val1.IsInt64() && val2.IsInt64())
            {
                return(EmulateBranch(2, Int64Value.CompareLt_Un((Int64Value)val1, (Int64Value)val2)));
            }
            else if (val1.IsReal8() && val2.IsReal8())
            {
                return(EmulateBranch(2, Real8Value.CompareLt_Un((Real8Value)val1, (Real8Value)val2)));
            }
            else
            {
                return(false);
            }
        }
Пример #11
0
 public static Int32Value Conv_U2(Real8Value a)
 {
     return(new Int32Value((int)(ushort)a.value));
 }
Пример #12
0
 public static Int32Value Conv_U1(Real8Value a)
 {
     return(new Int32Value((int)(byte)a.value));
 }
Пример #13
0
 public static Int64Value Conv_I8(Real8Value a)
 {
     return(new Int64Value((long)a.value));
 }
Пример #14
0
 public static Bool3 CompareFalse(Real8Value a) => Bool3.Unknown;
Пример #15
0
 public static Bool3 CompareLt_Un(Real8Value a, Real8Value b) => Bool3.Unknown;        //TODO:
Пример #16
0
 public static Real8Value Mul_Ovf_Un(Real8Value a, Real8Value b) => CreateUnknown();
Пример #17
0
 public static Int32Value Conv_U4(Real8Value a)
 {
     return new Int32Value((int)(uint)a.value);
 }
Пример #18
0
		public static Int32Value Conv_I1(Real8Value a) {
			if (!a.IsValid)
				return CreateUnknown();
			return new Int32Value((int)(sbyte)a.Value);
		}
Пример #19
0
 public static Int32Value Conv_I2(Real8Value a)
 {
     return new Int32Value((int)(short)a.value);
 }
Пример #20
0
 public static Int64Value Conv_Ovf_U8_Un(Real8Value a) => Int64Value.CreateUnknown();
Пример #21
0
 public static Int32Value Conv_Ovf_U4(Real8Value a) => Int32Value.CreateUnknown();
Пример #22
0
 public static Int32Value Conv_Ovf_U2_Un(Real8Value a) => Int32Value.CreateUnknownUInt16();
Пример #23
0
 public static Int32Value Conv_I4(Real8Value a)
 {
     return(new Int32Value((int)a.value));
 }
Пример #24
0
		public static Int32Value Conv_U2(Real8Value a) {
			if (!a.IsValid)
				return CreateUnknownUInt16();
			return new Int32Value((int)(ushort)a.Value);
		}
Пример #25
0
		public static Int64Value Conv_U8(Real8Value a) {
			if (!a.IsValid)
				return CreateUnknown();
			return new Int64Value((long)(ulong)a.Value);
		}
Пример #26
0
		public static Real8Value Conv_R8(Int32Value a) {
			if (a.AllBitsValid())
				return new Real8Value((double)(int)a.Value);
			return Real8Value.CreateUnknown();
		}
Пример #27
0
 public static Real8Value Conv_R_Un(Real8Value a) => CreateUnknown();
Пример #28
0
 public static Real8Value Sub_Ovf(Real8Value a, Real8Value b) => CreateUnknown();
Пример #29
0
 public static Int64Value Conv_U8(Real8Value a)
 {
     return new Int64Value((long)(ulong)a.value);
 }
Пример #30
0
 public static Real8Value Conv_R8(Real8Value a) => a;
Пример #31
0
 public static Int32Value Conv_U1(Real8Value a)
 {
     return new Int32Value((int)(byte)a.value);
 }
Пример #32
0
 public static Int32Value Ceq(Real8Value a, Real8Value b) => Int32Value.Create(CompareEq(a, b));
Пример #33
0
		public static Int32Value Conv_U1(Real8Value a) {
			if (!a.IsValid)
				return CreateUnknownUInt8();
			return new Int32Value((int)(byte)a.Value);
		}
Пример #34
0
 public static Int32Value Cgt(Real8Value a, Real8Value b) => Int32Value.Create(CompareGt(a, b));
Пример #35
0
		public static Int32Value Conv_I4(Real8Value a) {
			if (!a.IsValid)
				return CreateUnknown();
			return new Int32Value((int)a.Value);
		}
Пример #36
0
 public static Int32Value Clt_Un(Real8Value a, Real8Value b) => Int32Value.Create(CompareLt_Un(a, b));