<commit_before>#include "MA_VU.h"
#include "MIPS.h"
#include "VUShared.h"
#include "VIF.h"

using namespace std;

CMA_VU::CUpper::CUpper() 
: CMIPSInstructionFactory(MIPS_REGSIZE_32)
, m_nFT(0)
, m_nFS(0)
, m_nFD(0)
, m_nBc(0)
, m_nDest(0)
, m_relativePipeTime(0)
{

}

void CMA_VU::CUpper::CompileInstruction(uint32 nAddress, CMipsJitter* codeGen, CMIPS* pCtx)
{
	SetupQuickVariables(nAddress, codeGen, pCtx);

	m_nDest		= (uint8 )((m_nOpcode >> 21) & 0x000F);
	m_nFT		= (uint8 )((m_nOpcode >> 16) & 0x001F);
	m_nFS		= (uint8 )((m_nOpcode >> 11) & 0x001F);
	m_nFD		= (uint8 )((m_nOpcode >>  6) & 0x001F);

	m_nBc		= (uint8 )((m_nOpcode >>  0) & 0x0003);

	((this)->*(m_pOpVector[m_nOpcode & 0x3F]))();

	if(m_nOpcode & 0x80000000)
	{
		LOI(pCtx->m_pMemoryMap->GetInstruction(nAddress - 4));
	}

	if(m_nOpcode & 0x40000000)
	{
		//Force exception checking if microprogram is done
		m_codeGen->PushCst(1);
		m_codeGen->PullRel(offsetof(CMIPS, m_State.nHasException));
	}
}
<commit_msg>Added assert for D and T bits when decoding VU upper instructions and added some comments.<commit_after>#include "MA_VU.h"
#include "MIPS.h"
#include "VUShared.h"
#include "VIF.h"

using namespace std;

CMA_VU::CUpper::CUpper() 
: CMIPSInstructionFactory(MIPS_REGSIZE_32)
, m_nFT(0)
, m_nFS(0)
, m_nFD(0)
, m_nBc(0)
, m_nDest(0)
, m_relativePipeTime(0)
{

}

void CMA_VU::CUpper::CompileInstruction(uint32 nAddress, CMipsJitter* codeGen, CMIPS* pCtx)
{
	SetupQuickVariables(nAddress, codeGen, pCtx);

	m_nDest		= (uint8 )((m_nOpcode >> 21) & 0x000F);
	m_nFT		= (uint8 )((m_nOpcode >> 16) & 0x001F);
	m_nFS		= (uint8 )((m_nOpcode >> 11) & 0x001F);
	m_nFD		= (uint8 )((m_nOpcode >>  6) & 0x001F);

	m_nBc		= (uint8 )((m_nOpcode >>  0) & 0x0003);

	((this)->*(m_pOpVector[m_nOpcode & 0x3F]))();

	//Make sure D and T bit aren't set
	assert((m_nOpcode & 0x18000000) == 0);

	//Check I bit
	if(m_nOpcode & 0x80000000)
	{
		LOI(pCtx->m_pMemoryMap->GetInstruction(nAddress - 4));
	}

	//Check E bit
	if(m_nOpcode & 0x40000000)
	{
		//Force exception checking if microprogram is done
		m_codeGen->PushCst(1);
		m_codeGen->PullRel(offsetof(CMIPS, m_State.nHasException));
	}
}

{'fraction_non_alphanumeric': 0.16728624535315986, 'fraction_numerical': 0.06598513011152417, 'mean_word_length': 4.96398891966759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4587995', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1022, 'n_words': 176}