Changeset 67073 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- May 25, 2017 8:33:43 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r67072 r67073 2841 2841 2842 2842 2843 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_VEX_MODRM_Vps_WO_Wps__OR__VEX_MODRM_Vpd_WO_Wpd(PBS3CG1STATE pThis, unsigned iEncoding)2844 {2845 unsigned off;2846 /* 128-bit wide stuff goes first, then we'll update the operand widths afterwards. */2847 if (iEncoding == 0)2848 {2849 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/);2850 off = Bs3Cg1InsertOpcodes(pThis, off);2851 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);2852 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0;2853 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1;2854 }2855 else if (iEncoding == 1)2856 {2857 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2858 off = Bs3Cg1InsertOpcodes(pThis, off);2859 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);2860 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM5;2861 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM4;2862 }2863 else if (iEncoding == 2)2864 {2865 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/);2866 off = Bs3Cg1InsertOpcodes(pThis, off);2867 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 5, 4);2868 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM4;2869 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM5;2870 }2871 else if (iEncoding == 3)2872 {2873 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/);2874 off = Bs3Cg1InsertOpcodes(pThis, off);2875 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 16, 0, BS3CG1OPLOC_MEM);2876 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2;2877 }2878 else if (iEncoding == 4)2879 {2880 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2881 off = Bs3Cg1InsertOpcodes(pThis, off);2882 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 0, BS3CG1OPLOC_MEM);2883 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3;2884 }2885 else if (iEncoding == 5)2886 {2887 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored */);2888 off = Bs3Cg1InsertOpcodes(pThis, off);2889 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 0, BS3CG1OPLOC_MEM);2890 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3;2891 }2892 else if (iEncoding == 6)2893 {2894 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/);2895 off = Bs3Cg1InsertOpcodes(pThis, off);2896 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 1 /*cbMisalign*/, BS3CG1OPLOC_MEM);2897 if (!Bs3Cg1XcptTypeIsVexUnaligned(pThis->enmXcptType))2898 pThis->bAlignmentXcpt = X86_XCPT_GP;2899 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3;2900 }2901 else if (iEncoding == 7)2902 {2903 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2904 off = Bs3Cg1InsertOpcodes(pThis, off);2905 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 1 /*cbMisalign*/, BS3CG1OPLOC_MEM);2906 if (!Bs3Cg1XcptTypeIsVexUnaligned(pThis->enmXcptType))2907 pThis->bAlignmentXcpt = X86_XCPT_GP;2908 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3;2909 }2910 /* 128-bit invalid encodings: */2911 else if (iEncoding == 8)2912 {2913 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, 0 /*L*/, 1 /*~R*/); /* Bad V value */2914 off = Bs3Cg1InsertOpcodes(pThis, off);2915 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);2916 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0;2917 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1;2918 pThis->fInvalidEncoding = true;2919 }2920 else if (iEncoding == 9)2921 {2922 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2923 off = Bs3Cg1InsertOpcodes(pThis, off);2924 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);2925 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM5;2926 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM4;2927 pThis->fInvalidEncoding = true;2928 }2929 /* 256-bit encodings: */2930 else if (iEncoding == 10)2931 {2932 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/);2933 off = Bs3Cg1InsertOpcodes(pThis, off);2934 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);2935 pThis->aOperands[pThis->iRmOp].cbOp = 32;2936 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM0;2937 pThis->aOperands[pThis->iRegOp].cbOp = 32;2938 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM1;2939 }2940 else if (iEncoding == 11)2941 {2942 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2943 off = Bs3Cg1InsertOpcodes(pThis, off);2944 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);2945 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM5;2946 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM4;2947 }2948 else if (iEncoding == 12)2949 {2950 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/);2951 off = Bs3Cg1InsertOpcodes(pThis, off);2952 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 5, 4);2953 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM4;2954 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM5;2955 }2956 else if (iEncoding == 13)2957 {2958 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/);2959 off = Bs3Cg1InsertOpcodes(pThis, off);2960 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 32, 0, BS3CG1OPLOC_MEM);2961 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM2;2962 }2963 else if (iEncoding == 14)2964 {2965 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2966 off = Bs3Cg1InsertOpcodes(pThis, off);2967 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 32, 0, BS3CG1OPLOC_MEM);2968 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM3;2969 }2970 else if (iEncoding == 15)2971 {2972 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored */);2973 off = Bs3Cg1InsertOpcodes(pThis, off);2974 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 32, 0, BS3CG1OPLOC_MEM);2975 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM3;2976 }2977 else if (iEncoding == 16)2978 {2979 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/);2980 off = Bs3Cg1InsertOpcodes(pThis, off);2981 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 32, 1 /*cbMisalign*/, BS3CG1OPLOC_MEM);2982 if (!Bs3Cg1XcptTypeIsVexUnaligned(pThis->enmXcptType))2983 pThis->bAlignmentXcpt = X86_XCPT_GP;2984 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM3;2985 }2986 else if (iEncoding == 17)2987 {2988 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);2989 off = Bs3Cg1InsertOpcodes(pThis, off);2990 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 32, 1 /*cbMisalign*/, BS3CG1OPLOC_MEM);2991 if (!Bs3Cg1XcptTypeIsVexUnaligned(pThis->enmXcptType))2992 pThis->bAlignmentXcpt = X86_XCPT_GP;2993 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM3;2994 }2995 /* 256-bit invalid encodings: */2996 else if (iEncoding == 18)2997 {2998 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V - invalid */, 1 /*L*/, 1 /*~R*/); /* Bad V value */2999 off = Bs3Cg1InsertOpcodes(pThis, off);3000 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);3001 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM0;3002 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM1;3003 pThis->fInvalidEncoding = true;3004 }3005 else if (iEncoding == 19)3006 {3007 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V - invalid */, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);3008 off = Bs3Cg1InsertOpcodes(pThis, off);3009 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);3010 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM5;3011 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM4;3012 pThis->fInvalidEncoding = true;3013 }3014 else if (iEncoding == 20)3015 {3016 pThis->abCurInstr[0] = P_RN;3017 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);3018 off = Bs3Cg1InsertOpcodes(pThis, off);3019 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);3020 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM5;3021 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM4;3022 pThis->fInvalidEncoding = true;3023 }3024 else if (iEncoding == 21)3025 {3026 pThis->abCurInstr[0] = P_RZ;3027 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);3028 off = Bs3Cg1InsertOpcodes(pThis, off);3029 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);3030 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM5;3031 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM4;3032 pThis->fInvalidEncoding = true;3033 }3034 else if (iEncoding == 22)3035 {3036 pThis->abCurInstr[0] = P_OZ;3037 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);3038 off = Bs3Cg1InsertOpcodes(pThis, off);3039 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);3040 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM5;3041 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM4;3042 pThis->fInvalidEncoding = true;3043 }3044 else if (iEncoding == 23)3045 {3046 pThis->abCurInstr[0] = P_LK;3047 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);3048 off = Bs3Cg1InsertOpcodes(pThis, off);3049 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5);3050 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM5;3051 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM4;3052 pThis->fInvalidEncoding = true;3053 }3054 #if ARCH_BITS == 643055 /* 64-bit mode registers */3056 else if (BS3CG1_IS_64BIT_TARGET(pThis))3057 {3058 if (iEncoding == 24)3059 {3060 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 0 /*~R*/);3061 off = Bs3Cg1InsertOpcodes(pThis, off);3062 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 4);3063 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM4;3064 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM11;3065 }3066 else if (iEncoding == 25)3067 {3068 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/);3069 off = Bs3Cg1InsertOpcodes(pThis, off);3070 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 4);3071 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_YMM12;3072 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_YMM9;3073 }3074 else3075 return 0;3076 }3077 #endif3078 else3079 return 0;3080 pThis->cbCurInstr = off;3081 return iEncoding + 1;3082 }3083 3084 3085 2843 /** 3086 2844 * Wip - VEX.W ignored. … … 4788 4546 case BS3CG1ENC_VEX_MODRM_Vps_WO_Wps: 4789 4547 case BS3CG1ENC_VEX_MODRM_Vpd_WO_Wpd: 4790 pThis->pfnEncoder = Bs3Cg1EncodeNext_VEX_MODRM_Vps_WO_Wps__OR__VEX_MODRM_Vpd_WO_Wpd; 4548 pThis->pfnEncoder = Bs3Cg1EncodeNext_VEX_MODRM_WsomethingWO_Vsomething_Wip_OR_ViceVersa; 4549 pThis->iRegOp = 0; 4791 4550 pThis->iRmOp = 1; 4792 pThis->iRegOp = 0;4793 4551 pThis->aOperands[0].cbOp = 16; 4794 4552 pThis->aOperands[1].cbOp = 16; 4795 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 4796 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 4553 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 4554 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 4555 pThis->aOperands[1].enmLocationReg = BS3CG1OPLOC_CTX; 4556 pThis->aOperands[1].enmLocationMem = BS3CG1OPLOC_MEM; 4557 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0; 4558 pThis->aOperands[1].idxFieldBase = BS3CG1DST_XMM0; 4797 4559 break; 4798 4560
Note:
See TracChangeset
for help on using the changeset viewer.