Skip to content

Commit

Permalink
Add fclass.{s|d} instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
aswaterman committed Mar 7, 2014
1 parent 6e0769a commit 57f813b
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 42 deletions.
2 changes: 2 additions & 0 deletions inst.chisel
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ object Instructions {
def FMAX_D = Bits("b1100101??????????000?????1010011")
def FMV_X_S = Bits("b111000000000?????000?????1010011")
def FMV_X_D = Bits("b111000100000?????000?????1010011")
def FCLASS_S = Bits("b111010000000?????000?????1010011")
def FCLASS_D = Bits("b111010100000?????000?????1010011")
def FMV_S_X = Bits("b111100000000?????000?????1010011")
def FMV_D_X = Bits("b111100100000?????000?????1010011")
def FLW = Bits("b?????????????????010?????0000111")
Expand Down
92 changes: 56 additions & 36 deletions instr-table.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FADD.S rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FADD.S rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1216,7 +1216,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FSUB.S rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FSUB.S rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1226,7 +1226,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FMUL.S rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FMUL.S rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1236,7 +1236,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FDIV.S rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FDIV.S rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1246,7 +1246,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FSQRT.S rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FSQRT.S rd,rs1 \\
\cline{2-11}


Expand Down Expand Up @@ -1277,7 +1277,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1000011} & FMADD.S rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1000011} & FMADD.S rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand All @@ -1288,7 +1288,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1000111} & FMSUB.S rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1000111} & FMSUB.S rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand All @@ -1299,7 +1299,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1001011} & FNMSUB.S rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1001011} & FNMSUB.S rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand All @@ -1310,7 +1310,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1001111} & FNMADD.S rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1001111} & FNMADD.S rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand Down Expand Up @@ -1350,7 +1350,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.S.W rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.S.W rd,rs1 \\
\cline{2-11}


Expand All @@ -1360,7 +1360,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.S.WU rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.S.WU rd,rs1 \\
\cline{2-11}


Expand All @@ -1380,7 +1380,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.W.S rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.W.S rd,rs1 \\
\cline{2-11}


Expand All @@ -1390,7 +1390,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.WU.S rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.WU.S rd,rs1 \\
\cline{2-11}


Expand All @@ -1404,6 +1404,16 @@
\cline{2-11}


&
\multicolumn{4}{|c|}{1110100} &
\multicolumn{2}{c|}{00000} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{000} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCLASS.S rd,rs1 \\
\cline{2-11}


&
\multicolumn{4}{|c|}{1010100} &
\multicolumn{2}{c|}{rs2} &
Expand Down Expand Up @@ -1576,7 +1586,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.S.L rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.S.L rd,rs1 \\
\cline{2-11}


Expand All @@ -1586,7 +1596,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.S.LU rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.S.LU rd,rs1 \\
\cline{2-11}


Expand All @@ -1596,7 +1606,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.L.S rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.L.S rd,rs1 \\
\cline{2-11}


Expand All @@ -1606,7 +1616,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.LU.S rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.LU.S rd,rs1 \\
\cline{2-11}


Expand Down Expand Up @@ -1642,7 +1652,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FADD.D rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FADD.D rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1652,7 +1662,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FSUB.D rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FSUB.D rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1662,7 +1672,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FMUL.D rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FMUL.D rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1672,7 +1682,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FDIV.D rd,rs1,rs2,rm \\
\multicolumn{1}{c|}{1010011} & FDIV.D rd,rs1,rs2 \\
\cline{2-11}


Expand All @@ -1682,7 +1692,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FSQRT.D rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FSQRT.D rd,rs1 \\
\cline{2-11}


Expand Down Expand Up @@ -1713,7 +1723,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1000011} & FMADD.D rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1000011} & FMADD.D rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand All @@ -1724,7 +1734,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1000111} & FMSUB.D rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1000111} & FMSUB.D rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand All @@ -1735,7 +1745,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1001011} & FNMSUB.D rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1001011} & FNMSUB.D rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand All @@ -1746,7 +1756,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1001111} & FNMADD.D rd,rs1,rs2,rs3,rm \\
\multicolumn{1}{c|}{1001111} & FNMADD.D rd,rs1,rs2,rs3 \\
\cline{2-11}


