summaryrefslogtreecommitdiff
path: root/arch/mips/isa/decoder.isa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/isa/decoder.isa')
-rw-r--r--arch/mips/isa/decoder.isa201
1 files changed, 177 insertions, 24 deletions
diff --git a/arch/mips/isa/decoder.isa b/arch/mips/isa/decoder.isa
index 143d0bae2..5e1f02869 100644
--- a/arch/mips/isa/decoder.isa
+++ b/arch/mips/isa/decoder.isa
@@ -1021,39 +1021,193 @@ decode OPCODE_HI default Unknown::unknown() {
Fd.uw = fpConvert(Fs1.uw, PL_TO_SINGLE);
}});
- 0x4: pll({{ Fd.ud = Fs.ud<31:0> << 32 | Ft.ud<31:0>; }});
- 0x5: plu({{ Fd.ud = Fs.ud<31:0> << 32 | Ft.ud<63:32>;}});
- 0x6: pul({{ Fd.ud = Fs.ud<63:32> << 32 | Ft.ud<31:0>; }});
- 0x7: puu({{ Fd.ud = Fs.ud<63:32> << 32 | Ft.ud<63:32>;}});
+ 0x4: pll({{ Fd.ud = (uint64_t) Fs1.uw << 32 | Ft1.uw; }});
+ 0x5: plu({{ Fd.ud = (uint64_t) Fs1.uw << 32 | Ft2.uw; }});
+ 0x6: pul({{ Fd.ud = (uint64_t) Fs2.uw << 32 | Ft1.uw; }});
+ 0x7: puu({{ Fd.ud = (uint64_t) Fs2.uw << 32 | Ft2.uw; }});
}
}
0x6: decode FUNCTION_LO {
- format FloatOp {
- 0x0: c_f_ps({{ ; }});
- 0x1: c_un_ps({{ ; }});
- 0x2: c_eq_ps({{ ; }});
- 0x3: c_ueq_ps({{ ; }});
- 0x4: c_olt_ps({{ ; }});
- 0x5: c_ult_ps({{ ; }});
- 0x6: c_ole_ps({{ ; }});
- 0x7: c_ule_ps({{ ; }});
+ format FloatPSCompareOp {
+ 0x0: c_f_ps({{ cond1 = 0; cond2 = 0; }});
+
+ 0x1: c_un_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = 0;
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = 0;
+
+ }});
+
+ 0x2: c_eq_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 0;
+ else
+ cond1 = (Fs1.sf == Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 0;
+ else
+ cond2 = (Fs2.sf == Ft2.sf);
+ }});
+
+ 0x3: c_ueq_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = (Fs1.sf == Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = (Fs2.sf == Ft2.sf);
+ }});
+
+ 0x4: c_olt_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 0;
+ else
+ cond1 = (Fs1.sf < Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 0;
+ else
+ cond2 = (Fs2.sf < Ft2.sf);
+ }});
+
+ 0x5: c_ult_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = (Fs.sf < Ft.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = (Fs2.sf < Ft2.sf);
+ }});
+
+ 0x6: c_ole_ps({{
+ if (unorderedFP(Fs.sf) || unorderedFP(Ft.sf))
+ cond1 = 0;
+ else
+ cond1 = (Fs.sf <= Ft.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 0;
+ else
+ cond2 = (Fs2.sf <= Ft2.sf);
+ }});
+
+ 0x7: c_ule_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = (Fs1.sf <= Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = (Fs2.sf <= Ft2.sf);
+ }});
}
}
0x7: decode FUNCTION_LO {
- format FloatOp {
- 0x0: c_sf_ps({{ ; }});
- 0x1: c_ngle_ps({{ ; }});
- 0x2: c_seq_ps({{ ; }});
- 0x3: c_ngl_ps({{ ; }});
- 0x4: c_lt_ps({{ ; }});
- 0x5: c_nge_ps({{ ; }});
- 0x6: c_le_ps({{ ; }});
- 0x7: c_ngt_ps({{ ; }});
+ format FloatPSCompareWithXcptOp {
+ 0x0: c_sf_ps({{ cond1 = 0; cond2 = 0; }});
+
+ 0x1: c_ngle_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = 0;
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = 0;
+ }});
+
+ 0x2: c_seq_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 0;
+ else
+ cond1 = (Fs1.sf == Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 0;
+ else
+ cond2 = (Fs2.sf == Ft2.sf);
+ }});
+
+ 0x3: c_ngl_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = (Fs1.sf == Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = (Fs2.sf == Ft2.sf);
+ }});
+
+ 0x4: c_lt_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 0;
+ else
+ cond1 = (Fs1.sf < Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 0;
+ else
+ cond2 = (Fs2.sf < Ft2.sf);
+ }});
+
+ 0x5: c_nge_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = (Fs1.sf < Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = (Fs2.sf < Ft2.sf);
+ }});
+
+ 0x6: c_le_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 0;
+ else
+ cond1 = (Fs1.sf <= Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 0;
+ else
+ cond2 = (Fs2.sf <= Ft2.sf);
+ }});
+
+ 0x7: c_ngt_ps({{
+ if (unorderedFP(Fs1.sf) || unorderedFP(Ft1.sf))
+ cond1 = 1;
+ else
+ cond1 = (Fs1.sf <= Ft1.sf);
+
+ if (unorderedFP(Fs2.sf) || unorderedFP(Ft2.sf))
+ cond2 = 1;
+ else
+ cond2 = (Fs2.sf <= Ft2.sf);
+ }});
}
}
-
}
}
}
@@ -1148,7 +1302,6 @@ decode OPCODE_HI default Unknown::unknown() {
0x0: nmsub_s({{ Fd.sf = (-1 * Fs.sf * Ft.sf) - Fr.sf; }});
0x1: nmsub_d({{ Fd.df = (-1 * Fs.df * Ft.df) - Fr.df; }});
0x6: nmsub_ps({{
- 0x6: msub_ps({{
Fd1.sf = -1 * ((Fs1.df * Ft1.df) - Fr1.df);
Fd2.sf = -1 * ((Fs2.df * Ft2.df) - Fr2.df);
}});