Changeset 106200 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 1, 2024 11:37:05 PM (4 months ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstCommonBodyMacros.h
r106061 r106200 56 56 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 57 57 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 58 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \58 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 59 59 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_REG(pVCpu, bRm), u16Dst); \ 60 60 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 79 79 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 80 80 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 81 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \81 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 82 82 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_REG(pVCpu, bRm), u32Dst); \ 83 83 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 103 103 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 104 104 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 105 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \105 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 106 106 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_REG(pVCpu, bRm), u64Dst); \ 107 107 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 138 138 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 139 139 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 140 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \140 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 141 141 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_REG(pVCpu, bRm), u16Dst); \ 142 142 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 163 163 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 164 164 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 165 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \165 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 166 166 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_REG(pVCpu, bRm), u32Dst); \ 167 167 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 189 189 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 190 190 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 191 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \191 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 192 192 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_REG(pVCpu, bRm), u64Dst); \ 193 193 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 232 232 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 233 233 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 234 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \234 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 235 235 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_REG(pVCpu, bRm), u16Dst); \ 236 236 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 255 255 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 256 256 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 257 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \257 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 258 258 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_REG(pVCpu, bRm), u32Dst); \ 259 259 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 279 279 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 280 280 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 281 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \281 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 282 282 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_REG(pVCpu, bRm), u64Dst); \ 283 283 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 314 314 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 315 315 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 316 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \316 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 317 317 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_REG(pVCpu, bRm), u16Dst); \ 318 318 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 339 339 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 340 340 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 341 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \341 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 342 342 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_REG(pVCpu, bRm), u32Dst); \ 343 343 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 365 365 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 366 366 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 367 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \367 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 368 368 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_REG(pVCpu, bRm), u64Dst); \ 369 369 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstOneByte.cpp.h
r106199 r106200 97 97 IEM_MC_FETCH_GREG_U8(u8Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 98 98 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 99 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u8Dst, u8Src, uEFlags, 8); \99 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<8>, u8Dst, u8Src, uEFlags); \ 100 100 IEM_MC_STORE_GREG_U8(IEM_GET_MODRM_RM(pVCpu, a_bRm), u8Dst); \ 101 101 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 176 176 IEM_MC_FETCH_GREG_U8(u8Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 177 177 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 178 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u8Dst, u8Src, uEFlags, 8); \178 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<8>, u8Dst, u8Src, uEFlags); \ 179 179 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 180 180 } IEM_MC_NATIVE_ELSE() { \ … … 205 205 IEM_MC_FETCH_GREG_U8(u8SrcEmit, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 206 206 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 207 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u8Dst, u8SrcEmit, uEFlags, 8); \207 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl)<8>, u8Dst, u8SrcEmit, uEFlags); \ 208 208 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 209 209 } IEM_MC_NATIVE_ELSE() { \ … … 248 248 IEM_MC_FETCH_GREG_U8(u8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 249 249 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 250 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u8Dst, u8Src, uEFlags, 8); \250 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<8>, u8Dst, u8Src, uEFlags); \ 251 251 IEM_MC_STORE_GREG_U8(IEM_GET_MODRM_REG(pVCpu, a_bRm), u8Dst); \ 252 252 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 276 276 IEM_MC_FETCH_GREG_U8(u8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 277 277 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 278 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u8Dst, u8Src, uEFlags, 8); \278 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<8>, u8Dst, u8Src, uEFlags); \ 279 279 IEM_MC_STORE_GREG_U8(IEM_GET_MODRM_REG(pVCpu, a_bRm), u8Dst); \ 280 280 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 308 308 IEM_MC_FETCH_GREG_U8(u8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 309 309 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 310 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u8Dst, u8Src, uEFlags, 8); \310 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<8>, u8Dst, u8Src, uEFlags); \ 311 311 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 312 312 } IEM_MC_NATIVE_ELSE() { \ … … 335 335 IEM_MC_FETCH_GREG_U8(u8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 336 336 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 337 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u8Dst, u8Src, uEFlags, 8); \337 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<8>, u8Dst, u8Src, uEFlags); \ 338 338 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 339 339 } IEM_MC_NATIVE_ELSE() { \ … … 371 371 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 372 372 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 373 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \373 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 374 374 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_RM(pVCpu, a_bRm), u16Dst); \ 375 375 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 394 394 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 395 395 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 396 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \396 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 397 397 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_RM(pVCpu, a_bRm), u32Dst); \ 398 398 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 418 418 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 419 419 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 420 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \420 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 421 421 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_RM(pVCpu, a_bRm), u64Dst); \ 422 422 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ … … 601 601 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 602 602 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 603 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \603 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 604 604 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 605 605 } IEM_MC_NATIVE_ELSE() { \ … … 623 623 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 624 624 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 625 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \625 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 626 626 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 627 627 } IEM_MC_NATIVE_ELSE() { \ … … 645 645 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 646 646 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 647 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \647 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 648 648 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 649 649 } IEM_MC_NATIVE_ELSE() { \ … … 681 681 IEM_MC_FETCH_GREG_U16(u16SrcEmit, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 682 682 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 683 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16SrcEmit, uEFlags, 16); \683 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<16>, u16Dst, u16SrcEmit, uEFlags); \ 684 684 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 685 685 } IEM_MC_NATIVE_ELSE() { \ … … 709 709 IEM_MC_FETCH_GREG_U32(u32SrcEmit, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 710 710 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 711 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32SrcEmit, uEFlags, 32); \711 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<32>, u32Dst, u32SrcEmit, uEFlags); \ 712 712 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 713 713 } IEM_MC_NATIVE_ELSE() { \ … … 737 737 IEM_MC_FETCH_GREG_U64(u64SrcEmit, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 738 738 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 739 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64SrcEmit, uEFlags, 64); \739 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<64>, u64Dst, u64SrcEmit, uEFlags); \ 740 740 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 741 741 } IEM_MC_NATIVE_ELSE() { \ … … 1956 1956 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 1957 1957 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 1958 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \1958 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 1959 1959 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 1960 1960 } IEM_MC_NATIVE_ELSE() { \ … … 1978 1978 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 1979 1979 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 1980 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \1980 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 1981 1981 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 1982 1982 } IEM_MC_NATIVE_ELSE() { \ … … 2000 2000 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2001 2001 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2002 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \2002 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 2003 2003 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2004 2004 } IEM_MC_NATIVE_ELSE() { \ … … 2034 2034 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2035 2035 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2036 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \2036 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<16>, u16Dst, u16Src, uEFlags); \ 2037 2037 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2038 2038 } IEM_MC_NATIVE_ELSE() { \ … … 2058 2058 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2059 2059 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2060 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \2060 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<32>, u32Dst, u32Src, uEFlags); \ 2061 2061 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2062 2062 } IEM_MC_NATIVE_ELSE() { \ … … 2082 2082 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2083 2083 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2084 IEM_MC_NATIVE_EMIT_ 4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \2084 IEM_MC_NATIVE_EMIT_3(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl)<64>, u64Dst, u64Src, uEFlags); \ 2085 2085 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2086 2086 } IEM_MC_NATIVE_ELSE() { \ … … 5780 5780 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { 5781 5781 IEM_MC_LOCAL_EFLAGS(uEFlags); 5782 IEM_MC_NATIVE_EMIT_ 4(iemNativeEmit_test_r_r_efl, u8Src, u8Src, uEFlags, 8);5782 IEM_MC_NATIVE_EMIT_3(iemNativeEmit_test_r_r_efl<8>, u8Src, u8Src, uEFlags); 5783 5783 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5784 5784 } IEM_MC_NATIVE_ELSE() { … … 5824 5824 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { 5825 5825 IEM_MC_LOCAL_EFLAGS(uEFlags); 5826 IEM_MC_NATIVE_EMIT_ 4(iemNativeEmit_test_r_r_efl, u16Src, u16Src, uEFlags, 16);5826 IEM_MC_NATIVE_EMIT_3(iemNativeEmit_test_r_r_efl<16>, u16Src, u16Src, uEFlags); 5827 5827 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5828 5828 } IEM_MC_NATIVE_ELSE() { … … 5844 5844 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { 5845 5845 IEM_MC_LOCAL_EFLAGS(uEFlags); 5846 IEM_MC_NATIVE_EMIT_ 4(iemNativeEmit_test_r_r_efl, u32Src, u32Src, uEFlags, 32);5846 IEM_MC_NATIVE_EMIT_3(iemNativeEmit_test_r_r_efl<32>, u32Src, u32Src, uEFlags); 5847 5847 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5848 5848 } IEM_MC_NATIVE_ELSE() { … … 5864 5864 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { 5865 5865 IEM_MC_LOCAL_EFLAGS(uEFlags); 5866 IEM_MC_NATIVE_EMIT_ 4(iemNativeEmit_test_r_r_efl, u64Src, u64Src, uEFlags, 64);5866 IEM_MC_NATIVE_EMIT_3(iemNativeEmit_test_r_r_efl<64>, u64Src, u64Src, uEFlags); 5867 5867 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5868 5868 } IEM_MC_NATIVE_ELSE() { -
trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h
r106199 r106200 851 851 * set the other flags according to the result. 852 852 */ 853 DECL_INLINE_THROW(uint32_t) 854 iemNativeEmit_and_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 855 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)853 template<uint8_t const a_cOpBits> 854 DECL_INLINE_THROW(uint32_t) 855 iemNativeEmit_and_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 856 856 { 857 857 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 860 860 /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */ 861 861 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 862 0x22, 0x23, cOpBits, idxRegDst, idxRegSrc);862 0x22, 0x23, a_cOpBits, idxRegDst, idxRegSrc); 863 863 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 864 864 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 865 865 866 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);866 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, a_cOpBits, idxRegDst); 867 867 868 868 #elif defined(RT_ARCH_ARM64) 869 869 /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones. */ 870 870 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 871 pCodeBuf[off++] = Armv8A64MkInstrAnds(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);871 pCodeBuf[off++] = Armv8A64MkInstrAnds(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 872 872 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 873 873 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 874 874 875 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);875 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, a_cOpBits, idxRegDst); 876 876 #else 877 877 # error "Port me" … … 938 938 * set the other flags according to the result. 939 939 */ 940 DECL_INLINE_THROW(uint32_t) 941 iemNativeEmit_test_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 942 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)940 template<uint8_t const a_cOpBits> 941 DECL_INLINE_THROW(uint32_t) 942 iemNativeEmit_test_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 943 943 { 944 944 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 948 948 /* On AMD64 we just use the correctly sized TEST instruction harvest the EFLAGS. */ 949 949 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 950 0x84, 0x85, cOpBits, idxRegSrc, idxRegDst);950 0x84, 0x85, a_cOpBits, idxRegSrc, idxRegDst); 951 951 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 952 952 … … 956 956 uint8_t const idxRegResult = iemNativeRegAllocTmp(pReNative, &off); 957 957 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 958 if (cOpBits >= 32)959 pCodeBuf[off++] = Armv8A64MkInstrAnds(idxRegResult, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);958 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 959 pCodeBuf[off++] = Armv8A64MkInstrAnds(idxRegResult, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 960 960 else 961 pCodeBuf[off++] = Armv8A64MkInstrAnd(idxRegResult, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);961 pCodeBuf[off++] = Armv8A64MkInstrAnd(idxRegResult, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 962 962 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 963 963 … … 970 970 971 971 #ifdef RT_ARCH_AMD64 972 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, UINT8_MAX);973 #else 974 if (cOpBits >= 32)975 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegResult);972 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, a_cOpBits, UINT8_MAX); 973 #else 974 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 975 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, a_cOpBits, idxRegResult); 976 976 else 977 off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegResult);977 off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, a_cOpBits, idxRegResult); 978 978 iemNativeRegFreeTmp(pReNative, idxRegResult); 979 979 #endif … … 1043 1043 * set the other flags according to the result. 1044 1044 */ 1045 DECL_INLINE_THROW(uint32_t) 1046 iemNativeEmit_or_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1047 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1045 template<uint8_t const a_cOpBits> 1046 DECL_INLINE_THROW(uint32_t) 1047 iemNativeEmit_or_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1048 1048 { 1049 1049 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1052 1052 /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */ 1053 1053 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 1054 0x0a, 0x0b, cOpBits, idxRegDst, idxRegSrc);1054 0x0a, 0x0b, a_cOpBits, idxRegDst, idxRegSrc); 1055 1055 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1056 1056 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 1057 1057 1058 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);1058 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, a_cOpBits, idxRegDst); 1059 1059 1060 1060 #elif defined(RT_ARCH_ARM64) 1061 1061 /* On ARM64 we use 32-bit OR for the 8-bit and 16-bit bit ones. */ 1062 1062 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 1063 pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);1063 pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 1064 1064 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1065 1065 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 1066 1066 1067 off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);1067 off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, a_cOpBits, idxRegDst); 1068 1068 1069 1069 #else … … 1125 1125 * set the other flags according to the result. 1126 1126 */ 1127 DECL_INLINE_THROW(uint32_t) 1128 iemNativeEmit_xor_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1129 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1127 template<uint8_t const a_cOpBits> 1128 DECL_INLINE_THROW(uint32_t) 1129 iemNativeEmit_xor_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1130 1130 { 1131 1131 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1134 1134 /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */ 1135 1135 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 1136 0x32, 0x33, cOpBits, idxRegDst, idxRegSrc);1136 0x32, 0x33, a_cOpBits, idxRegDst, idxRegSrc); 1137 1137 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1138 1138 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 1139 1139 1140 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);1140 off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, a_cOpBits, idxRegDst); 1141 1141 1142 1142 #elif defined(RT_ARCH_ARM64) 1143 1143 /* On ARM64 we use 32-bit OR for the 8-bit and 16-bit bit ones. */ 1144 1144 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 1145 pCodeBuf[off++] = Armv8A64MkInstrEor(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);1145 pCodeBuf[off++] = Armv8A64MkInstrEor(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 1146 1146 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1147 1147 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 1148 1148 1149 off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);1149 off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, a_cOpBits, idxRegDst); 1150 1150 1151 1151 #else … … 1211 1211 * The ADD instruction will set all status flags. 1212 1212 */ 1213 DECL_INLINE_THROW(uint32_t) 1214 iemNativeEmit_add_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1215 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1213 template<uint8_t const a_cOpBits> 1214 DECL_INLINE_THROW(uint32_t) 1215 iemNativeEmit_add_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1216 1216 { 1217 1217 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1221 1221 /* On AMD64 we just use the correctly sized ADD instruction to get the right EFLAGS.SF value. */ 1222 1222 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 1223 0x02, 0x03, cOpBits, idxRegDst, idxRegSrc);1223 0x02, 0x03, a_cOpBits, idxRegDst, idxRegSrc); 1224 1224 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1225 1225 … … 1235 1235 uint8_t const idxRegDstIn = iemNativeRegAllocTmp(pReNative, &off); 1236 1236 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 4); 1237 if (cOpBits >= 32)1237 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 1238 1238 { 1239 1239 off = iemNativeEmitLoadGprFromGprEx(pCodeBuf, off, idxRegDstIn, idxRegDst); 1240 pCodeBuf[off++] = Armv8A64MkInstrAddReg(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/, true /*fSetFlags*/);1240 pCodeBuf[off++] = Armv8A64MkInstrAddReg(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/, true /*fSetFlags*/); 1241 1241 } 1242 1242 else 1243 1243 { 1244 1244 /* Shift the operands up so we can perform a 32-bit operation and get all four flags. */ 1245 uint32_t const cShift = 32 - cOpBits;1245 uint32_t const cShift = 32 - a_cOpBits; 1246 1246 pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegDstIn, ARMV8_A64_REG_XZR, idxRegDst, false /*f64Bit*/, cShift); 1247 1247 pCodeBuf[off++] = Armv8A64MkInstrAddReg(idxRegDst, idxRegDstIn, idxRegSrc, false /*f64Bit*/, … … 1249 1249 pCodeBuf[off++] = Armv8A64MkInstrLsrImm(idxRegDstIn, idxRegDstIn, cShift, false /*f64Bit*/); 1250 1250 pCodeBuf[off++] = Armv8A64MkInstrLsrImm(idxRegDst, idxRegDst, cShift, false /*f64Bit*/); 1251 cOpBits = 32; 1252 } 1253 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1254 1255 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, idxVarEfl, UINT8_MAX, cOpBits, idxRegDst, 1251 } 1252 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1253 1254 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, idxVarEfl, UINT8_MAX, a_cOpBits > 32 ? a_cOpBits : 32, idxRegDst, 1256 1255 idxRegDstIn, idxRegSrc, false /*fInvertCarry*/, 0); 1257 1256 … … 1338 1337 * The ADC instruction takes CF as input and will set all status flags. 1339 1338 */ 1340 DECL_INLINE_THROW(uint32_t) 1341 iemNativeEmit_adc_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1342 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1339 template<uint8_t const a_cOpBits> 1340 DECL_INLINE_THROW(uint32_t) 1341 iemNativeEmit_adc_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1343 1342 { 1344 1343 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1355 1354 pCodeBuf[off++] = X86_EFL_CF_BIT; 1356 1355 1357 off = iemNativeEmitAmd64OneByteModRmInstrRREx(pCodeBuf, off, 0x12, 0x13, cOpBits, idxRegDst, idxRegSrc);1356 off = iemNativeEmitAmd64OneByteModRmInstrRREx(pCodeBuf, off, 0x12, 0x13, a_cOpBits, idxRegDst, idxRegSrc); 1358 1357 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1359 1358 … … 1372 1371 pCodeBuf[off++] = Armv8A64MkInstrRmif(idxRegEfl, (X86_EFL_CF_BIT - 1) & 63, RT_BIT_32(1) /*fMask=C*/); 1373 1372 off = iemNativeEmitLoadGprFromGprEx(pCodeBuf, off, idxRegDstIn, idxRegDst); 1374 if (cOpBits >= 32)1375 pCodeBuf[off++] = Armv8A64MkInstrAdcs(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);1373 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 1374 pCodeBuf[off++] = Armv8A64MkInstrAdcs(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 1376 1375 else 1377 1376 { … … 1379 1378 doesn't work. So, we have to calculate carry & overflow manually. */ 1380 1379 pCodeBuf[off++] = Armv8A64MkInstrAdc(idxRegDst, idxRegDst, idxRegSrc, false /*f64Bit*/); 1381 pCodeBuf[off++] = Armv8A64MkInstrSetF8SetF16(idxRegDst, cOpBits > 8); /* NZ are okay, CV aren't.*/1382 } 1383 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1384 1385 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, UINT8_MAX, idxRegEfl, cOpBits, idxRegDst,1380 pCodeBuf[off++] = Armv8A64MkInstrSetF8SetF16(idxRegDst, a_cOpBits > 8); /* NZ are okay, CV aren't.*/ 1381 } 1382 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1383 1384 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, UINT8_MAX, idxRegEfl, a_cOpBits, idxRegDst, 1386 1385 idxRegDstIn, idxRegSrc, false /*fInvertCarry*/, 0); 1387 1386 1388 1387 iemNativeRegFreeTmp(pReNative, idxRegDstIn); 1389 1388 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 1390 if (cOpBits < 32)1391 off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxRegDst, RT_BIT_32( cOpBits) - 1U);1389 if RT_CONSTEXPR_IF(a_cOpBits < 32) 1390 off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxRegDst, RT_BIT_32(a_cOpBits) - 1U); 1392 1391 iemNativeVarRegisterRelease(pReNative, idxVarDst); 1393 1392 … … 1467 1466 * The SUB instruction will set all status flags. 1468 1467 */ 1469 DECL_INLINE_THROW(uint32_t) 1470 iemNativeEmit_sub_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1471 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1468 template<uint8_t const a_cOpBits> 1469 DECL_INLINE_THROW(uint32_t) 1470 iemNativeEmit_sub_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1472 1471 { 1473 1472 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1477 1476 /* On AMD64 we just use the correctly sized SUB instruction to get the right EFLAGS.SF value. */ 1478 1477 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 1479 0x2a, 0x2b, cOpBits, idxRegDst, idxRegSrc);1478 0x2a, 0x2b, a_cOpBits, idxRegDst, idxRegSrc); 1480 1479 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1481 1480 … … 1491 1490 uint8_t const idxRegDstIn = iemNativeRegAllocTmp(pReNative, &off); 1492 1491 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 4); 1493 if (cOpBits >= 32)1492 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 1494 1493 { 1495 1494 off = iemNativeEmitLoadGprFromGprEx(pCodeBuf, off, idxRegDstIn, idxRegDst); 1496 pCodeBuf[off++] = Armv8A64MkInstrSubReg(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/, true /*fSetFlags*/);1495 pCodeBuf[off++] = Armv8A64MkInstrSubReg(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/, true /*fSetFlags*/); 1497 1496 } 1498 1497 else 1499 1498 { 1500 1499 /* Shift the operands up so we can perform a 32-bit operation and get all four flags. */ 1501 uint32_t const cShift = 32 - cOpBits;1500 uint32_t const cShift = 32 - a_cOpBits; 1502 1501 pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegDstIn, ARMV8_A64_REG_XZR, idxRegDst, false /*f64Bit*/, cShift); 1503 1502 pCodeBuf[off++] = Armv8A64MkInstrSubReg(idxRegDst, idxRegDstIn, idxRegSrc, false /*f64Bit*/, … … 1505 1504 pCodeBuf[off++] = Armv8A64MkInstrLsrImm(idxRegDstIn, idxRegDstIn, cShift, false /*f64Bit*/); 1506 1505 pCodeBuf[off++] = Armv8A64MkInstrLsrImm(idxRegDst, idxRegDst, cShift, false /*f64Bit*/); 1507 cOpBits = 32; 1508 } 1509 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1510 1511 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, idxVarEfl, UINT8_MAX, cOpBits, idxRegDst, 1506 } 1507 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1508 1509 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, idxVarEfl, UINT8_MAX, a_cOpBits > 32 ? a_cOpBits : 32, idxRegDst, 1512 1510 idxRegDstIn, idxRegSrc, true /*fInvertCarry*/, 0); 1513 1511 … … 1596 1594 * The CMP instruction will set all status flags, but modifies no registers. 1597 1595 */ 1598 DECL_INLINE_THROW(uint32_t) 1599 iemNativeEmit_cmp_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1600 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1596 template<uint8_t const a_cOpBits> 1597 DECL_INLINE_THROW(uint32_t) 1598 iemNativeEmit_cmp_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1601 1599 { 1602 1600 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1606 1604 /* On AMD64 we just use the correctly sized CMP instruction to get the right EFLAGS.SF value. */ 1607 1605 off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off, 1608 0x3a, 0x3b, cOpBits, idxRegDst, idxRegSrc);1606 0x3a, 0x3b, a_cOpBits, idxRegDst, idxRegSrc); 1609 1607 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1610 1608 … … 1620 1618 uint8_t const idxRegResult = iemNativeRegAllocTmp(pReNative, &off); 1621 1619 PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 3); 1622 if (cOpBits >= 32)1623 pCodeBuf[off++] = Armv8A64MkInstrSubReg(idxRegResult, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/, true /*fSetFlags*/);1620 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 1621 pCodeBuf[off++] = Armv8A64MkInstrSubReg(idxRegResult, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/, true /*fSetFlags*/); 1624 1622 else 1625 1623 { 1626 1624 /* Shift the operands up so we can perform a 32-bit operation and get all four flags. */ 1627 uint32_t const cShift = 32 - cOpBits;1625 uint32_t const cShift = 32 - a_cOpBits; 1628 1626 pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegResult, ARMV8_A64_REG_XZR, idxRegDst, false /*f64Bit*/, cShift); 1629 1627 pCodeBuf[off++] = Armv8A64MkInstrSubReg(idxRegResult, idxRegResult, idxRegSrc, false /*f64Bit*/, 1630 1628 true /*fSetFlags*/, cShift); 1631 1629 pCodeBuf[off++] = Armv8A64MkInstrLsrImm(idxRegResult, idxRegResult, cShift, false /*f64Bit*/); 1632 cOpBits = 32; 1633 } 1634 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1635 1636 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, idxVarEfl, UINT8_MAX, cOpBits, idxRegResult, 1630 } 1631 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1632 1633 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, idxVarEfl, UINT8_MAX, a_cOpBits > 32 ? a_cOpBits : 32, idxRegResult, 1637 1634 idxRegDst, idxRegSrc, true /*fInvertCarry*/, 0); 1638 1635 … … 1719 1716 * The SBB instruction takes CF as input and will set all status flags. 1720 1717 */ 1721 DECL_INLINE_THROW(uint32_t) 1722 iemNativeEmit_sbb_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1723 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1718 template<uint8_t const a_cOpBits> 1719 DECL_INLINE_THROW(uint32_t) 1720 iemNativeEmit_sbb_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1724 1721 { 1725 1722 uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/); … … 1735 1732 pCodeBuf[off++] = X86_EFL_CF_BIT; 1736 1733 1737 off = iemNativeEmitAmd64OneByteModRmInstrRREx(pCodeBuf, off, 0x1a, 0x1b, cOpBits, idxRegDst, idxRegSrc);1734 off = iemNativeEmitAmd64OneByteModRmInstrRREx(pCodeBuf, off, 0x1a, 0x1b, a_cOpBits, idxRegDst, idxRegSrc); 1738 1735 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1739 1736 … … 1754 1751 pCodeBuf[off++] = ARMV8_A64_INSTR_CFINV; 1755 1752 off = iemNativeEmitLoadGprFromGprEx(pCodeBuf, off, idxRegDstIn, idxRegDst); 1756 if (cOpBits >= 32)1757 pCodeBuf[off++] = Armv8A64MkInstrSbcs(idxRegDst, idxRegDst, idxRegSrc, cOpBits > 32 /*f64Bit*/);1753 if RT_CONSTEXPR_IF(a_cOpBits >= 32) 1754 pCodeBuf[off++] = Armv8A64MkInstrSbcs(idxRegDst, idxRegDst, idxRegSrc, a_cOpBits > 32 /*f64Bit*/); 1758 1755 else 1759 1756 { … … 1761 1758 doesn't work. So, we have to calculate carry & overflow manually. */ 1762 1759 pCodeBuf[off++] = Armv8A64MkInstrSbc(idxRegDst, idxRegDst, idxRegSrc, false /*f64Bit*/); 1763 pCodeBuf[off++] = Armv8A64MkInstrSetF8SetF16(idxRegDst, cOpBits > 8); /* NZ are okay, CV aren't.*/1764 } 1765 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1766 1767 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, UINT8_MAX, idxRegEfl, cOpBits, idxRegDst,1760 pCodeBuf[off++] = Armv8A64MkInstrSetF8SetF16(idxRegDst, a_cOpBits > 8); /* NZ are okay, CV aren't.*/ 1761 } 1762 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 1763 1764 off = iemNativeEmitEFlagsForArithmetic(pReNative, off, UINT8_MAX, idxRegEfl, a_cOpBits, idxRegDst, 1768 1765 idxRegDstIn, idxRegSrc, true /*fInvertCarry*/, 0); 1769 1766 1770 1767 iemNativeRegFreeTmp(pReNative, idxRegDstIn); 1771 1768 iemNativeVarRegisterRelease(pReNative, idxVarSrc); 1772 if (cOpBits < 32)1773 off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxRegDst, RT_BIT_32( cOpBits) - 1U);1769 if RT_CONSTEXPR_IF(a_cOpBits < 32) 1770 off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxRegDst, RT_BIT_32(a_cOpBits) - 1U); 1774 1771 iemNativeVarRegisterRelease(pReNative, idxVarDst); 1775 1772 … … 1848 1845 1849 1846 1850 DECL_INLINE_THROW(uint32_t) 1851 iemNativeEmit_imul_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1852 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1853 { 1854 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl , cOpBits);1847 template<uint8_t const a_cOpBits> 1848 DECL_INLINE_THROW(uint32_t) 1849 iemNativeEmit_imul_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1850 { 1851 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl); 1855 1852 AssertFailed(); 1856 1853 return iemNativeEmitBrk(pReNative, off, 0x666); … … 1858 1855 1859 1856 1860 DECL_INLINE_THROW(uint32_t) 1861 iemNativeEmit_popcnt_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1862 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1863 { 1864 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl , cOpBits);1857 template<uint8_t const a_cOpBits> 1858 DECL_INLINE_THROW(uint32_t) 1859 iemNativeEmit_popcnt_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1860 { 1861 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl); 1865 1862 AssertFailed(); 1866 1863 return iemNativeEmitBrk(pReNative, off, 0x666); … … 1868 1865 1869 1866 1870 DECL_INLINE_THROW(uint32_t) 1871 iemNativeEmit_tzcnt_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1872 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1873 { 1874 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl , cOpBits);1867 template<uint8_t const a_cOpBits> 1868 DECL_INLINE_THROW(uint32_t) 1869 iemNativeEmit_tzcnt_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1870 { 1871 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl); 1875 1872 AssertFailed(); 1876 1873 return iemNativeEmitBrk(pReNative, off, 0x666); … … 1878 1875 1879 1876 1880 DECL_INLINE_THROW(uint32_t) 1881 iemNativeEmit_lzcnt_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1882 uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl, uint8_t cOpBits)1883 { 1884 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl , cOpBits);1877 template<uint8_t const a_cOpBits> 1878 DECL_INLINE_THROW(uint32_t) 1879 iemNativeEmit_lzcnt_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl) 1880 { 1881 RT_NOREF(idxVarDst, idxVarSrc, idxVarEfl); 1885 1882 AssertFailed(); 1886 1883 return iemNativeEmitBrk(pReNative, off, 0x666);
Note:
See TracChangeset
for help on using the changeset viewer.