CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
103 lines
2.8 KiB
TeX
103 lines
2.8 KiB
TeX
\subsection{Operation Class}
|
|
\label{sec:operation}
|
|
|
|
An Operation object represents a family of opcodes (operation encodings) that
|
|
perform the same task (e.g. the \code{MOV} family). It includes information
|
|
about the number of operands, their read/write semantics, the implicit register
|
|
reads and writes, and the control flow behavior of a particular assembly
|
|
language operation. It additionally provides access to the assembly mnemonic,
|
|
which allows any semantic details that are not encoded in the Instruction
|
|
representation to be added by higher layers of analysis.
|
|
|
|
As an example, the \code{CMP} operation on IA32/AMD64 processors has the following properties:
|
|
\begin{itemize}
|
|
\item Operand 1 is read, but not written
|
|
\item Operand 2 is read, but not written
|
|
\item The following flags are written:
|
|
\begin{itemize}
|
|
\item Overflow
|
|
\item Sign
|
|
\item Zero
|
|
\item Parity
|
|
\item Carry
|
|
\item Auxiliary
|
|
\end{itemize}
|
|
\item No other registers are read, and no implicit memory operations are performed
|
|
\end{itemize}
|
|
|
|
Operations are constructed by the \code{InstructionDecoder} as part of the
|
|
process of constructing an Instruction.
|
|
|
|
\begin{apient}
|
|
const Operation::registerSet & implicitReads () const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the set of registers implicitly read (i.e. those not included in the
|
|
operands, but read
|
|
anyway).
|
|
}
|
|
|
|
\begin{apient}
|
|
const Operation::registerSet & implicitWrites () const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the set of registers implicitly written (i.e. those not included in the
|
|
operands, but written
|
|
anyway).
|
|
}
|
|
|
|
\begin{apient}
|
|
std::string format() const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the mnemonic for the operation. Like \code{instruction::format}, this is
|
|
exposed for debug-
|
|
ging and will be replaced with stream operators in the public interface.
|
|
}
|
|
|
|
\begin{apient}
|
|
entryID getID() const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the entry ID corresponding to this operation. Entry IDs are
|
|
enumerated values that correspond to assembly mnemonics.
|
|
}
|
|
|
|
\begin{apient}
|
|
prefixEntryID getPrefixID() const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the prefix entry ID corresponding to this operation, if any. Prefix IDs
|
|
are enumerated values that correspond to assembly prefix mnemonics.
|
|
}
|
|
|
|
\begin{apient}
|
|
bool isRead(Expression::Ptr candidate) const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns \code{true} if the expression represented by \code{candidate} is
|
|
read implicitly.
|
|
}
|
|
|
|
\begin{apient}
|
|
bool isWritten(Expression::Ptr candidate) const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns \code{true} if the expression represented by \code{candidate} is
|
|
written implicitly.
|
|
}
|
|
|
|
\begin{apient}
|
|
const Operation::VCSet & getImplicitMemReads() const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the set of memory locations implicitly read.
|
|
}
|
|
|
|
\begin{apient}
|
|
const Operation::VCSet & getImplicitMemWrites() const
|
|
\end{apient}
|
|
\apidesc{
|
|
Returns the set of memory locations implicitly write.
|
|
}
|