當前位置: 首頁>>代碼示例>>C#>>正文


C# MipsInstruction.DecodeDataFormat方法代碼示例

本文整理匯總了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);
                }
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:35,代碼來源:Interpreter_FPU.cs

示例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);
                }
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:35,代碼來源:Interpreter_FPU.cs

示例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);
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:24,代碼來源:Interpreter_FPU.cs

示例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);
                }
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:32,代碼來源:Interpreter_FPU.cs

示例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);
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:52,代碼來源:Interpreter_FPU.cs

示例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);
                }
            }
        }
開發者ID:RonnChyran,項目名稱:Soft64-Bryan,代碼行數:34,代碼來源:Interpreter_FPU.cs


注:本文中的Soft64.MipsR4300.MipsInstruction.DecodeDataFormat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。