Changeset 103875 in vbox for trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h
- Timestamp:
- Mar 16, 2024 1:27:39 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h
r103872 r103875 5261 5261 5262 5262 5263 #if defined(RT_ARCH_AMD64) 5264 /** 5265 * Emits code for rotating a 32-bit GPR a fixed number of bits to the left via carry. 5266 */ 5267 DECL_FORCE_INLINE(uint32_t) 5268 iemNativeEmitAmd64RotateGpr32LeftViaCarryEx(PIEMNATIVEINSTR pCodeBuf, uint32_t off, uint8_t iGprDst, uint8_t cShift) 5269 { 5270 Assert(cShift > 0 && cShift < 32); 5271 5272 /* rcl dst, cShift */ 5273 if (iGprDst >= 8) 5274 pCodeBuf[off++] = X86_OP_REX_B; 5275 if (cShift != 1) 5276 { 5277 pCodeBuf[off++] = 0xc1; 5278 pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, 2, iGprDst & 7); 5279 pCodeBuf[off++] = cShift; 5280 } 5281 else 5282 { 5283 pCodeBuf[off++] = 0xd1; 5284 pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, 2, iGprDst & 7); 5285 } 5286 5287 return off; 5288 } 5289 #endif /* RT_ARCH_AMD64 */ 5290 5291 5292 5263 5293 /** 5264 5294 * Emits code for reversing the byte order for a 16-bit value in a 32-bit GPR. … … 6324 6354 #endif 6325 6355 } 6356 6357 6358 #ifdef RT_ARCH_AMD64 6359 /** 6360 * For doing bt on a register. 6361 */ 6362 DECL_INLINE_THROW(uint32_t) 6363 iemNativeEmitAmd64TestBitInGprEx(PIEMNATIVEINSTR pCodeBuf, uint32_t off, uint8_t iGprSrc, uint8_t iBitNo) 6364 { 6365 Assert(iBitNo < 64); 6366 /* bt Ev, imm8 */ 6367 if (iBitNo >= 32) 6368 pCodeBuf[off++] = X86_OP_REX_W | (iGprSrc < 8 ? 0 : X86_OP_REX_B); 6369 else if (iGprSrc >= 8) 6370 pCodeBuf[off++] = X86_OP_REX_B; 6371 pCodeBuf[off++] = 0x0f; 6372 pCodeBuf[off++] = 0xba; 6373 pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, 4, iGprSrc & 7); 6374 pCodeBuf[off++] = iBitNo; 6375 return off; 6376 } 6377 #endif /* RT_ARCH_AMD64 */ 6326 6378 6327 6379
Note:
See TracChangeset
for help on using the changeset viewer.