Expand Down Expand Up @@ -1786,7 +1796,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.D.W rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.D.W rd,rs1 \\
\cline{2-11}


Expand All @@ -1796,7 +1806,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.D.WU rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.D.WU rd,rs1 \\
\cline{2-11}


Expand All @@ -1806,7 +1816,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.W.D rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.W.D rd,rs1 \\
\cline{2-11}


Expand All @@ -1816,7 +1826,17 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.WU.D rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.WU.D rd,rs1 \\
\cline{2-11}


&
\multicolumn{4}{|c|}{1110101} &
\multicolumn{2}{c|}{00000} &
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{000} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCLASS.D rd,rs1 \\
\cline{2-11}


Expand Down Expand Up @@ -1863,7 +1883,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.D.L rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.D.L rd,rs1 \\
\cline{2-11}


Expand All @@ -1873,7 +1893,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.D.LU rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.D.LU rd,rs1 \\
\cline{2-11}


Expand All @@ -1893,7 +1913,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.L.D rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.L.D rd,rs1 \\
\cline{2-11}


Expand All @@ -1903,7 +1923,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.LU.D rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.LU.D rd,rs1 \\
\cline{2-11}


Expand All @@ -1923,7 +1943,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.S.D rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.S.D rd,rs1 \\
\cline{2-11}


Expand All @@ -1933,7 +1953,7 @@
\multicolumn{1}{c|}{rs1} &
\multicolumn{1}{c|}{rm} &
\multicolumn{1}{c|}{rd} &
\multicolumn{1}{c|}{1010011} & FCVT.D.S rd,rs1,rm \\
\multicolumn{1}{c|}{1010011} & FCVT.D.S rd,rs1 \\
\cline{2-11}


Expand Down
10 changes: 6 additions & 4 deletions opcodes
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,12 @@ fmax.s rd rs1 rs2 31..27=0x19 14..12=0 26..25=0 6..2=0x14 1..0=3
fmin.d rd rs1 rs2 31..27=0x18 14..12=0 26..25=1 6..2=0x14 1..0=3
fmax.d rd rs1 rs2 31..27=0x19 14..12=0 26..25=1 6..2=0x14 1..0=3

fmv.x.s rd rs1 24..20=0 31..27=0x1C 14..12=0 26..25=0 6..2=0x14 1..0=3
fmv.x.d rd rs1 24..20=0 31..27=0x1C 14..12=0 26..25=1 6..2=0x14 1..0=3
fmv.s.x rd rs1 24..20=0 31..27=0x1E 14..12=0 26..25=0 6..2=0x14 1..0=3
fmv.d.x rd rs1 24..20=0 31..27=0x1E 14..12=0 26..25=1 6..2=0x14 1..0=3
fmv.x.s rd rs1 24..20=0 31..27=0x1C 14..12=0 26..25=0 6..2=0x14 1..0=3
fmv.x.d rd rs1 24..20=0 31..27=0x1C 14..12=0 26..25=1 6..2=0x14 1..0=3
fclass.s rd rs1 24..20=0 31..27=0x1D 14..12=0 26..25=0 6..2=0x14 1..0=3
fclass.d rd rs1 24..20=0 31..27=0x1D 14..12=0 26..25=1 6..2=0x14 1..0=3
fmv.s.x rd rs1 24..20=0 31..27=0x1E 14..12=0 26..25=0 6..2=0x14 1..0=3
fmv.d.x rd rs1 24..20=0 31..27=0x1E 14..12=0 26..25=1 6..2=0x14 1..0=3

flw rd rs1 imm12 14..12=2 6..2=0x01 1..0=3
fld rd rs1 imm12 14..12=3 6..2=0x01 1..0=3
Expand Down
Loading

0 comments on commit 57f813b

Please sign in to comment.