\subsection{\index{logic}logic}

\index{bitwise logic}
bitwise LOGIC


\begin{tabular}{l}
  {\bf logic.xxxx r1, r2, r3} \\
  {\bf or r1, r2, r3} \\
  {\bf orn r1, r2, r3} \\
  {\bf and r1, r2, r3} \\
  {\bf andn r1, r2, r3} \\
  {\bf xor r1, r2, r3} \\
  {\bf nxor r1, r2, r3} \\
  {\bf not r1, r2, r3} \\
  {\bf nor r1, r2, r3} \\
  {\bf nand r1, r2, r3} \\
\end{tabular}


~~~~~~
Computes r3 = f(r1,r2) where f is a logic function whose truth table
is defined in the flags.

{\em Remark :} XOR should be used to compare two numbers for equality, instead
of sub.

\begin{center}

\begin{tabular}{|l|l|l|l|l|l|}
 \hline
\multicolumn{1}{|r| }{size :
} & \multicolumn{1}{c| }{8
} & \multicolumn{1}{c| }{6
} & \multicolumn{1}{c| }{6
} & \multicolumn{1}{c| }{6
} & \multicolumn{1}{c| }{6
 } \\
 \hline
\multicolumn{1}{|r| }{bits :
} & {0 ~ ~ ~ ~ ~ ~ ~ ~ 7
} & {8 ~ ~ ~ ~ ~ ~ 13
} & {14 ~ ~ ~ ~ ~ ~ 19
} & {20 ~ ~ ~ ~ ~ ~ 25
} & {26 ~ ~ ~ ~ ~ ~ 31
 } \\
 \hline
\multicolumn{1}{|r| }{function :
} & \multicolumn{1}{c| }{OP\_LOGIC
} & \multicolumn{1}{c| }{Flags
} & \multicolumn{1}{c| }{Reg 3
} & \multicolumn{1}{c| }{Reg 2
} & \multicolumn{1}{c| }{Reg 1
}
\\ \hline

\end{tabular}



\begin{tabular}{|l|l|l|}
 \hline
\multicolumn{1}{|c| }{Flags} & {Values} & {Function
 } \\
 \hline
\multicolumn{1}{|c| }{8-9} & {[qdb]} & {Size flags
 } \\
 \hline
\multicolumn{1}{|c| }{10} & {[01]} & {f(0,0)
 } \\
 \hline
\multicolumn{1}{|c| }{11} & {[01]} & {f(1,0)
 } \\
 \hline
\multicolumn{1}{|c| }{12} & {[01]} & {f(0,1)
 } \\
 \hline
\multicolumn{1}{|c| }{13} & {[01]} & {f(1,1)}
\\ \hline

\end{tabular}

\end{center}


{\bf or }is an alias for {\bf logic.0111}\\
{\bf and }is an alias for {\bf logic.0001}\\
{\bf xor }is an alias for {\bf logic.0110}\\
{\bf not }is an alias for {\bf logic.1010}\\
{\bf nor }is an alias for {\bf logic.1000}\\
{\bf nand }is an alias for {\bf logic.1110}\\

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


{\em Execution Unit :} ROP2 Unit\\
{\em Latency :} 1 cycle\\
{\em Throughput :} 1 result per cycle per ROP2.\\

~

\pagebreak


