public static Real8Value Conv_R8(Int64Value a) { if (a.AllBitsValid()) { return(new Real8Value((double)(long)a.Value)); } return(Real8Value.CreateUnknown()); }
public static Int32Value Conv_U2(Real8Value a) { if (!a.IsValid) { return(CreateUnknownUInt16()); } return(new Int32Value((int)(ushort)a.Value)); }
public static Real8Value Conv_R_Un(Int64Value a) { if (a.AllBitsValid()) { return(new Real8Value((float)(ulong)a.Value)); } return(Real8Value.CreateUnknown()); }
public static Real8Value Conv_R4(Int32Value a) { if (a.AllBitsValid()) { return(new Real8Value((double)(int)a.Value)); } return(Real8Value.CreateUnknown()); }
public static Int32Value Conv_I4(Real8Value a) { if (!a.IsValid) { return(CreateUnknown()); } return(new Int32Value((int)a.Value)); }
public static Int64Value Conv_U8(Real8Value a) { if (!a.IsValid) { return(CreateUnknown()); } return(new Int64Value((long)(ulong)a.Value)); }
public static Int32Value Conv_U1(Real8Value a) { if (!a.IsValid) { return(CreateUnknownUInt8()); } return(new Int32Value((int)(byte)a.Value)); }
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(); } }
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(); } }
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); } }
public static Int32Value Conv_U2(Real8Value a) { return(new Int32Value((int)(ushort)a.value)); }
public static Int32Value Conv_U1(Real8Value a) { return(new Int32Value((int)(byte)a.value)); }
public static Int64Value Conv_I8(Real8Value a) { return(new Int64Value((long)a.value)); }
public static Bool3 CompareFalse(Real8Value a) => Bool3.Unknown;
public static Bool3 CompareLt_Un(Real8Value a, Real8Value b) => Bool3.Unknown; //TODO:
public static Real8Value Mul_Ovf_Un(Real8Value a, Real8Value b) => CreateUnknown();
public static Int32Value Conv_U4(Real8Value a) { return new Int32Value((int)(uint)a.value); }
public static Int32Value Conv_I1(Real8Value a) { if (!a.IsValid) return CreateUnknown(); return new Int32Value((int)(sbyte)a.Value); }
public static Int32Value Conv_I2(Real8Value a) { return new Int32Value((int)(short)a.value); }
public static Int64Value Conv_Ovf_U8_Un(Real8Value a) => Int64Value.CreateUnknown();
public static Int32Value Conv_Ovf_U4(Real8Value a) => Int32Value.CreateUnknown();
public static Int32Value Conv_Ovf_U2_Un(Real8Value a) => Int32Value.CreateUnknownUInt16();
public static Int32Value Conv_I4(Real8Value a) { return(new Int32Value((int)a.value)); }
public static Int32Value Conv_U2(Real8Value a) { if (!a.IsValid) return CreateUnknownUInt16(); return new Int32Value((int)(ushort)a.Value); }
public static Int64Value Conv_U8(Real8Value a) { if (!a.IsValid) return CreateUnknown(); return new Int64Value((long)(ulong)a.Value); }
public static Real8Value Conv_R8(Int32Value a) { if (a.AllBitsValid()) return new Real8Value((double)(int)a.Value); return Real8Value.CreateUnknown(); }
public static Real8Value Conv_R_Un(Real8Value a) => CreateUnknown();
public static Real8Value Sub_Ovf(Real8Value a, Real8Value b) => CreateUnknown();
public static Int64Value Conv_U8(Real8Value a) { return new Int64Value((long)(ulong)a.value); }
public static Real8Value Conv_R8(Real8Value a) => a;
public static Int32Value Conv_U1(Real8Value a) { return new Int32Value((int)(byte)a.value); }
public static Int32Value Ceq(Real8Value a, Real8Value b) => Int32Value.Create(CompareEq(a, b));
public static Int32Value Conv_U1(Real8Value a) { if (!a.IsValid) return CreateUnknownUInt8(); return new Int32Value((int)(byte)a.Value); }
public static Int32Value Cgt(Real8Value a, Real8Value b) => Int32Value.Create(CompareGt(a, b));
public static Int32Value Conv_I4(Real8Value a) { if (!a.IsValid) return CreateUnknown(); return new Int32Value((int)a.Value); }
public static Int32Value Clt_Un(Real8Value a, Real8Value b) => Int32Value.Create(CompareLt_Un(a, b));