public IXILMapping TryAllocate(Component host, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes, IProject targetProject) { if (operandTypes.Length != 1 || resultTypes.Length != 1) { return(null); } int totalWidth; if (operandTypes[0].CILType.Equals(typeof(float)) && resultTypes[0].CILType.Equals(typeof(float))) { totalWidth = 32; } else if (operandTypes[0].CILType.Equals(typeof(double)) && resultTypes[0].CILType.Equals(typeof(double))) { totalWidth = 64; } else { return(null); } FloatNegAbs fna; switch (instr.Name) { case InstructionCodes.Abs: fna = new FloatNegAbs(totalWidth, FloatNegAbs.EOperation.Abs, 0); break; case InstructionCodes.Neg: fna = new FloatNegAbs(totalWidth, FloatNegAbs.EOperation.Neg, 0); break; default: return(null); } return(new Mapping(fna)); }
public TransactionSite(FloatNegAbs host) { _host = host; }
public IXILMapping TryAllocate(Component host, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes, IProject targetProject) { if (operandTypes.Length != 1 || resultTypes.Length != 1) return null; int totalWidth; if (operandTypes[0].CILType.Equals(typeof(float)) && resultTypes[0].CILType.Equals(typeof(float))) totalWidth = 32; else if (operandTypes[0].CILType.Equals(typeof(double)) && resultTypes[0].CILType.Equals(typeof(double))) totalWidth = 64; else return null; FloatNegAbs fna; switch (instr.Name) { case InstructionCodes.Abs: fna = new FloatNegAbs(totalWidth, FloatNegAbs.EOperation.Abs, 0); break; case InstructionCodes.Neg: fna = new FloatNegAbs(totalWidth, FloatNegAbs.EOperation.Neg, 0); break; default: return null; } return new Mapping(fna); }
public Mapping(FloatNegAbs host) { _host = host; }