mdmx.c 5 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */

/****************************************************************
 * mdmx.c
 * 
 * Implementation of MIPS' signal processing coprocessor extension. 
 * 
 * $Author: blythe $
 * $Date: 2002/05/29 01:09:10 $
 *****************************************************************/

#include "simstats.h"
#include "opcodes.h"
#include "cpu.h"
#include "cpu_state.h"
#include "sim_error.h"
#include "cp0.h"
#include "memref.h"
#include "cpu_stats.h"
#include "hw_events.h"

#define OP(NAME) \
Result NAME(Inst instr, CPUState *P)

MipsOpcodeDesc mipsMDMXOpcodes[];

Result
ExecuteMDMXInstruction(CPUState *P, Inst instr)
{
   uint mdmxFunc = FUNC(instr);
   return mipsMDMXOpcodes[mdmxFunc].func(instr, P);
}

/****************************************************************
 * M D M X   O P C O D E S
 *****************************************************************/

OP(msgnMDMXOp)
{
   return SUCCESS;
}

OP(ceqMDMXOp)
{
   return SUCCESS;
}

OP(pickfMDMXOp)
{
   return SUCCESS;
}

OP(picktMDMXOp)
{
   return SUCCESS;
}

OP(cltMDMXOp)
{
   return SUCCESS;
}

OP(cleMDMXOp)
{
   return SUCCESS;
}

OP(minMDMXOp)
{
   return SUCCESS;
}

OP(maxMDMXOp)
{
   return SUCCESS;
}

OP(subMDMXOp)
{
   return SUCCESS;
}

OP(addMDMXOp)
{
   return SUCCESS;
}

OP(andMDMXOp)
{
   return SUCCESS;
}

OP(xorMDMXOp)
{
   return SUCCESS;
}

OP(orMDMXOp)
{
   return SUCCESS;
}

OP(norMDMXOp)
{
   return SUCCESS;
}

OP(sllMDMXOp)
{
   return SUCCESS;
}

OP(srlMDMXOp)
{
   return SUCCESS;
}

OP(sraMDMXOp)
{
   return SUCCESS;
}

OP(alniobMDMXOp)
{
   return SUCCESS;
}

OP(alnvobMDMXOp)
{
   return SUCCESS;
}

OP(alniqhMDMXOp)
{
   return SUCCESS;
}

OP(alnvqhMDMXOp)
{
   return SUCCESS;
}

OP(shflMDMXOp)
{
   return SUCCESS;
}

OP(rzuMDMXOp)
{
   return SUCCESS;
}

OP(rnauMDMXOp)
{
   return SUCCESS;
}

OP(rneuMDMXOp)
{
   return SUCCESS;
}

OP(rzsMDMXOp)
{
   return SUCCESS;
}

OP(rnasMDMXOp)
{
   return SUCCESS;
}

OP(rnesMDMXOp)
{
   return SUCCESS;
}

OP(mulMDMXOp)
{
   return SUCCESS;
}

OP(mulsMDMXOp)
{
   return SUCCESS;
}

OP(mulaMDMXOp)
{
   return SUCCESS;
}

OP(subaMDMXOp)
{
   return SUCCESS;
}

OP(addaMDMXOp)
{
   return SUCCESS;
}

OP(wacMDMXOp)
{
   return SUCCESS;
}

OP(racMDMXOp)
{
   return SUCCESS;
}

OP(unknownMDMXOp)
{
   CPUWarning("Unknown MDMX instruction at %#llx\n", P->PC);
   return FAILURE;
}


/*****************************************************************
 * O P C O D E   T A B L E
 *****************************************************************/
