1997-10-08 04:16:01 +00:00
|
|
|
|
// <insn> ::=
|
|
|
|
|
// <insn-word> { "+" <insn-word> }
|
|
|
|
|
// ":" <format-name>
|
|
|
|
|
// ":" <filter-flags>
|
|
|
|
|
// ":" <options>
|
|
|
|
|
// ":" <name>
|
|
|
|
|
// <nl>
|
|
|
|
|
// { <insn-model> }
|
|
|
|
|
// { <insn-mnemonic> }
|
|
|
|
|
// <code-block>
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// IGEN config - mips16
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:option:16::insn-bit-size:16
|
|
|
|
|
:option:16::hi-bit-nr:15
|
|
|
|
|
:option:16::insn-specifying-widths:true
|
|
|
|
|
:option:16::gen-delayed-branch:false
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// IGEN config - mips32/64..
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:option:32::insn-bit-size:32
|
|
|
|
|
:option:32::hi-bit-nr:31
|
|
|
|
|
:option:32::insn-specifying-widths:true
|
|
|
|
|
:option:32::gen-delayed-branch:false
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// Generate separate simulators for each target
|
1997-10-28 07:10:36 +00:00
|
|
|
|
// :option:::multi-sim:true
|
1997-10-09 08:38:22 +00:00
|
|
|
|
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
|
|
|
|
// Models known by this simulator
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:model:::mipsI:mipsI:
|
|
|
|
|
:model:::mipsII:mipsII:
|
|
|
|
|
:model:::mipsIII:mipsIII:
|
|
|
|
|
:model:::mipsIV:mipsIV:
|
|
|
|
|
:model:::mips16:mips16:
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:model:::r5900:r5900:
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// end-sanitize-r5900
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:model:::r3900:r3900:
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-tx19
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:model:::tx19:tx19:
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// end-sanitize-tx19
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:model:::vr5400:vr5400:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Pseudo instructions known by IGEN
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:internal::::illegal:
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
sim_io_eprintf (SD, "Illegal instruction at address 0x%lx\n",
|
1997-10-14 09:34:08 +00:00
|
|
|
|
(unsigned long) CIA);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
sim_engine_halt (SD, CPU, NULL, cia, sim_signalled, SIGILL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// MIPS Architecture:
|
|
|
|
|
//
|
|
|
|
|
// CPU Instruction Set (mipsI - mipsIV)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,100000:SPECIAL:32::ADD
|
|
|
|
|
"add r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU32_BEGIN (GPR[RS]);
|
|
|
|
|
ALU32_ADD (GPR[RT]);
|
|
|
|
|
ALU32_END (GPR[RD]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001000,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ADDI
|
|
|
|
|
"addi r<RT>, r<RS>, IMMEDIATE"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU32_BEGIN (GPR[RS]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
ALU32_ADD (EXTEND16 (IMMEDIATE));
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU32_END (GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001001,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ADDIU
|
|
|
|
|
"add r<RT>, r<RS>, IMMEDIATE"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed32 temp = GPR[RS] + EXTEND16 (IMMEDIATE);
|
|
|
|
|
GPR[RT] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,100001:SPECIAL:32::ADDU
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed32 temp = GPR[RS] + GPR[RT];
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,100100:SPECIAL:32::AND
|
|
|
|
|
"and r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = GPR[RS] & GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001100,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ANDI
|
|
|
|
|
"and r<RT>, r<RS>, IMMEDIATE"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RT] = GPR[RS] & IMMEDIATE;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000100,5.RS,5.RT,16.OFFSET:NORMAL:32::BEQ
|
|
|
|
|
"beq r<RS>, r<RT>, OFFSET"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] == GPR[RT])
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010100,5.RS,5.RT,16.OFFSET:NORMAL:32::BEQL
|
|
|
|
|
"beql r<RS>, r<RT>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] == GPR[RT])
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-14 09:34:08 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,00001,16.OFFSET:REGIMM:32::BGEZ
|
|
|
|
|
"bgez r<RS>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] >= 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS!31,10001,16.OFFSET:REGIMM:32::BGEZAL
|
|
|
|
|
"bgezal r<RS>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
RA = (CIA + 8);
|
|
|
|
|
if (GPR[RS] >= 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS!31,10011,16.OFFSET:REGIMM:32::BGEZALL
|
|
|
|
|
"bgezall r<RS>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
RA = (CIA + 8);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
/* NOTE: The branch occurs AFTER the next instruction has been
|
|
|
|
|
executed */
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] >= 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,00011,16.OFFSET:REGIMM:32::BGEZL
|
|
|
|
|
"bgezl r<RS>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] >= 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000111,5.RS,00000,16.OFFSET:NORMAL:32::BGTZ
|
|
|
|
|
"bgtz r<RS>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] > 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010111,5.RS,00000,16.OFFSET:NORMAL:32::BGTZL
|
|
|
|
|
"bgtzl r<RS>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
/* NOTE: The branch occurs AFTER the next instruction has been
|
|
|
|
|
executed */
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] > 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000110,5.RS,00000,16.OFFSET:NORMAL:32::BLEZ
|
|
|
|
|
"blez r<RS>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
/* NOTE: The branch occurs AFTER the next instruction has been
|
|
|
|
|
executed */
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] <= 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010110,5.RS,00000,16.OFFSET:NORMAL:32::BLEZL
|
|
|
|
|
"bgezl r<RS>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] <= 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,00000,16.OFFSET:REGIMM:32::BLTZ
|
|
|
|
|
"bltz r<RS>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] < 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS!31,10000,16.OFFSET:REGIMM:32::BLTZAL
|
|
|
|
|
"bltzal r<RS>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
RA = (CIA + 8);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
/* NOTE: The branch occurs AFTER the next instruction has been
|
|
|
|
|
executed */
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] < 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS!31,10010,16.OFFSET:REGIMM:32::BLTZALL
|
|
|
|
|
"bltzall r<RS>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
RA = (CIA + 8);
|
|
|
|
|
if (GPR[RS] < 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,00010,16.OFFSET:REGIMM:32::BLTZL
|
|
|
|
|
"bltzl r<RS>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
/* NOTE: The branch occurs AFTER the next instruction has been
|
|
|
|
|
executed */
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] < 0)
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000101,5.RS,5.RT,16.OFFSET:NORMAL:32::BNE
|
|
|
|
|
"bne r<RS>, r<RT>, <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
|
|
|
|
if (GPR[RS] != GPR[RT])
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010101,5.RS,5.RT,16.OFFSET:NORMAL:32::BNEL
|
|
|
|
|
"bnel r<RS>, r<RT>, <OFFSET>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-16 03:41:57 +00:00
|
|
|
|
address_word offset = EXTEND16 (OFFSET) << 2;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] != GPR[RT])
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
000000,20.CODE,001101:SPECIAL:32::BREAK
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"break"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalException(BreakPoint, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
0100,ZZ!0!1!3,26.COP_FUN:NORMAL:32::COPz
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"cop<ZZ> <COP_FUN>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-16 03:41:57 +00:00
|
|
|
|
DecodeCoproc (instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,101100:SPECIAL:64::DADD
|
|
|
|
|
"dadd r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU64_BEGIN (GPR[RS]);
|
|
|
|
|
ALU64_ADD (GPR[RT]);
|
|
|
|
|
ALU64_END (GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
011000,5.RS,5.RT,16.IMMEDIATE:NORMAL:64::DADDI
|
|
|
|
|
"daddi r<RT>, r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU64_BEGIN (GPR[RS]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
ALU64_ADD (EXTEND16 (IMMEDIATE));
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU64_END (GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
011001,5.RS,5.RT,16.IMMEDIATE:NORMAL:64::DADDIU
|
|
|
|
|
"daddu r<RT>, r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-16 03:41:57 +00:00
|
|
|
|
GPR[RT] = GPR[RS] + EXTEND16 (IMMEDIATE);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,101101:SPECIAL:64::DADDU
|
|
|
|
|
"daddu r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = GPR[RS] + GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,0000000000011110:SPECIAL:64::DDIV
|
|
|
|
|
"ddiv r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
CHECKHILO ("Division");
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed64 n = GPR[RS];
|
|
|
|
|
signed64 d = GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
if (d == 0)
|
|
|
|
|
{
|
|
|
|
|
LO = SIGNED64 (0x8000000000000000);
|
|
|
|
|
HI = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (d == -1 && n == SIGNED64 (0x8000000000000000))
|
|
|
|
|
{
|
|
|
|
|
LO = SIGNED64 (0x8000000000000000);
|
|
|
|
|
HI = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LO = (n / d);
|
|
|
|
|
HI = (n % d);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,0000000000,011111:SPECIAL:64::DDIVU
|
|
|
|
|
"ddivu r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
|
|
|
|
*r3900:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
CHECKHILO ("Division");
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned64 n = GPR[RS];
|
|
|
|
|
unsigned64 d = GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
if (d == 0)
|
|
|
|
|
{
|
|
|
|
|
LO = SIGNED64 (0x8000000000000000);
|
|
|
|
|
HI = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LO = (n / d);
|
|
|
|
|
HI = (n % d);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,0000000000011010:SPECIAL:32::DIV
|
|
|
|
|
"div r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
CHECKHILO("Division");
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed32 n = GPR[RS];
|
|
|
|
|
signed32 d = GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
if (d == 0)
|
|
|
|
|
{
|
|
|
|
|
LO = EXTEND32 (0x80000000);
|
|
|
|
|
HI = EXTEND32 (0);
|
|
|
|
|
}
|
1997-10-14 09:34:08 +00:00
|
|
|
|
else if (d == -1 && d == 0x80000000)
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
LO = EXTEND32 (0x80000000);
|
|
|
|
|
HI = EXTEND32 (0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LO = EXTEND32 (n / d);
|
|
|
|
|
HI = EXTEND32 (n % d);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,0000000000011011:SPECIAL:32::DIVU
|
|
|
|
|
"divu r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
CHECKHILO ("Division");
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned32 n = GPR[RS];
|
|
|
|
|
unsigned32 d = GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
if (d == 0)
|
|
|
|
|
{
|
|
|
|
|
LO = EXTEND32 (0x80000000);
|
|
|
|
|
HI = EXTEND32 (0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LO = EXTEND32 (n / d);
|
|
|
|
|
HI = EXTEND32 (n % d);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,0000000000011100:SPECIAL:64::DMULT
|
|
|
|
|
"dmult r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
CHECKHILO ("Multiplication");
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed64 op1 = GPR[RS];
|
|
|
|
|
signed64 op2 = GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
unsigned64 lo;
|
|
|
|
|
unsigned64 hi;
|
|
|
|
|
unsigned64 m00;
|
|
|
|
|
unsigned64 m01;
|
|
|
|
|
unsigned64 m10;
|
|
|
|
|
unsigned64 m11;
|
|
|
|
|
unsigned64 mid;
|
|
|
|
|
int sign = 0;
|
|
|
|
|
/* make it unsigned */
|
|
|
|
|
if (op1 < 0)
|
|
|
|
|
{
|
|
|
|
|
op1 = - op1;
|
|
|
|
|
++sign;
|
|
|
|
|
}
|
|
|
|
|
if (op2 < 0)
|
|
|
|
|
{
|
|
|
|
|
op2 = - op2;
|
|
|
|
|
++sign;
|
|
|
|
|
}
|
|
|
|
|
/* multuply out the 4 sub products */
|
|
|
|
|
m00 = (VL4_8 (op1) * VL4_8 (op2));
|
|
|
|
|
m10 = (VH4_8 (op1) * VL4_8 (op2));
|
|
|
|
|
m01 = (VL4_8 (op1) * VH4_8 (op2));
|
|
|
|
|
m11 = (VH4_8 (op1) * VH4_8 (op2));
|
|
|
|
|
/* add the products */
|
|
|
|
|
mid = VH4_8 (m00) + VL4_8 (m10) + VL4_8 (m01);
|
|
|
|
|
lo = U8_4 (mid, m00);
|
|
|
|
|
hi = m11 + VH4_8 (mid) + VH4_8 (m01) + VH4_8 (m10);
|
|
|
|
|
/* save the result */
|
|
|
|
|
if (sign & 1)
|
|
|
|
|
{
|
|
|
|
|
LO = -lo;
|
|
|
|
|
if (lo == 0)
|
|
|
|
|
HI = -hi;
|
|
|
|
|
else
|
|
|
|
|
HI = -hi - 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LO = lo;
|
|
|
|
|
HI = hi;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,0000000000011101:SPECIAL:64::DMULTU
|
|
|
|
|
"dmultu r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
CHECKHILO ("Multiplication");
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed64 op1 = GPR[RS];
|
|
|
|
|
signed64 op2 = GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
unsigned64 lo;
|
|
|
|
|
unsigned64 hi;
|
|
|
|
|
unsigned64 m00;
|
|
|
|
|
unsigned64 m01;
|
|
|
|
|
unsigned64 m10;
|
|
|
|
|
unsigned64 m11;
|
|
|
|
|
unsigned64 mid;
|
|
|
|
|
/* multuply out the 4 sub products */
|
|
|
|
|
m00 = (VL4_8 (op1) * VL4_8 (op2));
|
|
|
|
|
m10 = (VH4_8 (op1) * VL4_8 (op2));
|
|
|
|
|
m01 = (VL4_8 (op1) * VH4_8 (op2));
|
|
|
|
|
m11 = (VH4_8 (op1) * VH4_8 (op2));
|
|
|
|
|
/* add the products */
|
|
|
|
|
mid = VH4_8 (m00) + VL4_8 (m10) + VL4_8 (m01);
|
|
|
|
|
lo = U8_4 (mid, m00);
|
|
|
|
|
hi = m11 + VH4_8 (mid) + VH4_8 (m01) + VH4_8 (m10);
|
|
|
|
|
/* save the result */
|
|
|
|
|
LO = lo;
|
|
|
|
|
HI = hi;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,111000:SPECIAL:64::DSLL
|
1997-10-29 04:02:30 +00:00
|
|
|
|
"dsll r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-29 04:02:30 +00:00
|
|
|
|
int s = SHIFT;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = GPR[RT] << s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,111100:SPECIAL:64::DSLL32
|
1997-10-29 04:02:30 +00:00
|
|
|
|
"dsll32 r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-29 04:02:30 +00:00
|
|
|
|
int s = 32 + SHIFT;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = GPR[RT] << s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000010100:SPECIAL:64::DSLLV
|
|
|
|
|
"dsllv r<RD>, r<RT>, r<RS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = MASKED64 (GPR[RS], 5, 0);
|
|
|
|
|
GPR[RD] = GPR[RT] << s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,111011:SPECIAL:64::DSRA
|
1997-10-29 04:02:30 +00:00
|
|
|
|
"dsra r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-29 04:02:30 +00:00
|
|
|
|
int s = SHIFT;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = ((signed64) GPR[RT]) >> s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,111111:SPECIAL:64::DSRA32
|
1997-10-29 04:02:30 +00:00
|
|
|
|
"dsra32 r<RT>, r<RD>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-29 04:02:30 +00:00
|
|
|
|
int s = 32 + SHIFT;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = ((signed64) GPR[RT]) >> s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000010111:SPECIAL:64::DSRAV
|
|
|
|
|
"dsra32 r<RT>, r<RD>, r<RS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = MASKED64 (GPR[RS], 5, 0);
|
|
|
|
|
GPR[RD] = ((signed64) GPR[RT]) >> s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,111010:SPECIAL:64::DSRL
|
1997-10-29 04:02:30 +00:00
|
|
|
|
"dsrav r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-29 04:02:30 +00:00
|
|
|
|
int s = SHIFT;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = (unsigned64) GPR[RT] >> s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,111110:SPECIAL:64::DSRL32
|
1997-10-29 04:02:30 +00:00
|
|
|
|
"dsrl32 r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-29 04:02:30 +00:00
|
|
|
|
int s = 32 + SHIFT;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = (unsigned64) GPR[RT] >> s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000010110:SPECIAL:64::DSRLV
|
|
|
|
|
"dsrl32 r<RD>, r<RT>, r<RS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = MASKED64 (GPR[RS], 5, 0);
|
|
|
|
|
GPR[RD] = (unsigned64) GPR[RT] >> s;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000101110:SPECIAL:64::DSUB
|
|
|
|
|
"dsub r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU64_BEGIN (GPR[RS]);
|
|
|
|
|
ALU64_SUB (GPR[RT]);
|
|
|
|
|
ALU64_END (GPR[RD]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000101111:SPECIAL:64::DSUBU
|
|
|
|
|
"dsubu r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = GPR[RS] - GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000010,26.INSTR_INDEX:NORMAL:32::J
|
|
|
|
|
"j <INSTR_INDEX>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
/* NOTE: The region used is that of the delay slot NIA and NOT the
|
1997-10-08 04:16:01 +00:00
|
|
|
|
current instruction */
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word region = (NIA & MASK (63, 28));
|
|
|
|
|
DELAY_SLOT (region | (INSTR_INDEX << 2));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000011,26.INSTR_INDEX:NORMAL:32::JAL
|
|
|
|
|
"jal <INSTR_INDEX>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
/* NOTE: The region used is that of the delay slot and NOT the
|
|
|
|
|
current instruction */
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word region = (NIA & MASK (63, 28));
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[31] = CIA + 8;
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (region | (INSTR_INDEX << 2));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,00000,5.RD,00000001001:SPECIAL:32::JALR
|
|
|
|
|
"jalr r<RS>":RD == 31
|
|
|
|
|
"jalr r<RD>, r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
address_word temp = GPR[RS];
|
|
|
|
|
GPR[RD] = CIA + 8;
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,000000000000000001000:SPECIAL:32::JR
|
|
|
|
|
"jr r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (GPR[RS]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100000,5.BASE,5.RT,16.OFFSET:NORMAL:32::LB
|
|
|
|
|
"lb r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((uword64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
uword64 memval = 0;
|
|
|
|
|
uword64 memval1 = 0;
|
|
|
|
|
uword64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_BYTE,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (SIGNEXTEND(((memval >> (8 * byte)) & 0x000000FF),8));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100100,5.BASE,5.RT,16.OFFSET:NORMAL:32::LBU
|
|
|
|
|
"lbu r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_BYTE,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (((memval >> (8 * byte)) & 0x000000FF));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110111,5.BASE,5.RT,16.OFFSET:NORMAL:64::LD
|
|
|
|
|
"ld r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_DOUBLEWORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
GPR[destreg] = memval;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
1101,ZZ!0!1!3,5.BASE,5.RT,16.OFFSET:NORMAL:64::LDCz
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"ldc<ZZ> r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_DOUBLEWORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
COP_LD(((instruction >> 26) & 0x3),destreg,memval);;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
011010,5.BASE,5.RT,16.OFFSET:NORMAL:64::LDL
|
|
|
|
|
"ldl r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 7;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,byte,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
GPR[destreg] = ((memval << ((7 - byte) * 8)) | (GPR[destreg] & (((unsigned64)1 << ((7 - byte) * 8)) - 1)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
011011,5.BASE,5.RT,16.OFFSET:NORMAL:64::LDR
|
|
|
|
|
"ldr r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 7;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,(7 - byte),paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
{
|
|
|
|
|
unsigned64 srcmask;
|
|
|
|
|
if (byte == 0)
|
|
|
|
|
srcmask = 0;
|
|
|
|
|
else
|
|
|
|
|
srcmask = ((unsigned64)-1 << (8 * (8 - byte)));
|
|
|
|
|
GPR[destreg] = ((GPR[destreg] & srcmask) | (memval >> (8 * byte)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100001,5.BASE,5.RT,16.OFFSET:NORMAL:32::LH
|
|
|
|
|
"lh r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 1) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 1;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_HALFWORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (SIGNEXTEND(((memval >> (8 * byte)) & 0x0000FFFF),16));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100101,5.BASE,5.RT,16.OFFSET:NORMAL:32::LHU
|
|
|
|
|
"lhu r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 1) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 1;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_HALFWORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (((memval >> (8 * byte)) & 0x0000FFFF));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110000,5.BASE,5.RT,16.OFFSET:NORMAL:32::LL
|
|
|
|
|
"ll r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 2;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_WORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (SIGNEXTEND(((memval >> (8 * byte)) & 0xFFFFFFFF),32));
|
|
|
|
|
LLBIT = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110100,5.BASE,5.RT,16.OFFSET:NORMAL:64::LLD
|
|
|
|
|
"lld r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_DOUBLEWORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
GPR[destreg] = memval;
|
|
|
|
|
LLBIT = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001111,00000,5.RT,16.IMMEDIATE:NORMAL:32::LUI
|
|
|
|
|
"lui r<RT>, <IMMEDIATE>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RT] = EXTEND32 (IMMEDIATE << 16);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100011,5.BASE,5.RT,16.OFFSET:NORMAL:32::LW
|
|
|
|
|
"lw r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 2;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_WORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (SIGNEXTEND(((memval >> (8 * byte)) & 0xFFFFFFFF),32));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
1100,ZZ!0!1!3,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWCz
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"lwc<ZZ> r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 2;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_WORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
COP_LW(((instruction >> 26) & 0x3),destreg,(unsigned int)((memval >> (8 * byte)) & 0xFFFFFFFF));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100010,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWL
|
|
|
|
|
"lwl r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 3;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,byte,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
if ((vaddr & (1 << 2)) ^ (BigEndianCPU << 2)) {
|
|
|
|
|
memval >>= 32;
|
|
|
|
|
}
|
|
|
|
|
GPR[destreg] = ((memval << ((3 - byte) * 8)) | (GPR[destreg] & (((unsigned64)1 << ((3 - byte) * 8)) - 1)));
|
|
|
|
|
GPR[destreg] = SIGNEXTEND(GPR[destreg],32);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100110,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWR
|
|
|
|
|
"lwr r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 3;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,(3 - byte),paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
if ((vaddr & (1 << 2)) ^ (BigEndianCPU << 2)) {
|
|
|
|
|
memval >>= 32;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
unsigned64 srcmask;
|
|
|
|
|
if (byte == 0)
|
|
|
|
|
srcmask = 0;
|
|
|
|
|
else
|
|
|
|
|
srcmask = ((unsigned64)-1 << (8 * (4 - byte)));
|
|
|
|
|
GPR[destreg] = ((GPR[destreg] & srcmask) | (memval >> (8 * byte)));
|
|
|
|
|
}
|
|
|
|
|
GPR[destreg] = SIGNEXTEND(GPR[destreg],32);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100111,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWU
|
|
|
|
|
"lwu r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 2;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_WORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
GPR[destreg] = (((memval >> (8 * byte)) & 0xFFFFFFFF));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,0000000000,5.RD,00000,010000:SPECIAL:32::MFHI
|
|
|
|
|
"mfhi r<RD>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = HI;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
HIACCESS = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,0000000000,5.RD,00000,010010:SPECIAL:32::MFLO
|
|
|
|
|
"mflo r<RD>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = LO;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
LOACCESS = 3; /* 3rd instruction will be safe */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000001011:SPECIAL:32::MOVN
|
|
|
|
|
"movn r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RT] != 0)
|
|
|
|
|
GPR[RD] = GPR[RS];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000001010:SPECIAL:32::MOVZ
|
|
|
|
|
"movz r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RT] == 0)
|
|
|
|
|
GPR[RD] = GPR[RS];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,000000000000000,010001:SPECIAL:32::MTHI
|
|
|
|
|
"mthi r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
if (HIACCESS != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
sim_io_eprintf (sd, "MT (move-to) over-writing HI register value\n");
|
|
|
|
|
HI = GPR[RS];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
HIACCESS = 3; /* 3rd instruction will be safe */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,000000000000000010011:SPECIAL:32::MTLO
|
|
|
|
|
"mtlo r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
if (LOACCESS != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
sim_io_eprintf (sd, "MT (move-to) over-writing LO register value\n");
|
|
|
|
|
LO = GPR[RS];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
LOACCESS = 3; /* 3rd instruction will be safe */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000011000:SPECIAL:32::MULT
|
|
|
|
|
"mult r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
signed64 prod;
|
|
|
|
|
CHECKHILO ("Multiplication");
|
1997-10-14 09:34:08 +00:00
|
|
|
|
prod = (((signed64)(signed32) GPR[RS])
|
|
|
|
|
* ((signed64)(signed32) GPR[RT]));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
LO = EXTEND32 (VL4_8 (prod));
|
|
|
|
|
HI = EXTEND32 (VH4_8 (prod));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000011001:SPECIAL:32::MULTU
|
|
|
|
|
"multu r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned64 prod;
|
|
|
|
|
CHECKHILO ("Multiplication");
|
1997-10-14 09:34:08 +00:00
|
|
|
|
prod = (((unsigned64)(unsigned32) GPR[RS])
|
|
|
|
|
* ((unsigned64)(unsigned32) GPR[RT]));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
LO = EXTEND32 (VL4_8 (prod));
|
|
|
|
|
HI = EXTEND32 (VH4_8 (prod));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,100111:SPECIAL:32::NOR
|
|
|
|
|
"nor r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = ~ (GPR[RS] | GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000,100101:SPECIAL:32::OR
|
|
|
|
|
"or r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = (GPR[RS] | GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001101,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ORI
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"ori r<RT>, r<RS>, <IMMEDIATE>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RT] = (GPR[RS] | IMMEDIATE);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110011,5.RS,nnnnn,16.OFFSET:NORMAL:32::PREF
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int hint = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
Prefetch(uncached,paddr,vaddr,isDATA,hint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
101000,5.BASE,5.RT,16.OFFSET:NORMAL:32::SB
|
|
|
|
|
"sb r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 0;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
memval = ((unsigned64) op2 << (8 * byte));
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_BYTE,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111000,5.BASE,5.RT,16.OFFSET:NORMAL:32::SC
|
|
|
|
|
"sc r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (ReverseEndian << 2)));
|
|
|
|
|
byte = ((vaddr & mask) ^ (BigEndianCPU << 2));
|
|
|
|
|
memval = ((unsigned64) op2 << (8 * byte));
|
|
|
|
|
if (LLBIT)
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_WORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
GPR[(instruction >> 16) & 0x0000001F] = LLBIT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111100,5.BASE,5.RT,16.OFFSET:NORMAL:64::SCD
|
|
|
|
|
"scd r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
memval = op2;
|
|
|
|
|
if (LLBIT)
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_DOUBLEWORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
GPR[(instruction >> 16) & 0x0000001F] = LLBIT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111111,5.BASE,5.RT,16.OFFSET:NORMAL:64::SD
|
|
|
|
|
"sd r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
memval = op2;
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_DOUBLEWORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
1111,ZZ!0!1!3,5.BASE,5.RT,16.OFFSET:NORMAL:64::SDCz
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"sdc<ZZ> r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
memval = (unsigned64)COP_SD(((instruction >> 26) & 0x3),destreg);
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_DOUBLEWORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101100,5.BASE,5.RT,16.OFFSET:NORMAL:64::SDL
|
|
|
|
|
"sdl r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 7;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
memval = (op2 >> (8 * (7 - byte)));
|
|
|
|
|
StoreMemory(uncached,byte,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101101,5.BASE,5.RT,16.OFFSET:NORMAL:64::SDR
|
|
|
|
|
"sdr r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 7;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
memval = ((unsigned64) op2 << (byte * 8));
|
|
|
|
|
StoreMemory(uncached,(AccessLength_DOUBLEWORD - byte),memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101001,5.BASE,5.RT,16.OFFSET:NORMAL:32::SH
|
|
|
|
|
"sh r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 1) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 1;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
memval = ((unsigned64) op2 << (8 * byte));
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_HALFWORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
00000000000,5.RT,5.RD,5.SHIFT,000000:SPECIAL:32::SLL
|
|
|
|
|
"sll r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = SHIFT;
|
|
|
|
|
unsigned32 temp = (GPR[RT] << s);
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
000000,5.RS,5.RT,5.RD,00000000100:SPECIAL:32::SLLV
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"sllv r<RD>, r<RT>, r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = MASKED (GPR[RS], 4, 0);
|
|
|
|
|
unsigned32 temp = (GPR[RT] << s);
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000101010:SPECIAL:32::SLT
|
|
|
|
|
"slt r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = (GPR[RS] < GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001010,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::SLTI
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"slti r<RT>, r<RS>, <IMMEDIATE>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RT] = (GPR[RS] < EXTEND16 (IMMEDIATE));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001011,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::SLTIU
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"sltiu r<RT>, r<RS>, <IMMEDIATE>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RT] = ((unsigned_word) GPR[RS] < (unsigned_word) EXTEND16 (IMMEDIATE));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000101011:SPECIAL:32::SLTU
|
|
|
|
|
"sltu r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = ((unsigned_word) GPR[RS] < (unsigned_word) GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
000000,00000,5.RT,5.RD,5.SHIFT,000011:SPECIAL:32::SRA
|
|
|
|
|
"sra r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = SHIFT;
|
|
|
|
|
signed32 temp = (signed32) GPR[RT] >> s;
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000000111:SPECIAL:32::SRAV
|
|
|
|
|
"srav r<RD>, r<RT>, r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = MASKED (GPR[RS], 4, 0);
|
|
|
|
|
signed32 temp = (signed32) GPR[RT] >> s;
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
000000,00000,5.RT,5.RD,5.SHIFT,000010:SPECIAL:32::SRL
|
|
|
|
|
"srl r<RD>, r<RT>, <SHIFT>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = SHIFT;
|
|
|
|
|
unsigned32 temp = (unsigned32) GPR[RT] >> s;
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000000110:SPECIAL:32::SRLV
|
|
|
|
|
"srlv r<RD>, r<RT>, r<RS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int s = MASKED (GPR[RS], 4, 0);
|
|
|
|
|
unsigned32 temp = (unsigned32) GPR[RT] >> s;
|
|
|
|
|
GPR[RD] = EXTEND32 (temp);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000100010:SPECIAL:32::SUB
|
|
|
|
|
"sub r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
ALU32_BEGIN (GPR[RS]);
|
|
|
|
|
ALU32_SUB (GPR[RT]);
|
|
|
|
|
ALU32_END (GPR[RD]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000100011:SPECIAL:32::SUBU
|
|
|
|
|
"subu r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = EXTEND32 (GPR[RS] - GPR[RT]);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101011,5.BASE,5.RT,16.OFFSET:NORMAL:32::SW
|
|
|
|
|
"sw r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (ReverseEndian << 2)));
|
|
|
|
|
byte = ((vaddr & mask) ^ (BigEndianCPU << 2));
|
|
|
|
|
memval = ((unsigned64) op2 << (8 * byte));
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_WORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-16 03:41:57 +00:00
|
|
|
|
1110,ZZ!0!1!3,5.BASE,5.RT,16.OFFSET:NORMAL:32::SWCz
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"swc<ZZ> r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int destreg = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (ReverseEndian << 2)));
|
|
|
|
|
byte = ((vaddr & mask) ^ (BigEndianCPU << 2));
|
|
|
|
|
memval = (((unsigned64)COP_SW(((instruction >> 26) & 0x3),destreg)) << (8 * byte));
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_WORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101010,5.BASE,5.RT,16.OFFSET:NORMAL:32::SWL
|
|
|
|
|
"swl r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 3;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
memval = (op2 >> (8 * (3 - byte)));
|
|
|
|
|
if ((vaddr & (1 << 2)) ^ (BigEndianCPU << 2)) {
|
|
|
|
|
memval <<= 32;
|
|
|
|
|
}
|
|
|
|
|
StoreMemory(uncached,byte,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101110,5.BASE,5.RT,16.OFFSET:NORMAL:32::SWR
|
|
|
|
|
"swr r<RT>, <OFFSET>(r<BASE>)"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 3;
|
|
|
|
|
unsigned int reverse = (ReverseEndian ? mask : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? mask : 0);
|
|
|
|
|
int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ reverse));
|
|
|
|
|
byte = ((vaddr & mask) ^ bigend);
|
|
|
|
|
if (!ByteSwapMem)
|
|
|
|
|
paddr &= ~mask;
|
|
|
|
|
memval = ((unsigned64) op2 << (byte * 8));
|
|
|
|
|
if ((vaddr & (1 << 2)) ^ (BigEndianCPU << 2)) {
|
|
|
|
|
memval <<= 32;
|
|
|
|
|
}
|
|
|
|
|
StoreMemory(uncached,(AccessLength_WORD - byte),memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000000000000000000,5.STYPE,001111:SPECIAL:32::SYNC
|
|
|
|
|
"sync":STYPE == 0
|
|
|
|
|
"sync <STYPE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-16 03:41:57 +00:00
|
|
|
|
SyncOperation (STYPE);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,20.CODE,001100:SPECIAL:32::SYSCALL
|
|
|
|
|
"syscall <CODE>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalException(SystemCall, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,10.CODE,110100:SPECIAL:32::TEQ
|
|
|
|
|
"teq r<RS>, r<RT>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] == GPR[RT])
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,01100,16.IMMEDIATE:REGIMM:32::TEQI
|
|
|
|
|
"teqi r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] == EXTEND16 (IMMEDIATE))
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,10.CODE,110000:SPECIAL:32::TGE
|
|
|
|
|
"tge r<RS>, r<RT>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] >= GPR[RT])
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,01000,16.IMMEDIATE:REGIMM:32::TGEI
|
|
|
|
|
"tgei r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] >= EXTEND16 (IMMEDIATE))
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,01001,16.IMMEDIATE:REGIMM:32::TGEIU
|
|
|
|
|
"tgeiu r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if ((unsigned_word) GPR[RS] >= (unsigned_word) EXTEND16 (IMMEDIATE))
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,10.CODE,110001:SPECIAL:32::TGEU
|
|
|
|
|
"tgeu r<RS>, r<RT>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if ((unsigned_word) GPR[RS] >= (unsigned_word) GPR[RT])
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,10.CODE,110010:SPECIAL:32::TLT
|
|
|
|
|
"tlt r<RS>, r<RT>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] < GPR[RT])
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,01010,16.IMMEDIATE:REGIMM:32::TLTI
|
|
|
|
|
"tlti r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] < EXTEND16 (IMMEDIATE))
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,01011,16.IMMEDIATE:REGIMM:32::TLTIU
|
|
|
|
|
"tltiu r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if ((unsigned_word) GPR[RS] < (unsigned_word) EXTEND16 (IMMEDIATE))
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,10.CODE,110011:SPECIAL:32::TLTU
|
|
|
|
|
"tltu r<RS>, r<RT>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if ((unsigned_word) GPR[RS] < (unsigned_word) GPR[RT])
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,10.CODE,110110:SPECIAL:32::TNE
|
|
|
|
|
"tne r<RS>, r<RT>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] != GPR[RT])
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000001,5.RS,01110,16.IMMEDIATE:REGIMM:32::TNEI
|
|
|
|
|
"tne r<RS>, <IMMEDIATE>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GPR[RS] != EXTEND16 (IMMEDIATE))
|
|
|
|
|
SignalException(Trap, instruction_0);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
000000,5.RS,5.RT,5.RD,00000100110:SPECIAL:32::XOR
|
|
|
|
|
"xor r<RD>, r<RS>, r<RT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RD] = GPR[RS] ^ GPR[RT];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
001110,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::XORI
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"xori r<RT>, r<RS>, <IMMEDIATE>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
GPR[RT] = GPR[RS] ^ IMMEDIATE;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// MIPS Architecture:
|
|
|
|
|
//
|
|
|
|
|
// FPU Instruction Set (COP1 & COP1X)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:%s::::FMT:int fmt
|
1997-10-14 09:34:08 +00:00
|
|
|
|
{
|
|
|
|
|
switch (fmt)
|
|
|
|
|
{
|
|
|
|
|
case fmt_single: return "s";
|
|
|
|
|
case fmt_double: return "d";
|
|
|
|
|
case fmt_word: return "w";
|
|
|
|
|
case fmt_long: return "l";
|
|
|
|
|
default: return "?";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:%s::::TF:int tf
|
1997-10-14 09:34:08 +00:00
|
|
|
|
{
|
|
|
|
|
if (tf)
|
|
|
|
|
return "t";
|
|
|
|
|
else
|
|
|
|
|
return "f";
|
|
|
|
|
}
|
|
|
|
|
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:%s::::ND:int nd
|
1997-10-14 09:34:08 +00:00
|
|
|
|
{
|
|
|
|
|
if (nd)
|
|
|
|
|
return "l";
|
|
|
|
|
else
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:%s::::COND:int cond
|
1997-10-14 09:34:08 +00:00
|
|
|
|
{
|
|
|
|
|
switch (cond)
|
|
|
|
|
{
|
|
|
|
|
case 00: return "f";
|
|
|
|
|
case 01: return "un";
|
|
|
|
|
case 02: return "eq";
|
|
|
|
|
case 03: return "ueq";
|
|
|
|
|
case 04: return "olt";
|
|
|
|
|
case 05: return "ult";
|
|
|
|
|
case 06: return "ole";
|
|
|
|
|
case 07: return "ule";
|
|
|
|
|
case 010: return "sf";
|
|
|
|
|
case 011: return "ngle";
|
|
|
|
|
case 012: return "seq";
|
|
|
|
|
case 013: return "ngl";
|
|
|
|
|
case 014: return "lt";
|
|
|
|
|
case 015: return "nge";
|
|
|
|
|
case 016: return "le";
|
|
|
|
|
case 017: return "ngt";
|
|
|
|
|
default: return "?";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-08 04:16:01 +00:00
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,000101:COP1:32,f::ABS.fmt
|
|
|
|
|
"abs.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,AbsoluteValue(ValueFPR(fs,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1997-10-14 09:34:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,5.FT,5.FS,5.FD,000000:COP1:32,f::ADD
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"add.%s<FMT> f<FD>, f<FS>, f<FT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalException(ReservedInstruction, instruction);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,Add(ValueFPR(fs,format),ValueFPR(ft,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FIXME: This does not correctly resolve mipsI-mipsIV differences.
|
|
|
|
|
//
|
|
|
|
|
// BC1F
|
|
|
|
|
// BC1FL
|
|
|
|
|
// BC1T
|
|
|
|
|
// BC1TL
|
1997-10-14 09:34:08 +00:00
|
|
|
|
010001,01000,3.CC,1.ND,1.TF,16.OFFSET:COP1S:32,f::BC1
|
|
|
|
|
"bc1%s<TF>%s<ND> <OFFSET>":CC == 0
|
|
|
|
|
"bc1%s<TF>%s<ND> <CC>, <OFFSET>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)(((instruction >> 0) & 0x0000FFFF) << 2),18);
|
|
|
|
|
int boolean = ((instruction >> 16) & 0x00000001);
|
|
|
|
|
int likely = ((instruction >> 17) & 0x00000001);
|
|
|
|
|
int condition_code = ((instruction >> 18) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if (condition_code != 0)
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else {
|
|
|
|
|
int condition = (PREVCOC1() == boolean);
|
|
|
|
|
/* NOTE: The branch occurs AFTER the next instruction has been executed */
|
|
|
|
|
if (condition) {
|
1997-10-24 06:38:44 +00:00
|
|
|
|
DELAY_SLOT (PC + offset);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
else if (likely) {
|
1997-10-24 06:38:44 +00:00
|
|
|
|
NULLIFY_NEXT_INSTRUCTION ();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FIXME: This does not correctly differentiate between mips*
|
|
|
|
|
//
|
|
|
|
|
010001,10,3.FMT,5.FT,5.FS,3.CC,00,11,4.COND:COP1:32::C.cond.fmt
|
|
|
|
|
"c.%s<COND>.%s<FMT> f<FS>, f<FT>":CC == 0
|
|
|
|
|
"c.%s<COND>.%s<FMT> <CC>, f<FS>, f<FT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int cmpflags = ((instruction >> 0) & 0x0000000F);
|
|
|
|
|
int condition_code = ((instruction >> 8) & 0x00000007);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
if (condition_code != 0)
|
|
|
|
|
{
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else {
|
|
|
|
|
if (condition_code != 0)
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int ignore = 0;
|
|
|
|
|
int less = 0;
|
|
|
|
|
int equal = 0;
|
|
|
|
|
int unordered = 1;
|
|
|
|
|
unsigned64 ofs = ValueFPR(fs,format);
|
|
|
|
|
unsigned64 oft = ValueFPR(ft,format);
|
|
|
|
|
if (NaN(ofs,format) || NaN(oft,format)) {
|
|
|
|
|
if (FCSR & FP_ENABLE(IO)) {
|
|
|
|
|
FCSR |= FP_CAUSE(IO);
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionFPE();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
ignore = 1;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
less = Less(ofs,oft,format);
|
|
|
|
|
equal = Equal(ofs,oft,format);
|
|
|
|
|
unordered = 0;
|
|
|
|
|
}
|
|
|
|
|
if (!ignore) {
|
|
|
|
|
int condition = (((cmpflags & (1 << 2)) && less) || ((cmpflags & (1 << 1)) && equal) || ((cmpflags & (1 << 0)) && unordered));
|
|
|
|
|
SETFCC(condition_code,condition);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001010:COP1:64::CEIL.L.fmt
|
|
|
|
|
"ceil.l.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_long,Convert(FP_RM_TOPINF,ValueFPR(fs,format),format,fmt_long));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001110:COP1:32::CEIL.W
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_word,Convert(FP_RM_TOPINF,ValueFPR(fs,format),format,fmt_word));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CFC1
|
|
|
|
|
// CTC1
|
|
|
|
|
01000100,x,10,kkkkk,vvvvv,00000000000:COP1S:32::CxC1
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int to = ((instruction >> 23) & 0x00000001);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if (to) {
|
|
|
|
|
if (fs == 0) {
|
|
|
|
|
PENDING_FILL((fs + FCR0IDX),VL4_8(GPR[ft]));
|
|
|
|
|
} else if (fs == 31) {
|
|
|
|
|
PENDING_FILL((fs + FCR31IDX),VL4_8(GPR[ft]));
|
|
|
|
|
} /* else NOP */
|
|
|
|
|
PENDING_FILL(COCIDX,0); /* special case */
|
|
|
|
|
} else { /* control from */
|
|
|
|
|
if (fs == 0) {
|
|
|
|
|
PENDING_FILL(ft,SIGNEXTEND(FCR0,32));
|
|
|
|
|
} else if (fs == 31) {
|
|
|
|
|
PENDING_FILL(ft,SIGNEXTEND(FCR31,32));
|
|
|
|
|
} /* else NOP */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FIXME: Does not correctly differentiate between mips*
|
|
|
|
|
//
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,100001:COP1:32::CVT.D.fmt
|
|
|
|
|
"cvt.d.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format == fmt_double) | 0)
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_double,Convert(GETRM(),ValueFPR(fs,format),format,fmt_double));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,100101:COP1:64::CVT.L.fmt
|
|
|
|
|
"cvt.l.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format == fmt_long) | ((format == fmt_long) || (format == fmt_word)))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_long,Convert(GETRM(),ValueFPR(fs,format),format,fmt_long));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FIXME: Does not correctly differentiate between mips*
|
|
|
|
|
//
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,100000:COP1:32::CVT.S.fmt
|
|
|
|
|
"cvt.s.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format == fmt_single) | 0)
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_single,Convert(GETRM(),ValueFPR(fs,format),format,fmt_single));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,100100:COP1:32::CVT.W.fmt
|
|
|
|
|
"cvt.w.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format == fmt_word) | ((format == fmt_long) || (format == fmt_word)))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_word,Convert(GETRM(),ValueFPR(fs,format),format,fmt_word));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,5.FT,5.FS,5.FD,000011:COP1:32::DIV.fmt
|
|
|
|
|
"div.%s<FMT> f<FD>, f<FS>, f<FT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,Divide(ValueFPR(fs,format),ValueFPR(ft,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DMFC1
|
|
|
|
|
// DMTC1
|
|
|
|
|
01000100,x,01,5.FT,vvvvv,00000000000:COP1S:64::DMxC1
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int to = ((instruction >> 23) & 0x00000001);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if (to) {
|
|
|
|
|
if (SizeFGR() == 64) {
|
|
|
|
|
PENDING_FILL((fs + FGRIDX),GPR[ft]);
|
|
|
|
|
} else
|
|
|
|
|
if ((fs & 0x1) == 0)
|
|
|
|
|
{
|
|
|
|
|
PENDING_FILL(((fs + 1) + FGRIDX),VH4_8(GPR[ft]));
|
|
|
|
|
PENDING_FILL((fs + FGRIDX),VL4_8(GPR[ft]));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (SizeFGR() == 64) {
|
|
|
|
|
PENDING_FILL(ft,FGR[fs]);
|
|
|
|
|
} else
|
|
|
|
|
if ((fs & 0x1) == 0) {
|
|
|
|
|
PENDING_FILL(ft,(SET64HI(FGR[fs+1]) | FGR[fs]));
|
|
|
|
|
} else {
|
|
|
|
|
PENDING_FILL(ft,SET64HI(0xDEADC0DE) | 0xBAD0BAD0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001011:COP1:64::FLOOR.L.fmt
|
|
|
|
|
"floor.l.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_long,Convert(FP_RM_TOMINF,ValueFPR(fs,format),format,fmt_long));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001111:COP1:32::FLOOR.W.fmt
|
|
|
|
|
"floor.w.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_word,Convert(FP_RM_TOMINF,ValueFPR(fs,format),format,fmt_word));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// LDC1
|
|
|
|
|
110101,5.BASE,5.FT,16.OFFSET:COP1:32::LDC1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010011,5.BASE,5.INDEX,5.0,5.FD,000001:COP1X:64::LDXC1
|
|
|
|
|
"ldxc1 f<FD>, r<INDEX>(r<BASE>)"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + op2);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_DOUBLEWORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
COP_LD(1,destreg,memval);;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// LWC1
|
|
|
|
|
110001,5.BASE,5.FT,16.OFFSET:COP1:32::LWC1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010011,5.BASE,5.INDEX,5.0,5.FD,000000:COP1X:32::LWXC1
|
|
|
|
|
"lwxc1 f<FD>, r<INDEX>(r<BASE>)"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + op2);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressLoad();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int shift = 2;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
unsigned int reverse = (ReverseEndian ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int bigend = (BigEndianCPU ? (mask >> shift) : 0);
|
|
|
|
|
unsigned int byte;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (reverse << shift)));
|
|
|
|
|
LoadMemory(&memval,&memval1,uncached,AccessLength_WORD,paddr,vaddr,isDATA,isREAL);
|
|
|
|
|
byte = ((vaddr & mask) ^ (bigend << shift));
|
|
|
|
|
COP_LW(1,destreg,(unsigned int)((memval >> (8 * byte)) & 0xFFFFFFFF));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FIXME: Not correct for mips*
|
|
|
|
|
//
|
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,100,001:COP1X:32::MADD.D
|
|
|
|
|
"madd.d f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_double,Add(Multiply(ValueFPR(fs,fmt_double),ValueFPR(ft,fmt_double),fmt_double),ValueFPR(fr,fmt_double),fmt_double));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,100,000:COP1X:32::MADD.S
|
|
|
|
|
"madd.s f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_single,Add(Multiply(ValueFPR(fs,fmt_single),ValueFPR(ft,fmt_single),fmt_single),ValueFPR(fr,fmt_single),fmt_single));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MFC1
|
|
|
|
|
010001,00,X,00,5.RT,5.FS,00000000000:COP1S:32::MxC1
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"m<X>c1 r<RT>, f<FS>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int to = ((instruction >> 23) & 0x00000001);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if (to) {
|
|
|
|
|
if (SizeFGR() == 64) {
|
1997-10-14 09:34:08 +00:00
|
|
|
|
PENDING_FILL ((fs + FGRIDX), (SET64HI(0xDEADC0DE) | VL4_8(GPR[ft])));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
} else {
|
1997-10-14 09:34:08 +00:00
|
|
|
|
PENDING_FILL ((fs + FGRIDX), VL4_8(GPR[ft]));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
1997-10-14 09:34:08 +00:00
|
|
|
|
PENDING_FILL (ft, SIGNEXTEND(FGR[fs],32));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,000110:COP1:32::MOV.fmt
|
|
|
|
|
"mov.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,format,ValueFPR(fs,format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MOVF
|
|
|
|
|
000000,5.RS,3.CC,0,1.TF,5.RD,00000000001:SPECIAL:32::MOVtf
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"mov%s<TF> r<RD>, r<RS>, <CC>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GETFCC(CC) == TF)
|
|
|
|
|
GPR[RD] = GPR[RS];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MOVF.fmt
|
|
|
|
|
010001,10,3.FMT,3.CC,0,1.TF,5.FS,5.FD,010001:COP1:32::MOVtf.fmt
|
1997-10-14 09:34:08 +00:00
|
|
|
|
"mov%s<TF>.%s<FMT> f<FD>, f<FS>, <CC>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-14 09:34:08 +00:00
|
|
|
|
if (GETFCC(CC) == TF)
|
|
|
|
|
StoreFPR (FD, format, ValueFPR (FS, format));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
1997-10-14 09:34:08 +00:00
|
|
|
|
StoreFPR (FD, format, ValueFPR (FD, format));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,5.RT,5.FS,5.FD,010011:COP1:32::MOVN.fmt
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,format,ValueFPR(fs,format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MOVT see MOVtf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MOVT.fmt see MOVtf.fmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,5.RT,5.FS,5.FD,010010:COP1:32::MOVZ.fmt
|
|
|
|
|
"movz.%s<FMT> f<FD>, f<FS>, r<RT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,format,ValueFPR(fs,format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MSUB.fmt
|
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,101,001:COP1X:32::MSUB.D
|
|
|
|
|
"msub.d f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_double,(Sub(Multiply(ValueFPR(fs,fmt_double),ValueFPR(ft,fmt_double),fmt_double),ValueFPR(fr,fmt_double),fmt_double),fmt_double));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MSUB.fmt
|
1997-10-14 09:34:08 +00:00
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,101000:COP1X:32::MSUB.S
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"msub.s f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_single,(Sub(Multiply(ValueFPR(fs,fmt_single),ValueFPR(ft,fmt_single),fmt_single),ValueFPR(fr,fmt_single),fmt_single),fmt_single));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MTC1 see MxC1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,5.FT,5.FS,5.FD,000010:COP1:32::MUL.fmt
|
|
|
|
|
"mul.%s<FMT> f<FD>, f<FS>, f<FT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,Multiply(ValueFPR(fs,format),ValueFPR(ft,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,000111:COP1:32::NEG.fmt
|
|
|
|
|
"neg.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,Negate(ValueFPR(fs,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NMADD.fmt
|
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,110001:COP1X:32::NMADD.D
|
|
|
|
|
"nmadd.d f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_double,Negate(Add(Multiply(ValueFPR(fs,fmt_double),ValueFPR(ft,fmt_double),fmt_double),ValueFPR(fr,fmt_double),fmt_double),fmt_double));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NMADD.fmt
|
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,110000:COP1X:32::NMADD.S
|
|
|
|
|
"nmadd.s f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_single,Negate(Add(Multiply(ValueFPR(fs,fmt_single),ValueFPR(ft,fmt_single),fmt_single),ValueFPR(fr,fmt_single),fmt_single),fmt_single));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NMSUB.fmt
|
1997-10-14 09:34:08 +00:00
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,111001:COP1X:32::NMSUB.D
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"nmsub.d f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_double,Negate(Sub(Multiply(ValueFPR(fs,fmt_double),ValueFPR(ft,fmt_double),fmt_double),ValueFPR(fr,fmt_double),fmt_double),fmt_double));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NMSUB.fmt
|
1997-10-14 09:34:08 +00:00
|
|
|
|
010011,5.FR,5.FT,5.FS,5.FD,111000:COP1X:32::NMSUB.S
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"nmsub.s f<FD>, f<FR>, f<FS>, f<FT>"
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int fr = ((instruction >> 21) & 0x0000001F);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
StoreFPR(destreg,fmt_single,Negate(Sub(Multiply(ValueFPR(fs,fmt_single),ValueFPR(ft,fmt_single),fmt_single),ValueFPR(fr,fmt_single),fmt_single),fmt_single));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010011,5.BASE,5.INDEX,5.HINT,00000001111:COP1X:32::PREFX
|
1997-10-09 08:38:22 +00:00
|
|
|
|
"prefx <HINT>, r<INDEX>(r<BASE>)"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + (unsigned64)op2);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
Prefetch(uncached,paddr,vaddr,isDATA,fs);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,010101:COP1:32::RECIP.fmt
|
|
|
|
|
*mipsIV:
|
|
|
|
|
"recip.%s<FMT> f<FD>, f<FS>"
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,Recip(ValueFPR(fs,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001000:COP1:64::ROUND.L.fmt
|
1997-10-09 08:38:22 +00:00
|
|
|
|
"round.l.%s<FMT> f<FD>, f<FS>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_long,Convert(FP_RM_NEAREST,ValueFPR(fs,format),format,fmt_long));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001100:COP1:32::ROUND.W.fmt
|
1997-10-09 08:38:22 +00:00
|
|
|
|
"round.w.%s<FMT> f<FD>, f<FS>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_word,Convert(FP_RM_NEAREST,ValueFPR(fs,format),format,fmt_word));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,010110:COP1:32::RSQRT.fmt
|
|
|
|
|
*mipsIV:
|
|
|
|
|
"rsqrt.%s<FMT> f<FD>, f<FS>"
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
1997-10-16 03:41:57 +00:00
|
|
|
|
StoreFPR(destreg,format,Recip(SquareRoot(ValueFPR(fs,format),format),format));
|
1997-10-08 04:16:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// SDC1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010011,5.RS,5.RT,vvvvv,00000001001:COP1X:64::SDXC1
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + op2);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 7) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
memval = (unsigned64)COP_SD(1,fs);
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_DOUBLEWORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,000100:COP1:32::SQRT.fmt
|
|
|
|
|
"sqrt.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,(SquareRoot(ValueFPR(fs,format),format)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,5.FT,5.FS,5.FD,000001:COP1:32::SUB.fmt
|
|
|
|
|
"sub.%s<FMT> f<FD>, f<FS>, f<FT>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int ft = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,format,Sub(ValueFPR(fs,format),ValueFPR(ft,format),format));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// SWC1
|
|
|
|
|
|
|
|
|
|
|
1997-10-16 03:41:57 +00:00
|
|
|
|
010011,5.BASE,5.INDEX,5.FS,00000,001000:COP1X:32::SWXC1
|
|
|
|
|
"swxc1 f<FS>, r<INDEX>(r<BASE>)"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = ((unsigned64)op1 + op2);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if ((vaddr & 3) != 0)
|
1997-10-14 09:34:08 +00:00
|
|
|
|
SignalExceptionAddressStore();
|
1997-10-08 04:16:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isSTORE,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
{
|
|
|
|
|
unsigned64 memval = 0;
|
|
|
|
|
unsigned64 memval1 = 0;
|
|
|
|
|
unsigned64 mask = 0x7;
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
paddr = ((paddr & ~mask) | ((paddr & mask) ^ (ReverseEndian << 2)));
|
|
|
|
|
byte = ((vaddr & mask) ^ (BigEndianCPU << 2));
|
|
|
|
|
memval = (((unsigned64)COP_SW(1,fs)) << (8 * byte));
|
|
|
|
|
{
|
|
|
|
|
StoreMemory(uncached,AccessLength_WORD,memval,memval1,paddr,vaddr,isREAL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001001:COP1:64::TRUNC.L.fmt
|
|
|
|
|
"trunc.l.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_long,Convert(FP_RM_TOZERO,ValueFPR(fs,format),format,fmt_long));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010001,10,3.FMT,00000,5.FS,5.FD,001101:COP1:32::TRUNC.W
|
|
|
|
|
"trunc.w.%s<FMT> f<FD>, f<FS>"
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
int destreg = ((instruction >> 6) & 0x0000001F);
|
|
|
|
|
int fs = ((instruction >> 11) & 0x0000001F);
|
|
|
|
|
int format = ((instruction >> 21) & 0x00000007);
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
|
|
|
|
if ((format != fmt_single) && (format != fmt_double))
|
|
|
|
|
SignalException(ReservedInstruction,instruction);
|
|
|
|
|
else
|
|
|
|
|
StoreFPR(destreg,fmt_word,Convert(FP_RM_TOZERO,ValueFPR(fs,format),format,fmt_word));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// MIPS Architecture:
|
|
|
|
|
//
|
|
|
|
|
// System Control Instruction Set (COP0)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,01000,00000,16.OFFSET:COP0:32::BC0F
|
|
|
|
|
"bc0f <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,01000,00010,16.OFFSET:COP0:32::BC0FL
|
|
|
|
|
"bc0fl <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,01000,00001,16.OFFSET:COP0:32::BC0T
|
|
|
|
|
"bc0t <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
010000,01000,00011,16.OFFSET:COP0:32::BC0TL
|
1997-10-08 04:16:01 +00:00
|
|
|
|
"bc0tl <OFFSET>"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101111,5.BASE,5.OP,16.OFFSET:NORMAL:32::CACHE
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
*r3900:
|
|
|
|
|
// start-sanitize-tx19
|
|
|
|
|
*tx19:
|
|
|
|
|
// end-sanitize-tx19
|
|
|
|
|
{
|
|
|
|
|
unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
int hint = ((instruction >> 16) & 0x0000001F);
|
|
|
|
|
signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-08 04:16:01 +00:00
|
|
|
|
{
|
1997-10-24 06:38:44 +00:00
|
|
|
|
address_word vaddr = (op1 + offset);
|
|
|
|
|
address_word paddr;
|
1997-10-08 04:16:01 +00:00
|
|
|
|
int uncached;
|
|
|
|
|
if (AddressTranslation(vaddr,isDATA,isLOAD,&paddr,&uncached,isTARGET,isREAL))
|
|
|
|
|
CacheOp(hint,vaddr,paddr,instruction);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,111001:COP0:32::DI
|
|
|
|
|
"di"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,111000:COP0:32::EI
|
|
|
|
|
"ei"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,011000:COP0:32::ERET
|
|
|
|
|
"eret"
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
010000,00000,5.RT,5.RD,00000,6.REGX:COP0:32::MFC0
|
|
|
|
|
"mfc0 r<RT>, r<RD> # <REGX>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
010000,00100,5.RT,5.RD,00000,6.REGX:COP0:32::MTC0
|
|
|
|
|
"mtc0 r<RT>, r<RD> # <REGX>"
|
1997-10-08 04:16:01 +00:00
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,001000:COP0:32::TLBP
|
|
|
|
|
"tlbp"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,000001:COP0:32::TLBR
|
|
|
|
|
"tlbr"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,000010:COP0:32::TLBWI
|
|
|
|
|
"tlbwi"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
010000,10000,000000000000000,000110:COP0:32::TLBWR
|
|
|
|
|
"tlbwr"
|
|
|
|
|
*mipsI:
|
|
|
|
|
*mipsII:
|
|
|
|
|
*mipsIII:
|
|
|
|
|
*mipsIV:
|
1997-10-27 06:42:13 +00:00
|
|
|
|
// start-sanitize-vr5400
|
|
|
|
|
*vr5400:
|
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
|
|
|
|
*r5900:
|
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:include:::m16.igen
|
1997-10-27 07:55:24 +00:00
|
|
|
|
// start-sanitize-vr5400
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:include::vr5400:vr5400.igen
|
1997-10-27 07:55:24 +00:00
|
|
|
|
// end-sanitize-vr5400
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// start-sanitize-r5900
|
1997-10-28 07:10:36 +00:00
|
|
|
|
:include::r5900:r5900.igen
|
1997-10-08 04:16:01 +00:00
|
|
|
|
// end-sanitize-r5900
|
|
|
|
|
|
|
|
|
|
// start-sanitize-cygnus-never
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// // FIXME FIXME FIXME What is this instruction?
|
|
|
|
|
// 111011,5.RS,5.RT,16.OFFSET:NORMAL:32::<INT>
|
|
|
|
|
// *mipsI:
|
|
|
|
|
// *mipsII:
|
|
|
|
|
// *mipsIII:
|
|
|
|
|
// *mipsIV:
|
|
|
|
|
// // start-sanitize-r5900
|
|
|
|
|
// *r5900:
|
|
|
|
|
// // end-sanitize-r5900
|
|
|
|
|
// *r3900:
|
|
|
|
|
// // start-sanitize-tx19
|
|
|
|
|
// *tx19:
|
|
|
|
|
// // end-sanitize-tx19
|
|
|
|
|
// {
|
|
|
|
|
// unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
// signed_word offset = SIGNEXTEND((signed_word)((instruction >> 0) & 0x0000FFFF),16);
|
|
|
|
|
// signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
// signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// {
|
|
|
|
|
// if (CoProcPresent(3))
|
|
|
|
|
// SignalException(CoProcessorUnusable);
|
|
|
|
|
// else
|
|
|
|
|
// SignalException(ReservedInstruction,instruction);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// end-sanitize-cygnus-never
|
|
|
|
|
// start-sanitize-cygnus-never
|
|
|
|
|
|
|
|
|
|
// // FIXME FIXME FIXME What is this?
|
|
|
|
|
// 11100,******,00001:RR:16::SDBBP
|
|
|
|
|
// *mips16:
|
|
|
|
|
// {
|
|
|
|
|
// unsigned32 instruction = instruction_0;
|
|
|
|
|
// if (have_extendval)
|
|
|
|
|
// SignalException (ReservedInstruction, instruction);
|
|
|
|
|
// {
|
|
|
|
|
// SignalException(DebugBreakPoint,instruction);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
|
|
|
|
// end-sanitize-cygnus-never
|
|
|
|
|
// start-sanitize-cygnus-never
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// // FIXME FIXME FIXME What is this?
|
|
|
|
|
// 000000,********************,001110:SPECIAL:32::SDBBP
|
|
|
|
|
// *r3900:
|
|
|
|
|
// {
|
|
|
|
|
// unsigned32 instruction = instruction_0;
|
|
|
|
|
// {
|
|
|
|
|
// SignalException(DebugBreakPoint,instruction);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
|
|
|
|
// end-sanitize-cygnus-never
|
|
|
|
|
// start-sanitize-cygnus-never
|
|
|
|
|
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// // FIXME FIXME FIXME This apparently belongs to the vr4100 which
|
|
|
|
|
// // isn't yet reconized by this simulator.
|
|
|
|
|
// 000000,5.RS,5.RT,0000000000101000:SPECIAL:32::MADD16
|
|
|
|
|
// *vr4100:
|
|
|
|
|
// {
|
|
|
|
|
// unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
// signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
// signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// {
|
|
|
|
|
// CHECKHILO("Multiply-Add");
|
|
|
|
|
// {
|
|
|
|
|
// unsigned64 temp = (op1 * op2);
|
|
|
|
|
// temp += (SET64HI(VL4_8(HI)) | VL4_8(LO));
|
|
|
|
|
// LO = SIGNEXTEND((unsigned64)VL4_8(temp),32);
|
|
|
|
|
// HI = SIGNEXTEND((unsigned64)VH4_8(temp),32);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
1997-10-08 04:16:01 +00:00
|
|
|
|
|
|
|
|
|
// end-sanitize-cygnus-never
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// start-sanitize-cygnus-never
|
|
|
|
|
|
|
|
|
|
// // FIXME FIXME FIXME This apparently belongs to the vr4100 which
|
|
|
|
|
// // isn't yet reconized by this simulator.
|
|
|
|
|
// 000000,5.RS,5.RT,0000000000101001:SPECIAL:64::DMADD16
|
|
|
|
|
// *vr4100:
|
|
|
|
|
// {
|
|
|
|
|
// unsigned32 instruction = instruction_0;
|
1997-10-14 09:34:08 +00:00
|
|
|
|
// signed_word op2 = GPR[((instruction >> 16) & 0x0000001F)];
|
|
|
|
|
// signed_word op1 = GPR[((instruction >> 21) & 0x0000001F)];
|
1997-10-09 08:38:22 +00:00
|
|
|
|
// {
|
|
|
|
|
// CHECKHILO("Multiply-Add");
|
|
|
|
|
// {
|
|
|
|
|
// unsigned64 temp = (op1 * op2);
|
|
|
|
|
// LO = LO + temp;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// start-sanitize-cygnus-never
|