Changeset 94163 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Mar 11, 2022 12:56:22 AM (3 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r94162 r94163 896 896 }; 897 897 898 /** Function table for the ROL instruction, AMD EFLAGS variant. */ 899 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rol_amd = 900 { 901 iemAImpl_rol_u8_amd, 902 iemAImpl_rol_u16_amd, 903 iemAImpl_rol_u32_amd, 904 iemAImpl_rol_u64_amd 905 }; 906 907 /** Function table for the ROL instruction, Intel EFLAGS variant. */ 908 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rol_intel = 909 { 910 iemAImpl_rol_u8_intel, 911 iemAImpl_rol_u16_intel, 912 iemAImpl_rol_u32_intel, 913 iemAImpl_rol_u64_intel 914 }; 915 916 /** EFLAGS variation selection table for the ROL instruction. */ 917 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_rol_eflags[] = 918 { 919 &g_iemAImpl_rol, 920 &g_iemAImpl_rol_intel, 921 &g_iemAImpl_rol_amd, 922 &g_iemAImpl_rol, 923 }; 924 925 898 926 /** Function table for the ROR instruction. */ 899 927 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_ror = … … 905 933 }; 906 934 935 /** Function table for the ROR instruction, AMD EFLAGS variant. */ 936 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_ror_amd = 937 { 938 iemAImpl_ror_u8_amd, 939 iemAImpl_ror_u16_amd, 940 iemAImpl_ror_u32_amd, 941 iemAImpl_ror_u64_amd 942 }; 943 944 /** Function table for the ROR instruction, Intel EFLAGS variant. */ 945 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_ror_intel = 946 { 947 iemAImpl_ror_u8_intel, 948 iemAImpl_ror_u16_intel, 949 iemAImpl_ror_u32_intel, 950 iemAImpl_ror_u64_intel 951 }; 952 953 /** EFLAGS variation selection table for the ROR instruction. */ 954 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_ror_eflags[] = 955 { 956 &g_iemAImpl_ror, 957 &g_iemAImpl_ror_intel, 958 &g_iemAImpl_ror_amd, 959 &g_iemAImpl_ror, 960 }; 961 962 907 963 /** Function table for the RCL instruction. */ 908 964 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rcl = … … 914 970 }; 915 971 972 /** Function table for the RCL instruction, AMD EFLAGS variant. */ 973 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rcl_amd = 974 { 975 iemAImpl_rcl_u8_amd, 976 iemAImpl_rcl_u16_amd, 977 iemAImpl_rcl_u32_amd, 978 iemAImpl_rcl_u64_amd 979 }; 980 981 /** Function table for the RCL instruction, Intel EFLAGS variant. */ 982 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rcl_intel = 983 { 984 iemAImpl_rcl_u8_intel, 985 iemAImpl_rcl_u16_intel, 986 iemAImpl_rcl_u32_intel, 987 iemAImpl_rcl_u64_intel 988 }; 989 990 /** EFLAGS variation selection table for the RCL instruction. */ 991 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_rcl_eflags[] = 992 { 993 &g_iemAImpl_rcl, 994 &g_iemAImpl_rcl_intel, 995 &g_iemAImpl_rcl_amd, 996 &g_iemAImpl_rcl, 997 }; 998 999 916 1000 /** Function table for the RCR instruction. */ 917 1001 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rcr = … … 923 1007 }; 924 1008 1009 /** Function table for the RCR instruction, AMD EFLAGS variant. */ 1010 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rcr_amd = 1011 { 1012 iemAImpl_rcr_u8_amd, 1013 iemAImpl_rcr_u16_amd, 1014 iemAImpl_rcr_u32_amd, 1015 iemAImpl_rcr_u64_amd 1016 }; 1017 1018 /** Function table for the RCR instruction, Intel EFLAGS variant. */ 1019 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_rcr_intel = 1020 { 1021 iemAImpl_rcr_u8_intel, 1022 iemAImpl_rcr_u16_intel, 1023 iemAImpl_rcr_u32_intel, 1024 iemAImpl_rcr_u64_intel 1025 }; 1026 1027 /** EFLAGS variation selection table for the RCR instruction. */ 1028 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_rcr_eflags[] = 1029 { 1030 &g_iemAImpl_rcr, 1031 &g_iemAImpl_rcr_intel, 1032 &g_iemAImpl_rcr_amd, 1033 &g_iemAImpl_rcr, 1034 }; 1035 1036 925 1037 /** Function table for the SHL instruction. */ 926 1038 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_shl = … … 932 1044 }; 933 1045 1046 /** Function table for the SHL instruction, AMD EFLAGS variant. */ 1047 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_shl_amd = 1048 { 1049 iemAImpl_shl_u8_amd, 1050 iemAImpl_shl_u16_amd, 1051 iemAImpl_shl_u32_amd, 1052 iemAImpl_shl_u64_amd 1053 }; 1054 1055 /** Function table for the SHL instruction, Intel EFLAGS variant. */ 1056 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_shl_intel = 1057 { 1058 iemAImpl_shl_u8_intel, 1059 iemAImpl_shl_u16_intel, 1060 iemAImpl_shl_u32_intel, 1061 iemAImpl_shl_u64_intel 1062 }; 1063 1064 /** EFLAGS variation selection table for the SHL instruction. */ 1065 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_shl_eflags[] = 1066 { 1067 &g_iemAImpl_shl, 1068 &g_iemAImpl_shl_intel, 1069 &g_iemAImpl_shl_amd, 1070 &g_iemAImpl_shl, 1071 }; 1072 1073 934 1074 /** Function table for the SHR instruction. */ 935 1075 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_shr = … … 941 1081 }; 942 1082 1083 /** Function table for the SHR instruction, AMD EFLAGS variant. */ 1084 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_shr_amd = 1085 { 1086 iemAImpl_shr_u8_amd, 1087 iemAImpl_shr_u16_amd, 1088 iemAImpl_shr_u32_amd, 1089 iemAImpl_shr_u64_amd 1090 }; 1091 1092 /** Function table for the SHR instruction, Intel EFLAGS variant. */ 1093 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_shr_intel = 1094 { 1095 iemAImpl_shr_u8_intel, 1096 iemAImpl_shr_u16_intel, 1097 iemAImpl_shr_u32_intel, 1098 iemAImpl_shr_u64_intel 1099 }; 1100 1101 /** EFLAGS variation selection table for the SHR instruction. */ 1102 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_shr_eflags[] = 1103 { 1104 &g_iemAImpl_shr, 1105 &g_iemAImpl_shr_intel, 1106 &g_iemAImpl_shr_amd, 1107 &g_iemAImpl_shr, 1108 }; 1109 1110 943 1111 /** Function table for the SAR instruction. */ 944 1112 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_sar = … … 948 1116 iemAImpl_sar_u32, 949 1117 iemAImpl_sar_u64 1118 }; 1119 1120 /** Function table for the SAR instruction, AMD EFLAGS variant. */ 1121 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_sar_amd = 1122 { 1123 iemAImpl_sar_u8_amd, 1124 iemAImpl_sar_u16_amd, 1125 iemAImpl_sar_u32_amd, 1126 iemAImpl_sar_u64_amd 1127 }; 1128 1129 /** Function table for the SAR instruction, Intel EFLAGS variant. */ 1130 IEM_STATIC const IEMOPSHIFTSIZES g_iemAImpl_sar_intel = 1131 { 1132 iemAImpl_sar_u8_intel, 1133 iemAImpl_sar_u16_intel, 1134 iemAImpl_sar_u32_intel, 1135 iemAImpl_sar_u64_intel 1136 }; 1137 1138 /** EFLAGS variation selection table for the SAR instruction. */ 1139 IEM_STATIC const IEMOPSHIFTSIZES * const g_iemAImpl_sar_eflags[] = 1140 { 1141 &g_iemAImpl_sar, 1142 &g_iemAImpl_sar_intel, 1143 &g_iemAImpl_sar_amd, 1144 &g_iemAImpl_sar, 950 1145 }; 951 1146 -
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r94162 r94163 1327 1327 %macro IEMIMPL_SHIFT_OP 3 1328 1328 BEGINCODE 1329 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8_intel, 12 1330 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8_amd, 12 1329 1331 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8, 12 1330 1332 PROLOGUE_3_ARGS … … 1341 1343 ENDPROC iemAImpl_ %+ %1 %+ _u8 1342 1344 1345 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16_intel, 12 1346 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16_amd, 12 1343 1347 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 12 1344 1348 PROLOGUE_3_ARGS … … 1355 1359 ENDPROC iemAImpl_ %+ %1 %+ _u16 1356 1360 1361 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32_intel, 12 1362 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32_amd, 12 1357 1363 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 1358 1364 PROLOGUE_3_ARGS … … 1370 1376 1371 1377 %ifdef RT_ARCH_AMD64 1378 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64_intel, 12 1379 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64_amd, 12 1372 1380 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 12 1373 1381 PROLOGUE_3_ARGS -
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r94162 r94163 2342 2342 */ 2343 2343 2344 /** 2345 * Updates the status bits (OF and CF) for an ROL instruction. 2346 * 2347 * @returns Status bits. 2348 * @param a_pfEFlags Pointer to the 32-bit EFLAGS value to update. 2349 * @param a_uResult Unsigned result value. 2350 * @param a_cBitsWidth The width of the result (8, 16, 32, 64). 2351 */ 2352 #define IEM_EFL_UPDATE_STATUS_BITS_FOR_ROL(a_pfEFlags, a_uResult, a_cBitsWidth) do { \ 2344 #define EMIT_ROL(a_cBitsWidth, a_Suffix, a_fIntelFlags, a_fnHlp) \ 2345 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_rol_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ## _t *puDst, \ 2346 uint8_t cShift, uint32_t *pfEFlags)) \ 2347 { \ 2348 cShift &= a_cBitsWidth - 1; \ 2349 if (cShift) \ 2350 { \ 2351 uint ## a_cBitsWidth ## _t const uDst = *puDst; \ 2352 uint ## a_cBitsWidth ## _t const uResult = a_fnHlp(uDst, cShift); \ 2353 *puDst = uResult; \ 2354 \ 2353 2355 /* Calc EFLAGS. The OF bit is undefined if cShift > 1, we implement \ 2354 2356 it the same way as for 1 bit shifts. */ \ 2355 2357 AssertCompile(X86_EFL_CF_BIT == 0); \ 2356 uint32_t fEflTmp = *(a_pfEFlags); \ 2357 fEflTmp &= ~(X86_EFL_CF | X86_EFL_OF); \ 2358 uint32_t const fCarry = ((a_uResult) & X86_EFL_CF); \ 2359 fEflTmp |= fCarry; \ 2360 fEflTmp |= (((a_uResult) >> (a_cBitsWidth - 1)) ^ fCarry) << X86_EFL_OF_BIT; \ 2361 *(a_pfEFlags) = fEflTmp; \ 2362 } while (0) 2363 2364 IEM_DECL_IMPL_DEF(void, iemAImpl_rol_u64,(uint64_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2365 { 2366 cShift &= 63; 2367 if (cShift) 2368 { 2369 uint64_t uResult = ASMRotateLeftU64(*puDst, cShift); 2370 *puDst = uResult; 2371 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROL(pfEFlags, uResult, 64); 2372 } 2373 } 2374 2375 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2376 2377 IEM_DECL_IMPL_DEF(void, iemAImpl_rol_u32,(uint32_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2378 { 2379 cShift &= 31; 2380 if (cShift) 2381 { 2382 uint32_t uResult = ASMRotateLeftU32(*puDst, cShift); 2383 *puDst = uResult; 2384 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROL(pfEFlags, uResult, 32); 2385 } 2386 } 2387 2388 2389 IEM_DECL_IMPL_DEF(void, iemAImpl_rol_u16,(uint16_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2390 { 2391 cShift &= 15; 2392 if (cShift) 2393 { 2394 uint16_t uDst = *puDst; 2395 uint16_t uResult = (uDst << cShift) | (uDst >> (16 - cShift)); 2396 *puDst = uResult; 2397 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROL(pfEFlags, uResult, 16); 2398 } 2399 } 2400 2401 2402 IEM_DECL_IMPL_DEF(void, iemAImpl_rol_u8,(uint8_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2403 { 2404 cShift &= 7; 2405 if (cShift) 2406 { 2407 uint8_t uDst = *puDst; 2408 uint8_t uResult = (uDst << cShift) | (uDst >> (8 - cShift)); 2409 *puDst = uResult; 2410 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROL(pfEFlags, uResult, 8); 2411 } 2412 } 2413 2358 uint32_t fEfl = *pfEFlags; \ 2359 fEfl &= ~(X86_EFL_CF | X86_EFL_OF); \ 2360 uint32_t const fCarry = (uResult & X86_EFL_CF); \ 2361 fEfl |= fCarry; \ 2362 if (!a_fIntelFlags) /* AMD 3990X: According to the last sub-shift: */ \ 2363 fEfl |= ((uResult >> (a_cBitsWidth - 1)) ^ fCarry) << X86_EFL_OF_BIT; \ 2364 else /* Intel 10980XE: According to the first sub-shift: */ \ 2365 fEfl |= X86_EFL_GET_OF_ ## a_cBitsWidth(uDst ^ (uDst << 1)); \ 2366 *pfEFlags = fEfl; \ 2367 } \ 2368 } 2369 EMIT_ROL(64, RT_NOTHING, 1, ASMRotateLeftU64) 2370 EMIT_ROL(64, _intel, 1, ASMRotateLeftU64) 2371 EMIT_ROL(64, _amd, 0, ASMRotateLeftU64) 2372 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2373 EMIT_ROL(32, RT_NOTHING, 1, ASMRotateLeftU32) 2374 EMIT_ROL(32, _intel, 1, ASMRotateLeftU32) 2375 EMIT_ROL(32, _amd, 0, ASMRotateLeftU32) 2376 2377 DECL_FORCE_INLINE(uint16_t) iemAImpl_rol_u16_hlp(uint16_t uValue, uint8_t cShift) 2378 { 2379 return (uValue << cShift) | (uValue >> (16 - cShift)); 2380 } 2381 EMIT_ROL(16, RT_NOTHING, 1, iemAImpl_rol_u16_hlp) 2382 EMIT_ROL(16, _intel, 1, iemAImpl_rol_u16_hlp) 2383 EMIT_ROL(16, _amd, 0, iemAImpl_rol_u16_hlp) 2384 2385 DECL_FORCE_INLINE(uint8_t) iemAImpl_rol_u8_hlp(uint8_t uValue, uint8_t cShift) 2386 { 2387 return (uValue << cShift) | (uValue >> (8 - cShift)); 2388 } 2389 EMIT_ROL(8, RT_NOTHING, 1, iemAImpl_rol_u8_hlp) 2390 EMIT_ROL(8, _intel, 1, iemAImpl_rol_u8_hlp) 2391 EMIT_ROL(8, _amd, 0, iemAImpl_rol_u8_hlp) 2414 2392 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */ 2415 2393 … … 2418 2396 * ROR 2419 2397 */ 2420 2421 /** 2422 * Updates the status bits (OF and CF) for an ROL instruction.2423 * 2424 * @returns Status bits.2425 * @param a_pfEFlags Pointer to the 32-bit EFLAGS value to update.2426 * @param a_uResult Unsigned result value.2427 * @param a_cBitsWidth The width of the result (8, 16, 32, 64).2428 */2429 #define IEM_EFL_UPDATE_STATUS_BITS_FOR_ROR(a_pfEFlags, a_uResult, a_cBitsWidth) do {\2430 /* Calc EFLAGS. The OF bit is undefined if cShift > 1, we implement\2431 it the same way as for 1 bit shifts.*/ \2398 #define EMIT_ROR(a_cBitsWidth, a_Suffix, a_fIntelFlags, a_fnHlp) \ 2399 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_ror_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ## _t *puDst, \ 2400 uint8_t cShift, uint32_t *pfEFlags)) \ 2401 { \ 2402 cShift &= a_cBitsWidth - 1; \ 2403 if (cShift) \ 2404 { \ 2405 uint ## a_cBitsWidth ## _t const uDst = *puDst; \ 2406 uint ## a_cBitsWidth ## _t const uResult = a_fnHlp(uDst, cShift); \ 2407 *puDst = uResult; \ 2408 \ 2409 /* Calc EFLAGS: */ \ 2432 2410 AssertCompile(X86_EFL_CF_BIT == 0); \ 2433 uint32_t fEflTmp = *(a_pfEFlags); \ 2434 fEflTmp &= ~(X86_EFL_CF | X86_EFL_OF); \ 2435 uint32_t const fCarry = ((a_uResult) >> ((a_cBitsWidth) - 1)) & X86_EFL_CF; \ 2436 fEflTmp |= fCarry; \ 2437 fEflTmp |= ((((a_uResult) >> ((a_cBitsWidth) - 2)) ^ fCarry) & 1) << X86_EFL_OF_BIT; \ 2438 *(a_pfEFlags) = fEflTmp; \ 2439 } while (0) 2440 2441 IEM_DECL_IMPL_DEF(void, iemAImpl_ror_u64,(uint64_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2442 { 2443 cShift &= 63; 2444 if (cShift) 2445 { 2446 uint64_t const uResult = ASMRotateRightU64(*puDst, cShift); 2447 *puDst = uResult; 2448 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROR(pfEFlags, uResult, 64); 2449 } 2450 } 2451 2452 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2453 2454 IEM_DECL_IMPL_DEF(void, iemAImpl_ror_u32,(uint32_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2455 { 2456 cShift &= 31; 2457 if (cShift) 2458 { 2459 uint64_t const uResult = ASMRotateRightU32(*puDst, cShift); 2460 *puDst = uResult; 2461 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROR(pfEFlags, uResult, 32); 2462 } 2463 } 2464 2465 2466 IEM_DECL_IMPL_DEF(void, iemAImpl_ror_u16,(uint16_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2467 { 2468 cShift &= 15; 2469 if (cShift) 2470 { 2471 uint16_t uDst = *puDst; 2472 uint16_t uResult; 2473 uResult = uDst >> cShift; 2474 uResult |= uDst << (16 - cShift); 2475 *puDst = uResult; 2476 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROR(pfEFlags, uResult, 16); 2477 } 2478 } 2479 2480 2481 IEM_DECL_IMPL_DEF(void, iemAImpl_ror_u8,(uint8_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) 2482 { 2483 cShift &= 7; 2484 if (cShift) 2485 { 2486 uint8_t uDst = *puDst; 2487 uint8_t uResult; 2488 uResult = uDst >> cShift; 2489 uResult |= uDst << (8 - cShift); 2490 *puDst = uResult; 2491 IEM_EFL_UPDATE_STATUS_BITS_FOR_ROR(pfEFlags, uResult, 8); 2492 } 2493 } 2494 2411 uint32_t fEfl = *pfEFlags; \ 2412 fEfl &= ~(X86_EFL_CF | X86_EFL_OF); \ 2413 uint32_t const fCarry = (uResult >> ((a_cBitsWidth) - 1)) & X86_EFL_CF; \ 2414 fEfl |= fCarry; \ 2415 if (!a_fIntelFlags) /* AMD 3990X: According to the last sub-shift: */ \ 2416 fEfl |= (((uResult >> ((a_cBitsWidth) - 2)) ^ fCarry) & 1) << X86_EFL_OF_BIT; \ 2417 else /* Intel 10980XE: According to the first sub-shift: */ \ 2418 fEfl |= X86_EFL_GET_OF_ ## a_cBitsWidth(uDst ^ (uDst << (a_cBitsWidth - 1))); \ 2419 *pfEFlags = fEfl; \ 2420 } \ 2421 } 2422 EMIT_ROR(64, RT_NOTHING, 1, ASMRotateRightU64) 2423 EMIT_ROR(64, _intel, 1, ASMRotateRightU64) 2424 EMIT_ROR(64, _amd, 0, ASMRotateRightU64) 2425 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2426 EMIT_ROR(32, RT_NOTHING, 1, ASMRotateRightU32) 2427 EMIT_ROR(32, _intel, 1, ASMRotateRightU32) 2428 EMIT_ROR(32, _amd, 0, ASMRotateRightU32) 2429 2430 DECL_FORCE_INLINE(uint16_t) iemAImpl_ror_u16_hlp(uint16_t uValue, uint8_t cShift) 2431 { 2432 return (uValue >> cShift) | (uValue << (16 - cShift)); 2433 } 2434 EMIT_ROR(16, RT_NOTHING, 1, iemAImpl_ror_u16_hlp) 2435 EMIT_ROR(16, _intel, 1, iemAImpl_ror_u16_hlp) 2436 EMIT_ROR(16, _amd, 0, iemAImpl_ror_u16_hlp) 2437 2438 DECL_FORCE_INLINE(uint8_t) iemAImpl_ror_u8_hlp(uint8_t uValue, uint8_t cShift) 2439 { 2440 return (uValue >> cShift) | (uValue << (8 - cShift)); 2441 } 2442 EMIT_ROR(8, RT_NOTHING, 1, iemAImpl_ror_u8_hlp) 2443 EMIT_ROR(8, _intel, 1, iemAImpl_ror_u8_hlp) 2444 EMIT_ROR(8, _amd, 0, iemAImpl_ror_u8_hlp) 2495 2445 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */ 2496 2446 … … 2499 2449 * RCL 2500 2450 */ 2501 #define EMIT_RCL(a_cBitsWidth) \ 2502 IEM_DECL_IMPL_DEF(void, iemAImpl_rcl_u ## a_cBitsWidth,(uint ## a_cBitsWidth ## _t *puDst, uint8_t cShift, uint32_t *pfEFlags)) \ 2451 #define EMIT_RCL(a_cBitsWidth, a_Suffix, a_fIntelFlags) \ 2452 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_rcl_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ## _t *puDst, \ 2453 uint8_t cShift, uint32_t *pfEFlags)) \ 2503 2454 { \ 2504 2455 cShift &= a_cBitsWidth - 1; \ … … 2510 2461 uResult |= uDst >> (a_cBitsWidth + 1 - cShift); \ 2511 2462 \ 2512 uint32_t fEfl = *pfEFlags; \2513 2463 AssertCompile(X86_EFL_CF_BIT == 0); \ 2514 uResult |= (uint ## a_cBitsWidth ## _t)(fEfl & X86_EFL_CF) << (cShift - 1); \ 2464 uint32_t fEfl = *pfEFlags; \ 2465 uint32_t fInCarry = fEfl & X86_EFL_CF; \ 2466 uResult |= (uint ## a_cBitsWidth ## _t)fInCarry << (cShift - 1); \ 2515 2467 \ 2516 2468 *puDst = uResult; \ 2517 2469 \ 2518 /* Calc EFLAGS. The OF bit is undefined if cShift > 1, we implement \ 2519 it the same way as for 1 bit shifts. */ \ 2470 /* Calc EFLAGS. */ \ 2520 2471 fEfl &= ~(X86_EFL_CF | X86_EFL_OF); \ 2521 uint32_t const fCarry = (uDst >> (a_cBitsWidth - cShift)) & X86_EFL_CF; \ 2522 fEfl |= fCarry; \ 2523 fEfl |= ((uResult >> (a_cBitsWidth - 1)) ^ fCarry) << X86_EFL_OF_BIT; \ 2472 uint32_t const fOutCarry = (uDst >> (a_cBitsWidth - cShift)) & X86_EFL_CF; \ 2473 fEfl |= fOutCarry; \ 2474 if (!a_fIntelFlags) /* AMD 3990X: According to the last sub-shift: */ \ 2475 fEfl |= ((uResult >> (a_cBitsWidth - 1)) ^ fOutCarry) << X86_EFL_OF_BIT; \ 2476 else /* Intel 10980XE: According to the first sub-shift: */ \ 2477 fEfl |= X86_EFL_GET_OF_ ## a_cBitsWidth(uDst ^ (uDst << 1) ); \ 2524 2478 *pfEFlags = fEfl; \ 2525 2479 } \ 2526 2480 } 2527 EMIT_RCL(64) 2528 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2529 EMIT_RCL(32) 2530 EMIT_RCL(16) 2531 EMIT_RCL(8) 2481 EMIT_RCL(64, RT_NOTHING, 1) 2482 EMIT_RCL(64, _intel, 1) 2483 EMIT_RCL(64, _amd, 0) 2484 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2485 EMIT_RCL(32, RT_NOTHING, 1) 2486 EMIT_RCL(32, _intel, 1) 2487 EMIT_RCL(32, _amd, 0) 2488 EMIT_RCL(16, RT_NOTHING, 1) 2489 EMIT_RCL(16, _intel, 1) 2490 EMIT_RCL(16, _amd, 0) 2491 EMIT_RCL(8, RT_NOTHING, 1) 2492 EMIT_RCL(8, _intel, 1) 2493 EMIT_RCL(8, _amd, 0) 2532 2494 # endif 2533 2495 … … 2536 2498 * RCR 2537 2499 */ 2538 #define EMIT_RCR(a_cBitsWidth) \ 2539 IEM_DECL_IMPL_DEF(void, iemAImpl_rcr_u ## a_cBitsWidth,(uint ## a_cBitsWidth ##_t *puDst, uint8_t cShift, uint32_t *pfEFlags)) \ 2500 #define EMIT_RCR(a_cBitsWidth, a_Suffix, a_fIntelFlags) \ 2501 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_rcr_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ##_t *puDst, \ 2502 uint8_t cShift, uint32_t *pfEFlags)) \ 2540 2503 { \ 2541 2504 cShift &= a_cBitsWidth - 1; \ … … 2548 2511 \ 2549 2512 AssertCompile(X86_EFL_CF_BIT == 0); \ 2550 uint32_t fEfl = *pfEFlags; \ 2551 uResult |= (uint ## a_cBitsWidth ## _t)(fEfl & X86_EFL_CF) << (a_cBitsWidth - cShift); \ 2513 uint32_t fEfl = *pfEFlags; \ 2514 uint32_t fInCarry = fEfl & X86_EFL_CF; \ 2515 uResult |= (uint ## a_cBitsWidth ## _t)fInCarry << (a_cBitsWidth - cShift); \ 2552 2516 *puDst = uResult; \ 2553 2517 \ … … 2555 2519 it the same way as for 1 bit shifts. */ \ 2556 2520 fEfl &= ~(X86_EFL_CF | X86_EFL_OF); \ 2557 uint32_t const fCarry = (uDst >> (cShift - 1)) & X86_EFL_CF; \ 2558 fEfl |= fCarry; \ 2559 fEfl |= X86_EFL_GET_OF_ ## a_cBitsWidth(uResult ^ (uResult << 1)); /* XOR two most signficant bits of the result */ \ 2521 uint32_t const fOutCarry = (uDst >> (cShift - 1)) & X86_EFL_CF; \ 2522 fEfl |= fOutCarry; \ 2523 if (!a_fIntelFlags) /* AMD 3990X: XOR two most signficant bits of the result: */ \ 2524 fEfl |= X86_EFL_GET_OF_ ## a_cBitsWidth(uResult ^ (uResult << 1)); \ 2525 else /* Intel 10980XE: same as AMD, but only for the first sub-shift: */ \ 2526 fEfl |= (fInCarry ^ (uint32_t)(uDst >> (a_cBitsWidth - 1))) << X86_EFL_OF_BIT; \ 2560 2527 *pfEFlags = fEfl; \ 2561 2528 } \ 2562 2529 } 2563 EMIT_RCR(64) 2564 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2565 EMIT_RCR(32) 2566 EMIT_RCR(16) 2567 EMIT_RCR(8) 2530 EMIT_RCR(64, RT_NOTHING, 1) 2531 EMIT_RCR(64, _intel, 1) 2532 EMIT_RCR(64, _amd, 0) 2533 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2534 EMIT_RCR(32, RT_NOTHING, 1) 2535 EMIT_RCR(32, _intel, 1) 2536 EMIT_RCR(32, _amd, 0) 2537 EMIT_RCR(16, RT_NOTHING, 1) 2538 EMIT_RCR(16, _intel, 1) 2539 EMIT_RCR(16, _amd, 0) 2540 EMIT_RCR(8, RT_NOTHING, 1) 2541 EMIT_RCR(8, _intel, 1) 2542 EMIT_RCR(8, _amd, 0) 2568 2543 # endif 2569 2544 … … 2572 2547 * SHL 2573 2548 */ 2574 #define EMIT_SHL(a_cBitsWidth) \ 2575 IEM_DECL_IMPL_DEF(void, iemAImpl_shl_u ## a_cBitsWidth,(uint ## a_cBitsWidth ## _t *puDst, uint8_t cShift, uint32_t *pfEFlags)) \ 2549 #define EMIT_SHL(a_cBitsWidth, a_Suffix, a_fIntelFlags) \ 2550 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_shl_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ## _t *puDst, \ 2551 uint8_t cShift, uint32_t *pfEFlags)) \ 2576 2552 { \ 2577 2553 cShift &= a_cBitsWidth - 1; \ … … 2582 2558 *puDst = uResult; \ 2583 2559 \ 2584 /* Calc EFLAGS. The OF bit is undefined if cShift > 1, we implement \ 2585 it the same way as for 1 bit shifts. The AF bit is undefined, but 2586 AMD 3990x sets it unconditionally so we do the same. */ \ 2560 /* Calc EFLAGS. */ \ 2587 2561 AssertCompile(X86_EFL_CF_BIT == 0); \ 2588 2562 uint32_t fEfl = *pfEFlags & ~X86_EFL_STATUS_BITS; \ 2589 2563 uint32_t fCarry = (uDst >> (a_cBitsWidth - cShift)) & X86_EFL_CF; \ 2590 2564 fEfl |= fCarry; \ 2591 fEfl |= ((uResult >> (a_cBitsWidth - 1)) ^ fCarry) << X86_EFL_OF_BIT; \ 2565 if (!a_fIntelFlags) \ 2566 fEfl |= ((uResult >> (a_cBitsWidth - 1)) ^ fCarry) << X86_EFL_OF_BIT; /* AMD 3990X: Last shift result. */ \ 2567 else \ 2568 fEfl |= X86_EFL_GET_OF_ ## a_cBitsWidth(uDst ^ (uDst << 1)); /* Intel 10980XE: First shift result. */ \ 2592 2569 fEfl |= X86_EFL_CALC_SF(uResult, a_cBitsWidth); \ 2593 2570 fEfl |= X86_EFL_CALC_ZF(uResult); \ 2594 2571 fEfl |= g_afParity[uResult & 0xff]; \ 2595 fEfl |= X86_EFL_AF; /* AMD 3990x sets it unconditionally */ \ 2572 if (!a_fIntelFlags) \ 2573 fEfl |= X86_EFL_AF; /* AMD 3990x sets it unconditionally, Intel 10980XE does the oposite */ \ 2596 2574 *pfEFlags = fEfl; \ 2597 2575 } \ 2598 2576 } 2599 EMIT_SHL(64) 2600 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2601 EMIT_SHL(32) 2602 EMIT_SHL(16) 2603 EMIT_SHL(8) 2577 EMIT_SHL(64, RT_NOTHING, 1) 2578 EMIT_SHL(64, _intel, 1) 2579 EMIT_SHL(64, _amd, 0) 2580 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2581 EMIT_SHL(32, RT_NOTHING, 1) 2582 EMIT_SHL(32, _intel, 1) 2583 EMIT_SHL(32, _amd, 0) 2584 EMIT_SHL(16, RT_NOTHING, 1) 2585 EMIT_SHL(16, _intel, 1) 2586 EMIT_SHL(16, _amd, 0) 2587 EMIT_SHL(8, RT_NOTHING, 1) 2588 EMIT_SHL(8, _intel, 1) 2589 EMIT_SHL(8, _amd, 0) 2604 2590 # endif 2605 2591 … … 2608 2594 * SHR 2609 2595 */ 2610 #define EMIT_SHR(a_cBitsWidth) \ 2611 IEM_DECL_IMPL_DEF(void, iemAImpl_shr_u ## a_cBitsWidth,(uint ## a_cBitsWidth ## _t *puDst, uint8_t cShift, uint32_t *pfEFlags)) \ 2596 #define EMIT_SHR(a_cBitsWidth, a_Suffix, a_fIntelFlags) \ 2597 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_shr_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ## _t *puDst, \ 2598 uint8_t cShift, uint32_t *pfEFlags)) \ 2612 2599 { \ 2613 2600 cShift &= a_cBitsWidth - 1; \ … … 2618 2605 *puDst = uResult; \ 2619 2606 \ 2620 /* Calc EFLAGS. The OF bit is undefined if cShift > 1, we implement \ 2621 it the same way as for 1 bit shifts. The AF bit is undefined, but \ 2622 AMD 3990x sets it unconditionally so we do the same. */ \ 2607 /* Calc EFLAGS. */ \ 2623 2608 AssertCompile(X86_EFL_CF_BIT == 0); \ 2624 2609 uint32_t fEfl = *pfEFlags & ~X86_EFL_STATUS_BITS; \ 2625 2610 fEfl |= (uDst >> (cShift - 1)) & X86_EFL_CF; \ 2626 if ( cShift == 1) /* AMD 3990x does this too, even if only intel documents this. */ \2611 if (a_fIntelFlags || cShift == 1) /* AMD 3990x does what intel documents; Intel 10980XE does this for all shift counts. */ \ 2627 2612 fEfl |= (uDst >> (a_cBitsWidth - 1)) << X86_EFL_OF_BIT; \ 2628 2613 fEfl |= X86_EFL_CALC_SF(uResult, a_cBitsWidth); \ 2629 2614 fEfl |= X86_EFL_CALC_ZF(uResult); \ 2630 2615 fEfl |= g_afParity[uResult & 0xff]; \ 2631 fEfl |= X86_EFL_AF; /* AMD 3990x sets it unconditionally */ \ 2616 if (!a_fIntelFlags) \ 2617 fEfl |= X86_EFL_AF; /* AMD 3990x sets it unconditionally, Intel 10980XE does the oposite */ \ 2632 2618 *pfEFlags = fEfl; \ 2633 2619 } \ 2634 2620 } 2635 EMIT_SHR(64) 2636 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2637 EMIT_SHR(32) 2638 EMIT_SHR(16) 2639 EMIT_SHR(8) 2621 EMIT_SHR(64, RT_NOTHING, 1) 2622 EMIT_SHR(64, _intel, 1) 2623 EMIT_SHR(64, _amd, 0) 2624 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2625 EMIT_SHR(32, RT_NOTHING, 1) 2626 EMIT_SHR(32, _intel, 1) 2627 EMIT_SHR(32, _amd, 0) 2628 EMIT_SHR(16, RT_NOTHING, 1) 2629 EMIT_SHR(16, _intel, 1) 2630 EMIT_SHR(16, _amd, 0) 2631 EMIT_SHR(8, RT_NOTHING, 1) 2632 EMIT_SHR(8, _intel, 1) 2633 EMIT_SHR(8, _amd, 0) 2640 2634 # endif 2641 2635 … … 2644 2638 * SAR 2645 2639 */ 2646 #define EMIT_SAR(a_cBitsWidth) \ 2647 IEM_DECL_IMPL_DEF(void, iemAImpl_sar_u ## a_cBitsWidth,(uint ## a_cBitsWidth ## _t *puDst, uint8_t cShift, uint32_t *pfEFlags)) \ 2640 #define EMIT_SAR(a_cBitsWidth, a_Suffix, a_fIntelFlags) \ 2641 IEM_DECL_IMPL_DEF(void, RT_CONCAT3(iemAImpl_sar_u,a_cBitsWidth,a_Suffix),(uint ## a_cBitsWidth ## _t *puDst, \ 2642 uint8_t cShift, uint32_t *pfEFlags)) \ 2648 2643 { \ 2649 2644 cShift &= a_cBitsWidth - 1; \ … … 2654 2649 *puDst = uResult; \ 2655 2650 \ 2656 /* Calc EFLAGS. The OF bit is undefined if cShift > 1, we implement \ 2657 it the same way as for 1 bit shifts (0). The AF bit is undefined, but \ 2658 AMD 3990x sets it unconditionally so we do the same. The OF flag is \ 2659 zero because the result never differs from the input. */ \ 2651 /* Calc EFLAGS. \ 2652 Note! The OF flag is always zero because the result never differs from the input. */ \ 2660 2653 AssertCompile(X86_EFL_CF_BIT == 0); \ 2661 2654 uint32_t fEfl = *pfEFlags & ~X86_EFL_STATUS_BITS; \ … … 2664 2657 fEfl |= X86_EFL_CALC_ZF(uResult); \ 2665 2658 fEfl |= g_afParity[uResult & 0xff]; \ 2666 fEfl |= X86_EFL_AF; /* AMD 3990x sets it unconditionally */ \ 2659 if (!a_fIntelFlags) \ 2660 fEfl |= X86_EFL_AF; /* AMD 3990x sets it unconditionally, Intel 10980XE does the oposite */ \ 2667 2661 *pfEFlags = fEfl; \ 2668 2662 } \ 2669 2663 } 2670 EMIT_SAR(64) 2671 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2672 EMIT_SAR(32) 2673 EMIT_SAR(16) 2674 EMIT_SAR(8) 2664 EMIT_SAR(64, RT_NOTHING, 1) 2665 EMIT_SAR(64, _intel, 1) 2666 EMIT_SAR(64, _amd, 0) 2667 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 2668 EMIT_SAR(32, RT_NOTHING, 1) 2669 EMIT_SAR(32, _intel, 1) 2670 EMIT_SAR(32, _amd, 0) 2671 EMIT_SAR(16, RT_NOTHING, 1) 2672 EMIT_SAR(16, _intel, 1) 2673 EMIT_SAR(16, _amd, 0) 2674 EMIT_SAR(8, RT_NOTHING, 1) 2675 EMIT_SAR(8, _intel, 1) 2676 EMIT_SAR(8, _amd, 0) 2675 2677 # endif 2676 2678 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsOneByte.cpp.h
r94156 r94163 6014 6014 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 6015 6015 { 6016 case 0: pImpl = &g_iemAImpl_rol; IEMOP_MNEMONIC(rol_Eb_Ib, "rol Eb,Ib"); break;6017 case 1: pImpl = &g_iemAImpl_ror; IEMOP_MNEMONIC(ror_Eb_Ib, "ror Eb,Ib"); break;6018 case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC(rcl_Eb_Ib, "rcl Eb,Ib"); break;6019 case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC(rcr_Eb_Ib, "rcr Eb,Ib"); break;6020 case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC(shl_Eb_Ib, "shl Eb,Ib"); break;6021 case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC(shr_Eb_Ib, "shr Eb,Ib"); break;6022 case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC(sar_Eb_Ib, "sar Eb,Ib"); break;6016 case 0: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rol_eflags); IEMOP_MNEMONIC(rol_Eb_Ib, "rol Eb,Ib"); break; 6017 case 1: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_ror_eflags); IEMOP_MNEMONIC(ror_Eb_Ib, "ror Eb,Ib"); break; 6018 case 2: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcl_eflags); IEMOP_MNEMONIC(rcl_Eb_Ib, "rcl Eb,Ib"); break; 6019 case 3: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcr_eflags); IEMOP_MNEMONIC(rcr_Eb_Ib, "rcr Eb,Ib"); break; 6020 case 4: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shl_eflags); IEMOP_MNEMONIC(shl_Eb_Ib, "shl Eb,Ib"); break; 6021 case 5: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shr_eflags); IEMOP_MNEMONIC(shr_Eb_Ib, "shr Eb,Ib"); break; 6022 case 7: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_sar_eflags); IEMOP_MNEMONIC(sar_Eb_Ib, "sar Eb,Ib"); break; 6023 6023 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 6024 6024 IEM_NOT_REACHED_DEFAULT_CASE_RET(); /* gcc maybe stupid */ … … 6077 6077 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 6078 6078 { 6079 case 0: pImpl = &g_iemAImpl_rol; IEMOP_MNEMONIC(rol_Ev_Ib, "rol Ev,Ib"); break;6080 case 1: pImpl = &g_iemAImpl_ror; IEMOP_MNEMONIC(ror_Ev_Ib, "ror Ev,Ib"); break;6081 case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC(rcl_Ev_Ib, "rcl Ev,Ib"); break;6082 case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC(rcr_Ev_Ib, "rcr Ev,Ib"); break;6083 case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC(shl_Ev_Ib, "shl Ev,Ib"); break;6084 case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC(shr_Ev_Ib, "shr Ev,Ib"); break;6085 case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC(sar_Ev_Ib, "sar Ev,Ib"); break;6079 case 0: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rol_eflags); IEMOP_MNEMONIC(rol_Ev_Ib, "rol Ev,Ib"); break; 6080 case 1: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_ror_eflags); IEMOP_MNEMONIC(ror_Ev_Ib, "ror Ev,Ib"); break; 6081 case 2: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcl_eflags); IEMOP_MNEMONIC(rcl_Ev_Ib, "rcl Ev,Ib"); break; 6082 case 3: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcr_eflags); IEMOP_MNEMONIC(rcr_Ev_Ib, "rcr Ev,Ib"); break; 6083 case 4: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shl_eflags); IEMOP_MNEMONIC(shl_Ev_Ib, "shl Ev,Ib"); break; 6084 case 5: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shr_eflags); IEMOP_MNEMONIC(shr_Ev_Ib, "shr Ev,Ib"); break; 6085 case 7: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_sar_eflags); IEMOP_MNEMONIC(sar_Ev_Ib, "sar Ev,Ib"); break; 6086 6086 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 6087 6087 IEM_NOT_REACHED_DEFAULT_CASE_RET(); /* gcc maybe stupid */ … … 6591 6591 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 6592 6592 { 6593 case 0: pImpl = &g_iemAImpl_rol; IEMOP_MNEMONIC(rol_Eb_1, "rol Eb,1"); break;6594 case 1: pImpl = &g_iemAImpl_ror; IEMOP_MNEMONIC(ror_Eb_1, "ror Eb,1"); break;6595 case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC(rcl_Eb_1, "rcl Eb,1"); break;6596 case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC(rcr_Eb_1, "rcr Eb,1"); break;6597 case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC(shl_Eb_1, "shl Eb,1"); break;6598 case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC(shr_Eb_1, "shr Eb,1"); break;6599 case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC(sar_Eb_1, "sar Eb,1"); break;6593 case 0: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rol_eflags); IEMOP_MNEMONIC(rol_Eb_1, "rol Eb,1"); break; 6594 case 1: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_ror_eflags); IEMOP_MNEMONIC(ror_Eb_1, "ror Eb,1"); break; 6595 case 2: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcl_eflags); IEMOP_MNEMONIC(rcl_Eb_1, "rcl Eb,1"); break; 6596 case 3: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcr_eflags); IEMOP_MNEMONIC(rcr_Eb_1, "rcr Eb,1"); break; 6597 case 4: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shl_eflags); IEMOP_MNEMONIC(shl_Eb_1, "shl Eb,1"); break; 6598 case 5: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shr_eflags); IEMOP_MNEMONIC(shr_Eb_1, "shr Eb,1"); break; 6599 case 7: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_sar_eflags); IEMOP_MNEMONIC(sar_Eb_1, "sar Eb,1"); break; 6600 6600 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 6601 6601 IEM_NOT_REACHED_DEFAULT_CASE_RET(); /* gcc maybe, well... */ … … 6651 6651 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 6652 6652 { 6653 case 0: pImpl = &g_iemAImpl_rol; IEMOP_MNEMONIC(rol_Ev_1, "rol Ev,1"); break;6654 case 1: pImpl = &g_iemAImpl_ror; IEMOP_MNEMONIC(ror_Ev_1, "ror Ev,1"); break;6655 case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC(rcl_Ev_1, "rcl Ev,1"); break;6656 case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC(rcr_Ev_1, "rcr Ev,1"); break;6657 case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC(shl_Ev_1, "shl Ev,1"); break;6658 case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC(shr_Ev_1, "shr Ev,1"); break;6659 case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC(sar_Ev_1, "sar Ev,1"); break;6653 case 0: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rol_eflags); IEMOP_MNEMONIC(rol_Ev_1, "rol Ev,1"); break; 6654 case 1: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_ror_eflags); IEMOP_MNEMONIC(ror_Ev_1, "ror Ev,1"); break; 6655 case 2: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcl_eflags); IEMOP_MNEMONIC(rcl_Ev_1, "rcl Ev,1"); break; 6656 case 3: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcr_eflags); IEMOP_MNEMONIC(rcr_Ev_1, "rcr Ev,1"); break; 6657 case 4: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shl_eflags); IEMOP_MNEMONIC(shl_Ev_1, "shl Ev,1"); break; 6658 case 5: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shr_eflags); IEMOP_MNEMONIC(shr_Ev_1, "shr Ev,1"); break; 6659 case 7: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_sar_eflags); IEMOP_MNEMONIC(sar_Ev_1, "sar Ev,1"); break; 6660 6660 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 6661 6661 IEM_NOT_REACHED_DEFAULT_CASE_RET(); /* gcc maybe, well... */ … … 6786 6786 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 6787 6787 { 6788 case 0: pImpl = &g_iemAImpl_rol; IEMOP_MNEMONIC(rol_Eb_CL, "rol Eb,CL"); break;6789 case 1: pImpl = &g_iemAImpl_ror; IEMOP_MNEMONIC(ror_Eb_CL, "ror Eb,CL"); break;6790 case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC(rcl_Eb_CL, "rcl Eb,CL"); break;6791 case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC(rcr_Eb_CL, "rcr Eb,CL"); break;6792 case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC(shl_Eb_CL, "shl Eb,CL"); break;6793 case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC(shr_Eb_CL, "shr Eb,CL"); break;6794 case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC(sar_Eb_CL, "sar Eb,CL"); break;6788 case 0: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rol_eflags); IEMOP_MNEMONIC(rol_Eb_CL, "rol Eb,CL"); break; 6789 case 1: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_ror_eflags); IEMOP_MNEMONIC(ror_Eb_CL, "ror Eb,CL"); break; 6790 case 2: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcl_eflags); IEMOP_MNEMONIC(rcl_Eb_CL, "rcl Eb,CL"); break; 6791 case 3: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcr_eflags); IEMOP_MNEMONIC(rcr_Eb_CL, "rcr Eb,CL"); break; 6792 case 4: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shl_eflags); IEMOP_MNEMONIC(shl_Eb_CL, "shl Eb,CL"); break; 6793 case 5: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shr_eflags); IEMOP_MNEMONIC(shr_Eb_CL, "shr Eb,CL"); break; 6794 case 7: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_sar_eflags); IEMOP_MNEMONIC(sar_Eb_CL, "sar Eb,CL"); break; 6795 6795 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 6796 6796 IEM_NOT_REACHED_DEFAULT_CASE_RET(); /* gcc, grr. */ … … 6847 6847 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 6848 6848 { 6849 case 0: pImpl = &g_iemAImpl_rol; IEMOP_MNEMONIC(rol_Ev_CL, "rol Ev,CL"); break;6850 case 1: pImpl = &g_iemAImpl_ror; IEMOP_MNEMONIC(ror_Ev_CL, "ror Ev,CL"); break;6851 case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC(rcl_Ev_CL, "rcl Ev,CL"); break;6852 case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC(rcr_Ev_CL, "rcr Ev,CL"); break;6853 case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC(shl_Ev_CL, "shl Ev,CL"); break;6854 case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC(shr_Ev_CL, "shr Ev,CL"); break;6855 case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC(sar_Ev_CL, "sar Ev,CL"); break;6849 case 0: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rol_eflags); IEMOP_MNEMONIC(rol_Ev_CL, "rol Ev,CL"); break; 6850 case 1: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_ror_eflags); IEMOP_MNEMONIC(ror_Ev_CL, "ror Ev,CL"); break; 6851 case 2: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcl_eflags); IEMOP_MNEMONIC(rcl_Ev_CL, "rcl Ev,CL"); break; 6852 case 3: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_rcr_eflags); IEMOP_MNEMONIC(rcr_Ev_CL, "rcr Ev,CL"); break; 6853 case 4: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shl_eflags); IEMOP_MNEMONIC(shl_Ev_CL, "shl Ev,CL"); break; 6854 case 5: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_shr_eflags); IEMOP_MNEMONIC(shr_Ev_CL, "shr Ev,CL"); break; 6855 case 7: pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_sar_eflags); IEMOP_MNEMONIC(sar_Ev_CL, "sar Ev,CL"); break; 6856 6856 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 6857 6857 IEM_NOT_REACHED_DEFAULT_CASE_RET(); /* gcc maybe stupid */
Note:
See TracChangeset
for help on using the changeset viewer.