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()); }
public Mapping(SinCosLUTCore host) { _host = host; }
public TransactionSite(SinCosLUTCore host) { _host = host; }
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(); }