\subsection{\index{logici}logici}

\index{bitwise logic immediate}
bitwise LOGIC Immediate


\begin{tabular}{l}
  {\bf logici.xxxx Imm8, r2, r1} \\
  {\bf andi Imm8, r2, r1} \\
  {\bf andni Imm8, r2, r1} \\
  {\bf ori Imm8, r2, r1} \\
  {\bf xori Imm8, r2, r1} \\
\end{tabular}

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

~~~~~~
Because there is less room than in the register form of the instruction,
the logic functions are reduced to 4. I have chosen to use the same
logic functions as in the bitop instructions. Yet, the SIMD flag is cruelly
missing. The function could maybe be included in the opcode.

\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 :
} & {0 ~ ~ ~ ~ ~ ~ ~ ~ 7
} & {8 ~ ~ ~ ~ 11
} & {12 ~ ~ ~ ~ ~ ~ ~ ~ 19
} & {20 ~ ~ ~ ~ ~ ~ 25
} & {26 ~ ~ ~ ~ ~ ~ 31
 } \\
 \hline
\multicolumn{1}{|r| }{function :
} & \multicolumn{1}{c| }{OP\_LOGICI
} & \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|}
 \hline
\multicolumn{1}{|c| }{Flags} & {Values} & {Function
 } \\
 \hline
\multicolumn{1}{|c| }{8-9} & {[qdb]} & {Size flags
 } \\
 \hline
\multicolumn{1}{|c| }{10-11} & {[xtcs]} & {logic function
}
\\ \hline

\end{tabular}

\end{center}


{\bf ori }is an alias for {\bf logici.s}\\
{\bf andi }is an alias for {\bf logici.t}\\
{\bf xori }is an alias for {\bf logici.x}\\
{\bf andni }is an alias for {\bf logici.c}\\

\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

