public override void Decode(Decoder decoder, ref Instruction instruction) { Debug.Assert(decoder.state.Encoding == EncodingKind.MVEX); if (decoder.invalidCheckMask != 0 && ((decoder.state.vvvv_invalidCheck & 0xF) != 0 || decoder.state.aaa == 0)) { decoder.SetInvalidInstruction(); } instruction.InternalSetCodeNoCheck(code); Static.Assert(OpKind.Register == 0 ? 0 : -1); //instruction.Op1Kind = OpKind.Register; instruction.Op1Register = (int)(decoder.state.reg + decoder.state.zs.extraRegisterBase + decoder.state.extraRegisterBaseEVEX) + Register.ZMM0; var mvex = new MvexInfo(code); var sss = decoder.state.Sss; if (decoder.state.mod == 3) { decoder.SetInvalidInstruction(); } else { instruction.Op0Kind = OpKind.Memory; if ((decoder.state.zs.flags & StateFlags.MvexEH) != 0) { instruction.InternalSetIsMvexEvictionHint(); } if ((mvex.InvalidConvFns & (1U << sss) & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } instruction.InternalSetMvexRegMemConv(MvexRegMemConv.MemConvNone + sss); decoder.ReadOpMem_VSIB(ref instruction, Register.ZMM0, mvex.GetTupleType(sss)); } }
public override void Decode(Decoder decoder, ref Instruction instruction) { Debug.Assert(decoder.state.Encoding == EncodingKind.MVEX); if ((decoder.state.vvvv_invalidCheck & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } instruction.OpMask = Register.None; // It's ignored (see ctor) instruction.InternalSetCodeNoCheck(code); var mvex = new MvexInfo(code); var sss = decoder.state.Sss; if (decoder.state.mod == 3) { decoder.SetInvalidInstruction(); } else { instruction.Op0Kind = OpKind.Memory; if ((mvex.InvalidConvFns & (1U << sss) & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } instruction.InternalSetMvexRegMemConv(MvexRegMemConv.MemConvNone + sss); decoder.ReadOpMem(ref instruction, mvex.GetTupleType(sss)); } }
public override void Decode(Decoder decoder, ref Instruction instruction) { Debug.Assert(decoder.state.Encoding == EncodingKind.MVEX); instruction.InternalSetCodeNoCheck(code); Static.Assert(OpKind.Register == 0 ? 0 : -1); //instruction.Op0Kind = OpKind.Register; instruction.Op0Register = (int)decoder.state.reg + Register.K0; Static.Assert(OpKind.Register == 0 ? 0 : -1); //instruction.Op1Kind = OpKind.Register; instruction.Op1Register = (int)decoder.state.vvvv + Register.ZMM0; var mvex = new MvexInfo(code); var sss = decoder.state.Sss; if (decoder.state.mod == 3) { Static.Assert(OpKind.Register == 0 ? 0 : -1); //instruction.Op2Kind = OpKind.Register; instruction.Op2Register = (int)(decoder.state.rm + decoder.state.extraBaseRegisterBaseEVEX) + Register.ZMM0; if ((decoder.state.zs.flags & StateFlags.MvexEH) != 0) { if (mvex.CanUseSuppressAllExceptions) { if ((sss & 4) != 0) { instruction.InternalSetSuppressAllExceptions(); } if (mvex.CanUseRoundingControl) { Static.Assert((int)RoundingControl.None == 0 ? 0 : -1); Static.Assert((int)RoundingControl.RoundToNearest == 1 ? 0 : -1); Static.Assert((int)RoundingControl.RoundDown == 2 ? 0 : -1); Static.Assert((int)RoundingControl.RoundUp == 3 ? 0 : -1); Static.Assert((int)RoundingControl.RoundTowardZero == 4 ? 0 : -1); instruction.InternalRoundingControl = ((uint)sss & 3) + (uint)RoundingControl.RoundToNearest; } } else if (mvex.NoSaeRc && ((uint)sss & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } } else { if ((mvex.InvalidSwizzleFns & (1U << sss) & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } Debug.Assert((uint)sss <= 7); instruction.InternalSetMvexRegMemConv(MvexRegMemConv.RegSwizzleNone + sss); } } else { instruction.Op2Kind = OpKind.Memory; if ((decoder.state.zs.flags & StateFlags.MvexEH) != 0) { instruction.InternalSetIsMvexEvictionHint(); } if ((mvex.InvalidConvFns & (1U << sss) & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } instruction.InternalSetMvexRegMemConv(MvexRegMemConv.MemConvNone + sss); decoder.ReadOpMem(ref instruction, mvex.GetTupleType(sss)); } if (((decoder.state.zs.extraRegisterBase | decoder.state.extraRegisterBaseEVEX) & decoder.invalidCheckMask) != 0) { decoder.SetInvalidInstruction(); } instruction.Op3Kind = OpKind.Immediate8; instruction.Immediate8 = (byte)decoder.ReadByte(); }