// -*- C -*-
// Simulator definition for the MIPS MDMX ASE.
-// Copyright (C) 2002 Free Software Foundation, Inc.
-// Contributed by Broadcom Corporation (SiByte).
+// Copyright (C) 2002-2016 Free Software Foundation, Inc.
+// Contributed by Ed Satterthwaite and Chris Demetriou, of Broadcom
+// Corporation (SiByte).
//
// This file is part of GDB, the GNU debugger.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
// Reference: MIPS64 Architecture Volume IV-b:
// The MDMX Application-Specific Extension
// Similarly, for the single-bit fields which differentiate between
// formats (FMTOP), 0 is OB format and 1 is QH format.
+// If you change this file to add instructions, please make sure that model
+// "sb1" configurations still build, and that you've added no new
+// instructions to the "sb1" model.
+
// Helper:
//
:%s::::FMTSEL:int fmtsel
*mdmx:
+*sb1:
{
if ((fmtsel & 0x1) == 0)
return "ob";
:%s::::FMTOP:int fmtop
*mdmx:
+*sb1:
{
switch (fmtop)
{
:%s::::SHOP:int shop
*mdmx:
+*sb1:
{
if ((shop & 0x11) == 0x00)
switch ((shop >> 1) & 0x07)
011110,5.FMTSEL,5.VT,5.VS,5.VD,001011:MDMX:64::ADD.fmt
"add.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,0,0000,110111:MDMX:64::ADDA.fmt
"adda.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,1,0000,110111:MDMX:64::ADDL.fmt
"addl.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,00,3.IMM,5.VT,5.VS,5.VD,0110,1.FMTOP,0:MDMX:64::ALNI.fmt
"alni.%s<FMTOP> v<VD>, v<VS>, v<VT>, <IMM>"
*mdmx:
+*sb1:
{
unsigned64 result;
int s;
011110,5.RS,5.VT,5.VS,5.VD,0110,1.FMTOP,1:MDMX:64::ALNV.fmt
"alnv.%s<FMTOP> v<VD>, v<VS>, v<VT>, r<RS>"
*mdmx:
+*sb1:
{
unsigned64 result;
int s;
011110,5.FMTSEL,5.VT,5.VS,5.VD,001100:MDMX:64::AND.fmt
"and.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,00000,000001:MDMX:64::C.EQ.fmt
"c.eq.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,00000,000101:MDMX:64::C.LE.fmt
"c.le.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,00000,000100:MDMX:64::C.LT.fmt
"c.lt.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,000111:MDMX:64::MAX.fmt
"max.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,000110:MDMX:64::MIN.fmt
"min.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,110000:MDMX:64::MUL.fmt
"mul.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,0,0000,110011:MDMX:64::MULA.fmt
"mula.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,1,0000,110011:MDMX:64::MULL.fmt
"mull.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,0,0000,110010:MDMX:64::MULS.fmt
"muls.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,1,0000,110010:MDMX:64::MULSL.fmt
"mulsl.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,001111:MDMX:64::NOR.fmt
"nor.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,001110:MDMX:64::OR.fmt
"or.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,000010:MDMX:64::PICKF.fmt
"pickf.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,000011:MDMX:64::PICKT.fmt
"pickt.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,1000,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACH.fmt
"rach.%s<FMTOP> v<VD>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
check_mdmx_fmtop (SD_, instruction_0, FMTOP);
011110,0000,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACL.fmt
"racl.%s<FMTOP> v<VD>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
check_mdmx_fmtop (SD_, instruction_0, FMTOP);
011110,0100,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACM.fmt
"racm.%s<FMTOP> v<VD>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
check_mdmx_fmtop (SD_, instruction_0, FMTOP);
011110,5.FMTSEL,5.VT,00000,5.VD,100001:MDMX:64::RNAU.fmt
"rnau.%s<FMTSEL> v<VD>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,00000,5.VD,100010:MDMX:64::RNEU.fmt
"rneu.%s<FMTSEL> v<VD>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,00000,5.VD,100000:MDMX:64::RZU.fmt
"rzu.%s<FMTSEL> v<VD>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.SHOP,5.VT,5.VS,5.VD,011111:MDMX:64::SHFL.op.fmt
"shfl.%s<SHOP> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, SHOP))
011110,5.FMTSEL,5.VT,5.VS,5.VD,010000:MDMX:64::SLL.fmt
"sll.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,010010:MDMX:64::SRL.fmt
"srl.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,5.VD,001010:MDMX:64::SUB.fmt
"sub.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,0,0000,110110:MDMX:64::SUBA.fmt
"suba.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,5.FMTSEL,5.VT,5.VS,1,0000,110110:MDMX:64::SUBL.fmt
"subl.%s<FMTSEL> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
011110,1000,1.FMTOP,00000,5.VS,00000,111110:MDMX:64::WACH.fmt
"wach.%s<FMTOP> v<VS>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
check_mdmx_fmtop (SD_, instruction_0, FMTOP);
011110,0000,1.FMTOP,5.VT,5.VS,00000,111110:MDMX:64::WACL.fmt
"wacl.%s<FMTOP> v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
check_mdmx_fmtop (SD_, instruction_0, FMTOP);
011110,5.FMTSEL,5.VT,5.VS,5.VD,001101:MDMX:64::XOR.fmt
"xor.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
*mdmx:
+*sb1:
{
check_mdmx (SD_, instruction_0);
if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))