Beispiel #1
0
 internal Instruction(string cpu, InstructionsData.Instruction i)
 {
     this.cpu   = cpu;
     args       = ArgTypes.parse(i.op);
     uops       = i.uops;
     latency    = i.latency;
     throughput = i.throughput;
 }
Beispiel #2
0
 static bool shouldAddInstruction(HashSet <int> hsCats, InstructionsData.Instruction instr)
 {
     if (hsCats.Contains(instr.cat))
     {
         return(true);
     }
     if (s_hsExtraInstructions.Contains(instr.i))
     {
         return(true);
     }
     return(false);
 }
Beispiel #3
0
        void addInstruction(string cpu, InstructionsData.Instruction data)
        {
            // if( data.i == "vpsadbw" && Debugger.IsAttached ) Debugger.Break();	// Break on loading perf.data of a "vpsadbw" instruction for some architecture

            Instruction r = new Instruction(cpu, data);

            debugWriter?.Write("{0} / {1}: ", cpu, data.i);

            eArgumentsMask[] args          = ArgTypes.parse(data.op);       // This is not a waste of CPU time because ArgTypes.parse() uses a local cache
            bool             appendVPrefix = args.Any(am => 0 != (am & (ArgTypes.avxBits | ArgTypes.avx512Bits)));

            foreach (string i in unpackInstructionsAddVPrefix(data.i, appendVPrefix))
            {
                debugWriter?.Write("{0} ", i);
                List <Instruction> list;
                if (!m_data.TryGetValue(i, out list))
                {
                    list      = new List <Instruction>(1);
                    m_data[i] = list;
                }
                list.Add(r);
            }
            debugWriter?.WriteLine();
        }