\subsection{\index{divi}divi}

\index{division immediate}
DIVision Immediate


\begin{tabular}{l}
 {\bf divi Imm8, r2, r1} \\
 {\bf sdivi Imm8, r2, r1} \\
 {\bf divri Imm8, r2, r1} \\
 {\bf sdivri Imm8, r2, r1} \\
 {\bf divremi Imm8, r2, r1} \\
 {\bf sdivremi Imm8, r2, r1} \\
\end{tabular}

~~~~~~
Computes r1 = r2 / Imm8.

~~~~~~
This instruction is similar to div'' but the second operand is the 
sign-extended value of imm8. This will trigger a math trap if Imm8 
is cleared (=0).

~~~~~~
{ \em Remark :} the division computation is slow and heavy, try to use 
powers-of-two divisors as to simply shift the source operand, which 
takes only a cycle to perform in the FC0.

\begin{center}

\begin{tabular}{|l|l|l|l|l|l|}
 \hline
\multicolumn{1}{|r| }{size :
} & \multicolumn{1}{c| }{8
} & \multicolumn{1}{c| }{4
} & \multicolumn{1}{c| }{8
} & \multicolumn{1}{c| }{6
} & \multicolumn{1}{c| }{6
 } \\
 \hline
\multicolumn{1}{|r| }{bits :
} & {31 ~ ~ ~ ~ ~ ~ ~ ~ 24
} & {23 ~ ~ ~ ~ 20
} & {19 ~ ~ ~ ~ ~ ~ ~ ~ 12
} & {11 ~ ~ ~ ~ ~ ~ 6
} & {5 ~ ~ ~ ~ ~ ~ 0
 } \\
 \hline
\multicolumn{1}{|r| }{function :
} & \multicolumn{1}{c| }{OP\_DIVI
} & \multicolumn{1}{c| }{Flags
} & \multicolumn{1}{c| }{Imm8
} & \multicolumn{1}{c| }{Reg 2
} & \multicolumn{1}{c| }{Reg 1
}
\\ \hline

\end{tabular}



\begin{tabular}{|l|l|l|l|}
 \hline
\multicolumn{1}{|c| }{~ ~ Flags ~ ~
} & \multicolumn{1}{c| }{Syntax
} & {Values
} & {Function
 } \\
 \hline
\multicolumn{1}{|c| }{23-22
} & {.q, .d or .b postfix
} & {*
} & {Defines the size parameter
 } \\
 \hline
\multicolumn{1}{|c| }{21
} & {s- prefix
} & {1 if set
} & {Defines if the operation is SIMD
 } \\
 \hline
\multicolumn{1}{|c| }{20
} & {-r postfix (or -rem postfix)
} & {1 if set
} & {Remainder flag ( {\bf 2r2w} )
}
\\ \hline

\end{tabular}


~
{\bf Performance (FC0 only) :}
\end{center}

{\em Execution Unit :} Integer Divide Unit\\
{\em Latency :} unknown ATM, depends on the size of the operands.\\
{\em Throughput :} unknown ATM, probably equal to the latency (not pipelined).\\

~

\pagebreak


