本文整理汇总了C#中Soft64.MipsR4300.MipsInstruction.DecodeDataFormat方法的典型用法代码示例。如果您正苦于以下问题:C# MipsInstruction.DecodeDataFormat方法的具体用法?C# MipsInstruction.DecodeDataFormat怎么用?C# MipsInstruction.DecodeDataFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Soft64.MipsR4300.MipsInstruction
的用法示例。
在下文中一共展示了MipsInstruction.DecodeDataFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Inst_FpuTruncW
private void Inst_FpuTruncW(MipsInstruction inst)
{
unchecked
{
if (!CheckCop1Usable())
{
CauseException = ExceptionCode.CopUnstable;
return;
}
if (!CheckEvenOddAllowed(inst))
{
return;
}
DataFormat format = inst.DecodeDataFormat();
if (format == DataFormat.Single || format == DataFormat.Double)
{
FPUHardware.SetRoundingMode(FPURoundMode.Chop);
FPUEntity value = new FPUEntity(format, MipsState);
FPUEntity result = new FPUEntity(DataFormat.Word, MipsState);
value.Load(inst.Fs);
result.Value = (UInt32)value.Value;
result.Store(inst.Fd);
if (FPUHardware.CheckFPUException())
CauseFPUException(FPUHardware.GetFPUException());
}
else
{
CauseFPUException(FPUExceptionType.Unimplemented);
}
}
}
示例2: Inst_FpuSub
private void Inst_FpuSub(MipsInstruction inst)
{
if (!CheckCop1Usable())
{
CauseException = ExceptionCode.CopUnstable;
return;
}
if (!CheckEvenOddAllowed(inst))
return;
unchecked
{
DataFormat format = inst.DecodeDataFormat();
if (format == DataFormat.Single || format == DataFormat.Double)
{
FPUEntity left = new FPUEntity(format, MipsState);
FPUEntity right = new FPUEntity(format, MipsState);
FPUEntity result = new FPUEntity(format, MipsState);
left.Load(inst.Fs);
right.Load(inst.Ft);
FPUHardware.SetRoundingMode(MipsState.FCR31.RM);
result.Value = left - right;
result.Store(inst.Fd);
if (FPUHardware.CheckFPUException())
CauseFPUException(FPUHardware.GetFPUException());
}
else
{
CauseFPUException(FPUExceptionType.Unimplemented);
}
}
}
示例3: Inst_FpuMov
private void Inst_FpuMov(MipsInstruction inst)
{
if (!CheckCop1Usable())
{
CauseException = ExceptionCode.CopUnstable;
return;
}
if (!CheckEvenOddAllowed(inst))
return;
DataFormat format = inst.DecodeDataFormat();
if (format == DataFormat.Single || format == DataFormat.Double)
{
FPUEntity value = new FPUEntity(format, MipsState);
value.Load(inst.Fs);
value.Store(inst.Fd);
}
else
{
CauseFPUException(FPUExceptionType.Unimplemented);
}
}
示例4: Inst_FpuConvertW
private void Inst_FpuConvertW(MipsInstruction inst)
{
unchecked
{
if (!CheckCop1Usable())
{
CauseException = ExceptionCode.CopUnstable;
return;
}
if (!CheckEvenOddAllowed(inst))
return;
DataFormat format = inst.DecodeDataFormat();
if (format != DataFormat.Reserved || format != DataFormat.Word)
{
FPUEntity value = new FPUEntity(format, MipsState);
FPUEntity result = new FPUEntity(DataFormat.Word, MipsState);
value.Load(inst.Fs);
result.Value = Convert.ToUInt32(value.Value);
value.Store(inst.Fd);
if (FPUHardware.CheckFPUException())
CauseFPUException(FPUHardware.GetFPUException());
}
else
{
CauseFPUException(FPUExceptionType.Unimplemented);
}
}
}
示例5: Inst_FpuCond
private void Inst_FpuCond(MipsInstruction inst)
{
if (!CheckCop1Usable())
{
CauseException = ExceptionCode.CopUnstable;
return;
}
if (!CheckEvenOddAllowed(inst))
{
return;
}
DataFormat format = inst.DecodeDataFormat();
if (format == DataFormat.Single || format == DataFormat.Double)
{
FPUEntity a = new FPUEntity(format, MipsState);
FPUEntity b = new FPUEntity(format, MipsState);
Boolean less = false;
Boolean unordered = false;
Boolean equal = false;
Boolean condU = (inst.Function & 1) != 0;
Boolean condE = ((inst.Function >> 1) & 1) != 0;
Boolean condL = ((inst.Function >> 2) & 1) != 0;
a.Load(inst.Fs);
b.Load(inst.Ft);
if (a.IsNaN && b.IsNaN)
{
unordered = true;
if ((inst.Function & 8) != 0)
{
CauseFPUException(FPUExceptionType.Invalid);
return;
}
}
else
{
less = a < b;
equal = a == b;
}
MipsState.FCR31.Condition = ((condL && less) || (condE && equal) || (condU && unordered));
}
else
{
CauseFPUException(FPUExceptionType.Unimplemented);
}
}
示例6: Inst_FpuAbs
private void Inst_FpuAbs(MipsInstruction inst)
{
unchecked
{
if (!CheckCop1Usable())
{
CauseException = ExceptionCode.CopUnstable;
return;
}
if (!CheckEvenOddAllowed(inst))
{
return;
}
DataFormat format = inst.DecodeDataFormat();
if (format == DataFormat.Single || format == DataFormat.Double)
{
FPUHardware.SetRoundingMode(MipsState.FCR31.RM);
FPUEntity fpuEntitiy = new FPUEntity(format, MipsState);
fpuEntitiy.Load(inst.Fs);
fpuEntitiy.Value = Math.Abs(fpuEntitiy.Value);
fpuEntitiy.Store(inst.Fd);
if (FPUHardware.CheckFPUException())
CauseFPUException(FPUHardware.GetFPUException());
}
else
{
CauseFPUException(FPUExceptionType.Unimplemented);
}
}
}