Changeset 67074 in vbox for trunk/src/VBox
- Timestamp:
- May 25, 2017 8:43:50 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r67073 r67074 3679 3679 { 3680 3680 unsigned off; 3681 3681 3682 switch (iEncoding) 3682 3683 { 3683 /* 128-bit wide stuff goes first, then we'll update the operand widths afterwards. */ 3684 case 20: /* switch to 256-bit */ 3685 pThis->aOperands[pThis->iRmOp ].cbOp = 32; 3686 pThis->aOperands[pThis->iRmOp ].idxFieldBase = BS3CG1DST_YMM0; 3687 pThis->aOperands[pThis->iRegOp].cbOp = 32; 3688 pThis->aOperands[pThis->iRegOp].idxFieldBase = BS3CG1DST_YMM0; 3689 /* fall thru */ 3684 3690 case 0: 3685 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 3691 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3692 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/); 3686 3693 off = Bs3Cg1InsertOpcodes(pThis, off); 3687 3694 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3688 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg;3689 3695 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3690 3696 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; … … 3692 3698 3693 3699 case 1: 3694 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3700 case 21: 3701 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3695 3702 off = Bs3Cg1InsertOpcodes(pThis, off); 3696 3703 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); … … 3699 3706 break; 3700 3707 case 2: 3701 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/); 3708 case 22: 3709 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/); 3702 3710 off = Bs3Cg1InsertOpcodes(pThis, off); 3703 3711 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 5, 4); … … 3706 3714 break; 3707 3715 case 3: 3716 case 23: 3708 3717 pThis->aOperands[pThis->iRmOp].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationMem; 3709 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/);3718 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/); 3710 3719 off = Bs3Cg1InsertOpcodes(pThis, off); 3711 3720 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2 /*iReg*/, 0); 3712 3721 break; 3713 3722 case 4: 3714 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3723 case 24: 3724 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3715 3725 off = Bs3Cg1InsertOpcodes(pThis, off); 3716 3726 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 0); 3717 3727 break; 3718 3728 case 5: 3719 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored */); 3729 case 25: 3730 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored */); 3720 3731 off = Bs3Cg1InsertOpcodes(pThis, off); 3721 3732 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 0); 3722 3733 break; 3723 3734 case 6: 3724 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 3735 case 26: 3736 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/); 3725 3737 off = Bs3Cg1InsertOpcodes(pThis, off); 3726 3738 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 1 /*cbMisalign*/); … … 3729 3741 break; 3730 3742 case 7: 3731 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3743 case 27: 3744 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3732 3745 off = Bs3Cg1InsertOpcodes(pThis, off); 3733 3746 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 1 /*cbMisalign*/); … … 3735 3748 pThis->bAlignmentXcpt = X86_XCPT_GP; 3736 3749 break; 3737 /* 128-bitinvalid encodings: */3750 /* invalid encodings: */ 3738 3751 case 8: 3739 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, 0 /*L*/, 1 /*~R*/); /* Bad V value */ 3752 case 28: 3753 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/); /* Bad V value */ 3740 3754 off = Bs3Cg1InsertOpcodes(pThis, off); 3741 3755 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); … … 3746 3760 break; 3747 3761 case 9: 3748 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3762 case 29: 3763 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3749 3764 off = Bs3Cg1InsertOpcodes(pThis, off); 3750 3765 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); … … 3752 3767 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3753 3768 pThis->fInvalidEncoding = true; 3754 iEncoding = 20-1; 3755 break; 3756 3757 case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: 3758 /* fall thru */ 3759 3760 /* 256-bit encodings: */ 3761 case 20: 3762 iEncoding = 20; 3763 pThis->aOperands[pThis->iRmOp ].cbOp = 32; 3764 pThis->aOperands[pThis->iRmOp ].idxFieldBase = BS3CG1DST_YMM0; 3765 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3766 pThis->aOperands[pThis->iRegOp].cbOp = 32; 3767 pThis->aOperands[pThis->iRegOp].idxFieldBase = BS3CG1DST_YMM0; 3768 3769 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/); 3770 off = Bs3Cg1InsertOpcodes(pThis, off); 3771 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3772 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3773 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 3774 break; 3775 case 21: 3776 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3777 off = Bs3Cg1InsertOpcodes(pThis, off); 3778 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3779 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3780 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3781 break; 3782 case 22: 3783 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/); 3784 off = Bs3Cg1InsertOpcodes(pThis, off); 3785 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 5, 4); 3786 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 4; 3787 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 5; 3788 break; 3789 case 23: 3790 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/); 3791 off = Bs3Cg1InsertOpcodes(pThis, off); 3792 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationMem; 3793 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2 /*iReg*/, 0); 3794 break; 3795 case 24: 3796 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3797 off = Bs3Cg1InsertOpcodes(pThis, off); 3798 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 0); 3799 break; 3800 case 25: 3801 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored */); 3802 off = Bs3Cg1InsertOpcodes(pThis, off); 3803 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 0); 3804 break; 3805 case 26: 3806 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/); 3807 off = Bs3Cg1InsertOpcodes(pThis, off); 3808 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 1 /*cbMisalign*/); 3809 if (!Bs3Cg1XcptTypeIsVexUnaligned(pThis->enmXcptType)) 3810 pThis->bAlignmentXcpt = X86_XCPT_GP; 3811 break; 3812 case 27: 3813 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3814 off = Bs3Cg1InsertOpcodes(pThis, off); 3815 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 3 /*iReg*/, 1 /*cbMisalign*/); 3816 if (!Bs3Cg1XcptTypeIsVexUnaligned(pThis->enmXcptType)) 3817 pThis->bAlignmentXcpt = X86_XCPT_GP; 3818 break; 3819 /* 256-bit invalid encodings: */ 3820 case 28: 3821 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V - invalid */, 1 /*L*/, 1 /*~R*/); /* Bad V value */ 3822 off = Bs3Cg1InsertOpcodes(pThis, off); 3823 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3824 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3825 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3826 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 3827 pThis->fInvalidEncoding = true; 3828 break; 3829 case 29: 3830 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V - invalid */, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3769 break; 3770 3771 case 10: 3772 case 30: 3773 pThis->abCurInstr[0] = P_RN; 3774 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3831 3775 off = Bs3Cg1InsertOpcodes(pThis, off); 3832 3776 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); … … 3835 3779 pThis->fInvalidEncoding = true; 3836 3780 break; 3837 case 30: 3838 pThis->abCurInstr[0] = P_RN; 3839 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3781 case 11: 3782 case 31: 3783 pThis->abCurInstr[0] = P_RZ; 3784 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3840 3785 off = Bs3Cg1InsertOpcodes(pThis, off); 3841 3786 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); … … 3844 3789 pThis->fInvalidEncoding = true; 3845 3790 break; 3846 case 31: 3847 pThis->abCurInstr[0] = P_RZ; 3848 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3791 case 12: 3792 case 32: 3793 pThis->abCurInstr[0] = P_OZ; 3794 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3849 3795 off = Bs3Cg1InsertOpcodes(pThis, off); 3850 3796 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); … … 3853 3799 pThis->fInvalidEncoding = true; 3854 3800 break; 3855 case 32: 3856 pThis->abCurInstr[0] = P_OZ; 3857 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3801 case 13: 3802 case 33: 3803 pThis->abCurInstr[0] = P_LK; 3804 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3858 3805 off = Bs3Cg1InsertOpcodes(pThis, off); 3859 3806 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); … … 3861 3808 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3862 3809 pThis->fInvalidEncoding = true; 3863 break; 3864 case 33: 3865 pThis->abCurInstr[0] = P_LK; 3866 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3867 off = Bs3Cg1InsertOpcodes(pThis, off); 3868 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3869 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3870 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3871 pThis->fInvalidEncoding = true; 3872 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 2 : 0; 3810 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 2 + 4 : 0; 3873 3811 break; 3874 3812 3875 3813 #if ARCH_BITS == 64 3876 3814 /* 64-bit mode registers */ 3815 case 14: 3877 3816 case 34: 3878 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1/*L*/, 0 /*~R*/);3817 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 0 /*~R*/); 3879 3818 off = Bs3Cg1InsertOpcodes(pThis, off); 3880 3819 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 4); … … 3882 3821 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11; 3883 3822 break; 3823 case 15: 3884 3824 case 35: 3885 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1/*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/);3825 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/); 3886 3826 off = Bs3Cg1InsertOpcodes(pThis, off); 3887 3827 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 4); 3888 3828 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 12; 3889 3829 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 9; 3830 iEncoding += 4; 3890 3831 break; 3891 3832 #endif
Note:
See TracChangeset
for help on using the changeset viewer.