public AOpCodeSimdShImm(AInst Inst, long Position, int OpCode) : base(Inst, Position) { Rd = (OpCode >> 0) & 0x1f; Rn = (OpCode >> 5) & 0x1f; Imm = (OpCode >> 16) & 0x7f; Size = ABitUtils.HighestBitSet32(Imm >> 3); RegisterSize = ((OpCode >> 30) & 1) != 0 ? ARegisterSize.SIMD128 : ARegisterSize.SIMD64; }
public static BitMask DecodeBitMask(int OpCode, bool Immediate) { int ImmS = (OpCode >> 10) & 0x3f; int ImmR = (OpCode >> 16) & 0x3f; int N = (OpCode >> 22) & 1; int SF = (OpCode >> 31) & 1; int Length = ABitUtils.HighestBitSet32((~ImmS & 0x3f) | (N << 6)); if (Length < 1 || (SF == 0 && N != 0)) { return(BitMask.Invalid); } int Size = 1 << Length; int Levels = Size - 1; int S = ImmS & Levels; int R = ImmR & Levels; if (Immediate && S == Levels) { return(BitMask.Invalid); } long WMask = ABitUtils.FillWithOnes(S + 1); long TMask = ABitUtils.FillWithOnes(((S - R) & Levels) + 1); if (R > 0) { WMask = ABitUtils.RotateRight(WMask, R, Size); WMask &= ABitUtils.FillWithOnes(Size); } return(new BitMask() { WMask = ABitUtils.Replicate(WMask, Size), TMask = ABitUtils.Replicate(TMask, Size), Pos = ImmS, Shift = ImmR }); }
public AOpCodeSimdShImm(AInst Inst, long Position, int OpCode) : base(Inst, Position, OpCode) { Imm = (OpCode >> 16) & 0x7f; Size = ABitUtils.HighestBitSet32(Imm >> 3); }