示例#1
0
        public VariableAttributes[] GetListByClass(RegisterClass @class)
        {
            var tmp = new VariableAttributes[AttributesCount - Start.Get(@class)];

            Array.Copy(Attributes, Start.Get(@class), tmp, 0, AttributesCount - Start.Get(@class));
            return(tmp);
        }
示例#2
0
 public void CopyFrom(VariableAttributes va)
 {
     VariableData  = va.VariableData;
     Flags         = va.Flags;
     UsageCount    = va.UsageCount;
     InRegIndex    = va.InRegIndex;
     OutRegIndex   = va.OutRegIndex;
     InRegs        = va.InRegs;
     AllocableRegs = va.AllocableRegs;
 }
示例#3
0
 public VariableMap(int attrCount)
 {
     InRegs          = new RegisterMask();
     OutRegs         = new RegisterMask();
     ClobberedRegs   = new RegisterMask();
     Start           = new RegisterCount();
     Count           = new RegisterCount();
     AttributesCount = attrCount;
     Attributes      = new VariableAttributes[attrCount].InitializeWith(() => new VariableAttributes());
 }
示例#4
0
        private static void PrepareSingleVariableInstruction(InstructionId instId, VariableAttributes va)
        {
            switch (instId)
            {
            // - andn     reg, reg ; Set all bits in reg to 0.
            // - xor/pxor reg, reg ; Set all bits in reg to 0.
            // - sub/psub reg, reg ; Set all bits in reg to 0.
            // - pcmpgt   reg, reg ; Set all bits in reg to 0.
            // - pcmpeq   reg, reg ; Set all bits in reg to 1.
            case InstructionId.Pandn:
            case InstructionId.Xor:
            case InstructionId.Xorpd:
            case InstructionId.Xorps:
            case InstructionId.Pxor:
            case InstructionId.Sub:
            case InstructionId.Psubb:
            case InstructionId.Psubw:
            case InstructionId.Psubd:
            case InstructionId.Psubq:
            case InstructionId.Psubsb:
            case InstructionId.Psubsw:
            case InstructionId.Psubusb:
            case InstructionId.Psubusw:
            case InstructionId.Pcmpeqb:
            case InstructionId.Pcmpeqw:
            case InstructionId.Pcmpeqd:
            case InstructionId.Pcmpeqq:
            case InstructionId.Pcmpgtb:
            case InstructionId.Pcmpgtw:
            case InstructionId.Pcmpgtd:
            case InstructionId.Pcmpgtq:
                va.Flags &= ~VariableFlags.RReg;
                break;

            // - and      reg, reg ; Nop.
            // - or       reg, reg ; Nop.
            // - xchg     reg, reg ; Nop.
            case InstructionId.And:
            case InstructionId.Andpd:
            case InstructionId.Andps:
            case InstructionId.Pand:
            case InstructionId.Or:
            case InstructionId.Orpd:
            case InstructionId.Orps:
            case InstructionId.Por:
            case InstructionId.Xchg:
                va.Flags &= ~VariableFlags.WReg;
                break;
            }
        }