3bc264992af3416ecba168e6ffae1a334fe79088vboxsync/* $Id$ */
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync/** @file
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * CPU Instruction Decoding & Execution Tests - First bunch of instructions.
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync */
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync/*
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * Copyright (C) 2014 Oracle Corporation
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync *
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * available from http://www.virtualbox.org. This file is free software;
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * you can redistribute it and/or modify it under the terms of the GNU
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * General Public License (GPL) as published by the Free Software
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync *
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * The contents of this file may alternatively be used under the terms
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * of the Common Development and Distribution License Version 1.0
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * VirtualBox OSE distribution, in which case the provisions of the
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * CDDL are applicable instead of those of the GPL.
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync *
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * You may elect to license modified versions of this file under the
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync * terms and conditions of either the GPL or the CDDL or both.
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync */
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync/*******************************************************************************
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync* Header Files *
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync*******************************************************************************/
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync#include "cidet.h"
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#include <VBox/err.h>
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync/*******************************************************************************
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync* Defined Constants And Macros *
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync*******************************************************************************/
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync/*
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * Shorter defines for the EFLAGS to save table space.
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync */
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#undef CF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#undef PF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#undef AF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#undef ZF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#undef SF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#undef OF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define CF X86_EFL_CF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define PF X86_EFL_PF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define AF X86_EFL_AF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define ZF X86_EFL_ZF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define SF X86_EFL_SF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define OF X86_EFL_OF
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync/*******************************************************************************
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync* Structures and Typedefs *
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync*******************************************************************************/
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef struct CIDET2IN1OUTWITHFLAGSU8ENTRY
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint8_t uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint8_t uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint8_t uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync} CIDET2IN1OUTWITHFLAGSU8ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef CIDET2IN1OUTWITHFLAGSU8ENTRY const *PCCIDET2IN1OUTWITHFLAGSU8ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef struct CIDET2IN1OUTWITHFLAGSU16ENTRY
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync} CIDET2IN1OUTWITHFLAGSU16ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef CIDET2IN1OUTWITHFLAGSU16ENTRY const *PCCIDET2IN1OUTWITHFLAGSU16ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef struct CIDET2IN1OUTWITHFLAGSU32ENTRY
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint32_t uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint32_t uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint32_t uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync} CIDET2IN1OUTWITHFLAGSU32ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef CIDET2IN1OUTWITHFLAGSU32ENTRY const *PCCIDET2IN1OUTWITHFLAGSU32ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef struct CIDET2IN1OUTWITHFLAGSU64ENTRY
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint64_t uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint64_t uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint64_t uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync} CIDET2IN1OUTWITHFLAGSU64ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef CIDET2IN1OUTWITHFLAGSU64ENTRY const *PCCIDET2IN1OUTWITHFLAGSU64ENTRY;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsynctypedef struct CIDET2IN1OUTWITHFLAGS
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU8ENTRY pa8Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU16ENTRY pa16Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU32ENTRY pa32Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU64ENTRY pa64Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t c8Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t c16Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t c32Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint16_t c64Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync uint32_t fRelevantEFlags;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync} CIDET2IN1OUTWITHFLAGS;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync#define CIDET2IN1OUTWITHFLAGS_INITIALIZER(a_fRelevantEFlags) \
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync { \
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync &s_a8Results[0], &s_a16Results[0], &s_a32Results[0], &s_a64Results[0], \
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync RT_ELEMENTS(s_a8Results), RT_ELEMENTS(s_a16Results), RT_ELEMENTS(s_a32Results), RT_ELEMENTS(s_a64Results), \
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync (a_fRelevantEFlags) \
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync/**
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * Generic worker for a FNCIDETSETUPINOUT function with two GPR/MEM registers,
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * storing result in the first and flags.
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * @returns See FNCIDETSETUPINOUT.
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * @param pThis The core CIDET state structure. The InCtx
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * and ExpectedCtx members will be modified.
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * @param fInvalid When set, get the next invalid operands that will
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * cause exceptions/faults.
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync * @param pResults The result collection.
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync */
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsyncstatic int CidetGenericIn2Out1WithFlags(PCIDETCORE pThis, bool fInvalid, CIDET2IN1OUTWITHFLAGS const *pResults)
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync int rc;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync Assert(pThis->idxMrmRegOp < 2);
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync Assert(pThis->idxMrmRmOp < 2);
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync Assert(pThis->idxMrmRmOp != pThis->idxMrmRegOp);
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync AssertCompile(RT_ELEMENTS(pThis->aiInOut) >= 4);
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync if (!fInvalid)
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync if ( !pThis->fHasRegCollisionDirect
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync && !pThis->fHasRegCollisionMem)
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->InCtx.rfl &= ~(uint64_t)pResults->fRelevantEFlags;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->ExpectedCtx.rfl &= ~(uint64_t)pResults->fRelevantEFlags;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync switch (pThis->aOperands[0].cb)
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync case 1:
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync uint16_t idx = ++pThis->aiInOut[0] % pResults->c8Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU8ENTRY pEntry = &pResults->pa8Entries[idx];
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = idx ? VINF_SUCCESS : VINF_EOF;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].In.pu8 = pEntry->uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].In.pu8 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->InCtx.rfl |= pEntry->fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].Expected.pu8 = pEntry->uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].Expected.pu8 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->ExpectedCtx.rfl |= pEntry->fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync break;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync case 2:
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync uint16_t idx = ++pThis->aiInOut[1] % pResults->c16Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU16ENTRY pEntry = &pResults->pa16Entries[idx];
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = idx ? VINF_SUCCESS : VINF_EOF;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].In.pu16 = pEntry->uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].In.pu16 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->InCtx.rfl |= pEntry->fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].Expected.pu16 = pEntry->uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].Expected.pu16 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->ExpectedCtx.rfl |= pEntry->fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync break;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync case 4:
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync uint16_t idx = ++pThis->aiInOut[2] % pResults->c32Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU32ENTRY pEntry = &pResults->pa32Entries[idx];
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = idx ? VINF_SUCCESS : VINF_EOF;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].In.pu32 = pEntry->uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].In.pu32 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->InCtx.rfl |= pEntry->fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].Expected.pu32 = pEntry->uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync if (!pThis->aOperands[0].fIsMem)
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync pThis->aOperands[0].Expected.pu32[1] = 0;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].Expected.pu32 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->ExpectedCtx.rfl |= pEntry->fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync break;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync case 8:
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync uint16_t idx = ++pThis->aiInOut[3] % pResults->c64Entries;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync PCCIDET2IN1OUTWITHFLAGSU64ENTRY pEntry = &pResults->pa64Entries[idx];
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = idx ? VINF_SUCCESS : VINF_EOF;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].In.pu64 = pEntry->uIn1;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].In.pu64 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->InCtx.rfl |= pEntry->fEFlagsIn;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[0].Expected.pu64 = pEntry->uOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync *pThis->aOperands[1].Expected.pu64 = pEntry->uIn2;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync pThis->ExpectedCtx.rfl |= pEntry->fEFlagsOut;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync break;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync default:
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync AssertFailed();
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = VERR_INTERNAL_ERROR_3;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync else
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = VERR_NOT_SUPPORTED;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync }
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync else
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync rc = VERR_NO_DATA;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync return rc;
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync}
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsyncstatic DECLCALLBACK(int) cidetInOutAdd(PCIDETCORE pThis, bool fInvalid)
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync{
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync static const CIDET2IN1OUTWITHFLAGSU8ENTRY s_a8Results[] =
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync { UINT8_C(0x00), UINT8_C(0x00), 0, UINT8_C(0x00), ZF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT8_C(0xff), UINT8_C(0x01), 0, UINT8_C(0x00), CF | ZF | AF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT8_C(0x7f), UINT8_C(0x80), 0, UINT8_C(0xff), SF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT8_C(0x01), UINT8_C(0x01), 0, UINT8_C(0x02), 0 },
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync };
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync static const CIDET2IN1OUTWITHFLAGSU16ENTRY s_a16Results[] =
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync { UINT16_C(0x0000), UINT16_C(0x0000), 0, UINT16_C(0x0000), ZF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT16_C(0xfefd), UINT16_C(0x0103), 0, UINT16_C(0x0000), CF | ZF | AF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT16_C(0x8e7d), UINT16_C(0x7182), 0, UINT16_C(0xffff), SF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT16_C(0x0001), UINT16_C(0x0001), 0, UINT16_C(0x0002), 0 },
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync };
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync static const CIDET2IN1OUTWITHFLAGSU32ENTRY s_a32Results[] =
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync { UINT32_C(0x00000000), UINT32_C(0x00000000), 0, UINT32_C(0x00000000), ZF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT32_C(0xfefdfcfb), UINT32_C(0x01020305), 0, UINT32_C(0x00000000), CF | ZF | AF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT32_C(0x8efdfcfb), UINT32_C(0x71020304), 0, UINT32_C(0xffffffff), SF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT32_C(0x00000001), UINT32_C(0x00000001), 0, UINT32_C(0x00000002), 0 },
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync };
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync static const CIDET2IN1OUTWITHFLAGSU64ENTRY s_a64Results[] =
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync {
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync { UINT64_C(0x0000000000000000), UINT64_C(0x0000000000000000), 0, UINT64_C(0x0000000000000000), ZF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT64_C(0xfefdfcfbfaf9f8f7), UINT64_C(0x0102030405060709), 0, UINT64_C(0x0000000000000000), CF | ZF | AF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT64_C(0x7efdfcfbfaf9f8f7), UINT64_C(0x8102030405060708), 0, UINT64_C(0xffffffffffffffff), SF | PF },
ff454903834d245c742b066ebca74bdeac46d0f4vboxsync { UINT64_C(0x0000000000000001), UINT64_C(0x0000000000000001), 0, UINT64_C(0x0000000000000002), 0 },
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync };
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync static const CIDET2IN1OUTWITHFLAGS s_Results = CIDET2IN1OUTWITHFLAGS_INITIALIZER(CF | PF | AF | SF | OF);
c7522a3707ee4cc598fcb8d20bf679649dba09b3vboxsync return CidetGenericIn2Out1WithFlags(pThis, fInvalid, &s_Results);
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync}
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync/** First bunch of instructions. */
3bc264992af3416ecba168e6ffae1a334fe79088vboxsyncconst CIDETINSTR g_aCidetInstructions1[] =
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync{
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync#if 1
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync {
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync "add Eb,Gb", cidetInOutAdd, 1, {0x00, 0, 0}, 0, 2,
25ceded49a517b215750ee9e4193dafec2609db8vboxsync { CIDET_OF_K_GPR | CIDET_OF_Z_BYTE | CIDET_OF_M_RM | CIDET_OF_A_RW,
25ceded49a517b215750ee9e4193dafec2609db8vboxsync CIDET_OF_K_GPR | CIDET_OF_Z_BYTE | CIDET_OF_M_REG | CIDET_OF_A_R,
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync 0, 0 }, CIDET_IF_MODRM
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync },
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync#endif
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync#if 1
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync {
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync "add Ev,Gv", cidetInOutAdd, 1, {0x01, 0, 0}, 0, 2,
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync { CIDET_OF_K_GPR | CIDET_OF_Z_VAR_WDQ | CIDET_OF_M_RM | CIDET_OF_A_RW,
fdf66bdf7b03d58ec33dbc065f2d28e1f7d4986avboxsync CIDET_OF_K_GPR | CIDET_OF_Z_VAR_WDQ | CIDET_OF_M_REG | CIDET_OF_A_R,
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync 0, 0 }, CIDET_IF_MODRM
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync },
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync#endif
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync};
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync/** Number of instruction in the g_aInstructions1 array. */
3bc264992af3416ecba168e6ffae1a334fe79088vboxsyncconst uint32_t g_cCidetInstructions1 = RT_ELEMENTS(g_aCidetInstructions1);
3bc264992af3416ecba168e6ffae1a334fe79088vboxsync