cidet-instr-1.cpp revision ff454903834d245c742b066ebca74bdeac46d0f4
/* $Id$ */
/** @file
* CPU Instruction Decoding & Execution Tests - First bunch of instructions.
*/
/*
* Copyright (C) 2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "cidet.h"
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/*
* Shorter defines for the EFLAGS to save table space.
*/
#define CF X86_EFL_CF
#define PF X86_EFL_PF
#define AF X86_EFL_AF
#define ZF X86_EFL_ZF
#define SF X86_EFL_SF
#define OF X86_EFL_OF
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
typedef struct CIDET2IN1OUTWITHFLAGSU8ENTRY
{
typedef CIDET2IN1OUTWITHFLAGSU8ENTRY const *PCCIDET2IN1OUTWITHFLAGSU8ENTRY;
typedef struct CIDET2IN1OUTWITHFLAGSU16ENTRY
{
typedef CIDET2IN1OUTWITHFLAGSU16ENTRY const *PCCIDET2IN1OUTWITHFLAGSU16ENTRY;
typedef struct CIDET2IN1OUTWITHFLAGSU32ENTRY
{
typedef CIDET2IN1OUTWITHFLAGSU32ENTRY const *PCCIDET2IN1OUTWITHFLAGSU32ENTRY;
typedef struct CIDET2IN1OUTWITHFLAGSU64ENTRY
{
typedef CIDET2IN1OUTWITHFLAGSU64ENTRY const *PCCIDET2IN1OUTWITHFLAGSU64ENTRY;
typedef struct CIDET2IN1OUTWITHFLAGS
{
{ \
RT_ELEMENTS(s_a8Results), RT_ELEMENTS(s_a16Results), RT_ELEMENTS(s_a32Results), RT_ELEMENTS(s_a64Results), \
}
/**
* storing result in the first and flags.
*
* @returns See FNCIDETSETUPINOUT.
* @param pThis The core CIDET state structure. The InCtx
* and ExpectedCtx members will be modified.
* @param fInvalid When set, get the next invalid operands that will
* cause exceptions/faults.
* @param pResults The result collection.
*/
static int CidetGenericIn2Out1WithFlags(PCIDETCORE pThis, bool fInvalid, CIDET2IN1OUTWITHFLAGS const *pResults)
{
int rc;
if (!fInvalid)
{
if ( !pThis->fHasRegCollisionDirect
&& !pThis->fHasRegCollisionMem)
{
{
case 1:
{
break;
}
case 2:
{
break;
}
case 4:
{
break;
}
case 8:
{
break;
}
default:
AssertFailed();
}
}
else
}
else
rc = VERR_NO_DATA;
return rc;
}
{
static const CIDET2IN1OUTWITHFLAGSU8ENTRY s_a8Results[] =
{
};
static const CIDET2IN1OUTWITHFLAGSU16ENTRY s_a16Results[] =
{
};
static const CIDET2IN1OUTWITHFLAGSU32ENTRY s_a32Results[] =
{
};
static const CIDET2IN1OUTWITHFLAGSU64ENTRY s_a64Results[] =
{
{ UINT64_C(0x0000000000000000), UINT64_C(0x0000000000000000), 0, UINT64_C(0x0000000000000000), ZF | PF },
{ UINT64_C(0xfefdfcfbfaf9f8f7), UINT64_C(0x0102030405060709), 0, UINT64_C(0x0000000000000000), CF | ZF | AF | PF },
{ UINT64_C(0x7efdfcfbfaf9f8f7), UINT64_C(0x8102030405060708), 0, UINT64_C(0xffffffffffffffff), SF | PF },
};
static const CIDET2IN1OUTWITHFLAGS s_Results = CIDET2IN1OUTWITHFLAGS_INITIALIZER(CF | PF | AF | SF | OF);
}
/** First bunch of instructions. */
const CIDETINSTR g_aCidetInstructions1[] =
{
#if 1
{
0, 0 }, CIDET_IF_MODRM
},
#endif
#if 1
{
0, 0 }, CIDET_IF_MODRM
},
#endif
};
/** Number of instruction in the g_aInstructions1 array. */