コード例 #1
0
ファイル: VariableMap.cs プロジェクト: prepare/AsmJit
        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
ファイル: VariableAttributes.cs プロジェクト: prepare/AsmJit
 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
ファイル: VariableMap.cs プロジェクト: prepare/AsmJit
 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;
            }
        }