Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 public TransactionSite(FloatNegAbs host)
 {
     _host = host;
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public Mapping(FloatNegAbs host)
 {
     _host = host;
 }
Esempio n. 5
0
 public TransactionSite(FloatNegAbs host)
 {
     _host = host;
 }
Esempio n. 6
0
 public Mapping(FloatNegAbs host)
 {
     _host = host;
 }