VirtualBox

Ignore:
Timestamp:
Apr 6, 2017 5:58:25 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114448
Message:

IEM,bs3-cpu-generated-1: Made the current testcases pass on AMD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c

    r66462 r66463  
    121121    /** The encoding. */
    122122    BS3CG1ENC               enmEncoding;
     123    /** The non-invalid encoding.  This differs from enmEncoding when
     124     * Bs3Cg1CalcNoneIntelInvalidEncoding has been called. */
     125    BS3CG1ENC               enmEncodingNonInvalid;
    123126    /** The CPU test / CPU ID. */
    124127    BS3CG1CPU               enmCpuTest;
     
    22192222    {
    22202223        case BS3CG1ENC_MODRM_Gb_Eb:
     2224        case BS3CG1ENC_MODRM_Gv_Ma:
    22212225        case BS3CG1ENC_FIXED:
    22222226            return BS3CG1ENC_FIXED;
     
    27032707
    27042708                    default:
     2709                        if (pThis->enmEncoding != pThis->enmEncodingNonInvalid)
     2710                            goto l_advance_to_next;
    27052711                        return Bs3TestFailedF("Internal error: cbDst=%u idxField=%d (%d) offField=%#x: enmLocation=%u off=%#x idxField=%u",
    27062712                                              cbDst, idxField, idxOp, offField, pThis->aOperands[idxOp].enmLocation,
     
    29172923         * Advance to the next instruction.
    29182924         */
     2925l_advance_to_next:
    29192926        pbCode += cbValue;
    29202927        cbLeft -= cbValue;
     
    34973504         */
    34983505        PCBS3CG1INSTR pInstr = &g_aBs3Cg1Instructions[iInstr];
    3499         pThis->iInstr          = iInstr;
    3500         pThis->pTestHdr        = (PCBS3CG1TESTHDR)&g_abBs3Cg1Tests[pInstr->offTests];
    3501         pThis->fFlags          = pInstr->fFlags;
    3502         pThis->enmEncoding     = (BS3CG1ENC)pInstr->enmEncoding;
    3503         pThis->enmCpuTest      = (BS3CG1CPU)pInstr->enmCpuTest;
    3504         pThis->enmPrefixKind   = (BS3CG1PFXKIND)pInstr->enmPrefixKind;
    3505         pThis->enmXcptType     = (BS3CG1XCPTTYPE)pInstr->enmXcptType;
    3506         pThis->cchMnemonic     = pInstr->cchMnemonic;
     3506        pThis->iInstr                   = iInstr;
     3507        pThis->pTestHdr                 = (PCBS3CG1TESTHDR)&g_abBs3Cg1Tests[pInstr->offTests];
     3508        pThis->fFlags                   = pInstr->fFlags;
     3509        pThis->enmEncoding              = (BS3CG1ENC)pInstr->enmEncoding;
     3510        pThis->enmEncodingNonInvalid    = (BS3CG1ENC)pInstr->enmEncoding;
     3511        pThis->enmCpuTest               = (BS3CG1CPU)pInstr->enmCpuTest;
     3512        pThis->enmPrefixKind            = (BS3CG1PFXKIND)pInstr->enmPrefixKind;
     3513        pThis->enmXcptType              = (BS3CG1XCPTTYPE)pInstr->enmXcptType;
     3514        pThis->cchMnemonic              = pInstr->cchMnemonic;
    35073515        if (pThis->fAdvanceMnemonic)
    35083516            Bs3TestSubF("%s / %.*s", pThis->pszModeShort, pThis->cchMnemonic, pThis->pchMnemonic);
    3509         pThis->fAdvanceMnemonic = pInstr->fAdvanceMnemonic;
    3510         pThis->cOperands       = pInstr->cOperands;
    3511         pThis->cbOpcodes       = pInstr->cbOpcodes;
     3517        pThis->fAdvanceMnemonic         = pInstr->fAdvanceMnemonic;
     3518        pThis->cOperands                = pInstr->cOperands;
     3519        pThis->cbOpcodes                = pInstr->cbOpcodes;
    35123520        switch (pThis->cOperands)
    35133521        {
     
    35173525            case 1: pThis->aenmOperands[0] = (BS3CG1OP)pThis->pabOperands[0];
    35183526        }
    3519 
    35203527        switch (pThis->cbOpcodes)
    35213528        {
     
    35263533        }
    35273534
    3528         /* Switch the encoder for some of the invalid instructions on non-intel CPUs. */
    3529         if (   (pThis->fFlags & BS3CG1INSTR_F_INTEL_DECODES_INVALID)
    3530             && pThis->bCpuVendor != BS3CPUVENDOR_INTEL
    3531             && (   (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID))
    3532                 || (BS3_MODE_IS_64BIT_CODE(pThis->bMode) && (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT)) ) )
    3533             pThis->enmEncoding = Bs3Cg1CalcNoneIntelInvalidEncoding(pThis->enmEncoding);
    3534 
    35353535        /*
    35363536         * Check if the CPU supports the instruction.
     
    35393539            || (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID)))
    35403540            fOuterInvalidInstr = true;
     3541
     3542        /* Switch the encoder for some of the invalid instructions on non-intel CPUs. */
     3543        if (   (pThis->fFlags & BS3CG1INSTR_F_INTEL_DECODES_INVALID)
     3544            && pThis->bCpuVendor != BS3CPUVENDOR_INTEL
     3545            && (   (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID))
     3546                || (BS3_MODE_IS_64BIT_CODE(pThis->bMode) && (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT))
     3547                || fOuterInvalidInstr ) )
     3548            pThis->enmEncoding = Bs3Cg1CalcNoneIntelInvalidEncoding(pThis->enmEncoding);
    35413549
    35423550        for (iCpuSetup = 0;; iCpuSetup++)
     
    37053713#if 0
    37063714    /* (for debugging) */
    3707     if (bMode != BS3_MODE_PPV86)
     3715    if (bMode < BS3_MODE_LM16)
    37083716        return BS3TESTDOMODE_SKIPPED;
    37093717#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette