Changeset 101584 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Oct 24, 2023 9:19:18 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r101581 r101584 2605 2605 2606 2606 /** 2607 * Emits code that jumps to @a idxLabel if @a iGprSrc is zero. 2608 * 2609 * The operand size is given by @a f64Bit. 2610 */ 2611 DECLINLINE(uint32_t) iemNativeEmitTestIfGprIsZeroAndJmpToLabel(PIEMRECOMPILERSTATE pReNative, uint32_t off, 2612 uint8_t iGprSrc, bool f64Bit, uint32_t idxLabel) 2613 { 2614 Assert(idxLabel < pReNative->cLabels); 2615 2616 #ifdef RT_ARCH_AMD64 2617 /* test reg32,reg32 / test reg64,reg64 */ 2618 uint8_t * const pbCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 3); 2619 AssertReturn(pbCodeBuf, UINT32_MAX); 2620 if (f64Bit) 2621 pbCodeBuf[off++] = X86_OP_REX_W | (iGprSrc < 8 ? 0 : X86_OP_REX_R | X86_OP_REX_B); 2622 else if (iGprSrc >= 8) 2623 pbCodeBuf[off++] = X86_OP_REX_R | X86_OP_REX_B; 2624 pbCodeBuf[off++] = 0x85; 2625 pbCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iGprSrc & 7, iGprSrc & 7); 2626 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 2627 2628 /* jz idxLabel */ 2629 off = iemNativeEmitJzToLabel(pReNative, off, idxLabel); 2630 2631 #elif defined(RT_ARCH_ARM64) 2632 uint32_t *pu32CodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1); 2633 AssertReturn(pu32CodeBuf, UINT32_MAX); 2634 AssertReturn(iemNativeAddFixup(pReNative, off, idxLabel, kIemNativeFixupType_RelImm19At5), UINT32_MAX); 2635 pu32CodeBuf[off++] = Armv8A64MkInstrCbzCbnz(false /*fJmpIfNotZero*/, 0, f64Bit); 2636 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 2637 2638 #else 2639 # error "Port me!" 2640 #endif 2641 return off; 2642 } 2643 2644 2645 /** 2646 * Emits code that jumps to a new label if @a iGprSrc is zero. 2647 * 2648 * The operand size is given by @a f64Bit. 2649 */ 2650 DECLINLINE(uint32_t) iemNativeEmitTestIfGprIsZeroAndJmpToNewLabel(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGprSrc, 2651 bool f64Bit, IEMNATIVELABELTYPE enmLabelType, uint16_t uData) 2652 { 2653 uint32_t const idxLabel = iemNativeLabelCreate(pReNative, enmLabelType, UINT32_MAX /*offWhere*/, uData); 2654 AssertReturn(idxLabel != UINT32_MAX, UINT32_MAX); 2655 return iemNativeEmitTestIfGprIsZeroAndJmpToLabel(pReNative, off, iGprSrc, f64Bit, idxLabel); 2656 } 2657 2658 2659 2660 /** 2607 2661 * Emits a call to a 64-bit address. 2608 2662 */ … … 2632 2686 2633 2687 2634 2635 2688 /** @} */ 2636 2689
Note:
See TracChangeset
for help on using the changeset viewer.