imm_j and imm_b can only be even

This commit is contained in:
John Winans 2022-10-07 06:11:59 -05:00
parent a44a1fcd6f
commit 8eeb353636

View File

@ -209,7 +209,7 @@ The address of the current instruction minus a numeric offset.
\subsection{pcrel\_13}
\label{pcrel.13}
An address that is within $[-4096..4095]$ of the current instruction location.
An address that is within $[-4096..4094]$ $[$\verb@-0x1000..0x0ffe@$]$ of the current instruction location.
These addresses are typically expressed in assembly source code by using labels.
See \autoref{insnformat:btype} for examples.
@ -217,7 +217,7 @@ See \autoref{insnformat:btype} for examples.
\subsection{pcrel\_21}
\label{pcrel.21}
An address that is within $[-1048576..1048575]$ of the current instruction
An address that is within $[-1048576..1048574]$ $[$\verb@-0x100000..0x0ffffe@$]$ of the current instruction
location.
These addresses are typically expressed in assembly source code by using labels.
See \autoref{insnformat:jtype} for an example.
@ -414,8 +414,8 @@ arranged in a different order.
Note that the \verb@imm_j@ value is
%expressed in the instruction as a target address that is converted to
a 21-bit value in the range of
$[-1048576..1048575]$ representing a \verb@pc@-relative offset to the
an even 21-bit value in the range of
$[-1048576..1048574]$ $[$\verb@-0x100000..0x0ffffe@$]$ representing a \verb@pc@-relative offset to the
target address.
%In the J-type format the 20 {\em imm} bits are arranged such
@ -995,8 +995,8 @@ to form the \verb@imm_b@ value.
\end{figure}
Note that \verb@imm_b@ is expressed in the instruction as a target
address that is converted to a 13-bit value in the range of
$[-4096..4095]$ representing a \verb@pc@-relative offset to the
address that is converted to an even 13-bit value in the range of
$[-4096..4094]$ $[$\verb@-0x1000..0x0ffe@$]$ representing a \verb@pc@-relative offset to the
target address. For example, consider the branch instructions in
the following code: