コード例 #1
0
ファイル: LERP.cs プロジェクト: cephdon/systemsharp
        public IXILMapping TryAllocate(Component host, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes, IProject targetProject)
        {
            if (operandTypes.Length != 1 || resultTypes.Length != 2)
            {
                return(null);
            }

            if (!operandTypes[0].CILType.Equals(typeof(SFix)) ||
                !resultTypes[0].CILType.Equals(typeof(SFix)) ||
                !resultTypes[1].Equals(resultTypes[0]))
            {
                return(null);
            }

            var xfmt = SFix.GetFormat(operandTypes[0]);
            var yfmt = SFix.GetFormat(resultTypes[0]);

            int lutWidth   = Math.Max(1, xfmt.FracWidth - 1);
            int mulWidth   = Math.Max(1, xfmt.FracWidth - lutWidth);
            int pipeStages = 0; // 2 * mulWidth * mulWidth / (18 * 18) + yfmt.FracWidth / 18 + 1;
            var scc        = new SinCosLUTCore(lutWidth, xfmt.FracWidth, yfmt.FracWidth, pipeStages);

            var mappings = TryMap(scc.TASite, instr, operandTypes, resultTypes);

            Debug.Assert(mappings.Any());
            return(mappings.First());
        }
コード例 #2
0
ファイル: LERP.cs プロジェクト: cephdon/systemsharp
 public Mapping(SinCosLUTCore host)
 {
     _host = host;
 }
コード例 #3
0
ファイル: LERP.cs プロジェクト: cephdon/systemsharp
 public TransactionSite(SinCosLUTCore host)
 {
     _host = host;
 }
コード例 #4
0
ファイル: LERP.cs プロジェクト: venusdharan/systemsharp
        public IXILMapping TryAllocate(Component host, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes, IProject targetProject)
        {
            if (operandTypes.Length != 1 || resultTypes.Length != 2)
                return null;

            if (!operandTypes[0].CILType.Equals(typeof(SFix)) ||
                !resultTypes[0].CILType.Equals(typeof(SFix)) || 
                !resultTypes[1].Equals(resultTypes[0]))
                return null;

            var xfmt = SFix.GetFormat(operandTypes[0]);
            var yfmt = SFix.GetFormat(resultTypes[0]);

            int lutWidth = Math.Max(1, xfmt.FracWidth - 1);
            int mulWidth = Math.Max(1, xfmt.FracWidth - lutWidth);
            int pipeStages = 0; // 2 * mulWidth * mulWidth / (18 * 18) + yfmt.FracWidth / 18 + 1;
            var scc = new SinCosLUTCore(lutWidth, xfmt.FracWidth, yfmt.FracWidth, pipeStages);

            var mappings = TryMap(scc.TASite, instr, operandTypes, resultTypes);
            Debug.Assert(mappings.Any());
            return mappings.First();
        }
コード例 #5
0
ファイル: LERP.cs プロジェクト: venusdharan/systemsharp
 public Mapping(SinCosLUTCore host)
 {
     _host = host;
 }
コード例 #6
0
ファイル: LERP.cs プロジェクト: venusdharan/systemsharp
 public TransactionSite(SinCosLUTCore host)
 {
     _host = host;
 }