MipsOpcodeDesc mipsMDMXOpcodes[] = {
   { "msgn", msgnMDMXOp, 0x00 },
   { "c.eq", ceqMDMXOp, 0x01 },
   { "pickf", picktMDMXOp, 0x02 },
   { "pickt", picktMDMXOp, 0x03 },
   { "c.lt", cltMDMXOp, 0x04 },
   { "c.le", cleMDMXOp, 0x05 },
   { "min", minMDMXOp, 0x06 },
   { "max", maxMDMXOp, 0x07 },
   { "unknownMDMX", unknownMDMXOp, 0x8 },
   { "unknownMDMX", unknownMDMXOp, 0x9 },
   { "sub", subMDMXOp, 0x0A },
   { "add", addMDMXOp, 0x0B },
   { "and", andMDMXOp, 0x0C },
   { "xor", xorMDMXOp, 0x0D },
   { "or", orMDMXOp, 0x0E },
   { "nor", norMDMXOp, 0x0F },
   { "sll", sllMDMXOp, 0x10 },
   { "unknownMDMX", unknownMDMXOp, 0x11 },
   { "srl", srlMDMXOp, 0x12 },
   { "sra", sraMDMXOp, 0x13 },
   { "unknownMDMX", unknownMDMXOp, 0x14 },
   { "unknownMDMX", unknownMDMXOp, 0x15 },
   { "unknownMDMX", unknownMDMXOp, 0x16 },
   { "unknownMDMX", unknownMDMXOp, 0x17 },
   { "alni.ob", alniobMDMXOp, 0x018 },
   { "alnv.ob", alnvobMDMXOp, 0x19 },
   { "alni.qh", alniqhMDMXOp, 0x1A },
   { "alnv.qh", alnvqhMDMXOp, 0x1B },
   { "unknownMDMX", unknownMDMXOp, 0x1C },
   { "unknownMDMX", unknownMDMXOp, 0x1D },
   { "unknownMDMX", unknownMDMXOp, 0x1E },
   { "shfl", shflMDMXOp , 0x1F },
   { "rzu", rzuMDMXOp, 0x20 },
   { "rnau", rnauMDMXOp, 0x21 },
   { "rneu", rneuMDMXOp, 0x22 },
   { "unknownMDMX", unknownMDMXOp, 0x23 },
   { "rzs", rzsMDMXOp, 0x24 },
   { "rnas", rnasMDMXOp, 0x25 },
   { "rnes", rnesMDMXOp, 0x26 },
   { "unknownMDMX", unknownMDMXOp, 0x27 },
   { "unknownMDMX", unknownMDMXOp, 0x28 },
   { "unknownMDMX", unknownMDMXOp, 0x29 },
   { "unknownMDMX", unknownMDMXOp, 0x2A },
   { "unknownMDMX", unknownMDMXOp, 0x2B },
   { "unknownMDMX", unknownMDMXOp, 0x2C },
   { "unknownMDMX", unknownMDMXOp, 0x2D },
   { "unknownMDMX", unknownMDMXOp, 0x2E },
   { "unknownMDMX", unknownMDMXOp, 0x2F },
   { "mul", mulMDMXOp, 0x30 },
   { "unknownMDMX", unknownMDMXOp, 0x31 },
   { "muls", mulsMDMXOp, 0x32 },
   { "mula", mulaMDMXOp, 0x33 },
   { "unknownMDMX", unknownMDMXOp, 0x34 },
   { "unknownMDMX", unknownMDMXOp, 0x35 },
   { "suba", subaMDMXOp, 0x36 },
   { "adda", addaMDMXOp, 0x37 },
   { "unknownMDMX", unknownMDMXOp, 0x38 },
   { "unknownMDMX", unknownMDMXOp, 0x39 },
   { "unknownMDMX", unknownMDMXOp, 0x3A },
   { "unknownMDMX", unknownMDMXOp, 0x3B },
   { "unknownMDMX", unknownMDMXOp, 0x3C },
   { "unknownMDMX", unknownMDMXOp, 0x3D },
   { "wac", wacMDMXOp, 0x3E },
   { "rac", racMDMXOp, 0x3F },
};