Skip to content

Commit 3778c92

Browse files
committed
x86: Extend INC and DEC to support capability operands.
1 parent 85babef commit 3778c92

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

chap-cheri-x86-64.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,10 @@ \subsubsection{Extending Existing Instructions to Support Capability Operands}
535535
We do not anticipiate a need for capability-sized variants of
536536
\insnnoref{ADC} or \insnnoref{SBB}.
537537

538+
\item \insnxesref[inc]{INCC} and \insnxesref[dec]{DECC} would permit
539+
simple increments and decrements of the \textbf{address} field of
540+
capabilites.
541+
538542
\item \insnxesref[and]{ANDC}, \insnxesref[or]{ORC}, and \insnxesref[xor]{XORC} would
539543
permit bit manipulation of the \textbf{address} field of a capability. As
540544
with \insnxesref[add]{ADDC}, the second operand would always be an

chap-isaref-x86-64.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ \section{Extensions to x86-64 Instructions}
9898
\input{insn-x86-64/cmp}
9999
\input{insn-x86-64/cmpxchg}
100100
\input{insn-x86-64/cmpxchg2c}
101+
\input{insn-x86-64/dec}
102+
\input{insn-x86-64/inc}
101103
\input{insn-x86-64/jmp}
102104
\input{insn-x86-64/lea}
103105
\input{insn-x86-64/lods}

insn-x86-64/dec.tex

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
\clearpage
2+
\phantomsection
3+
\addcontentsline{toc}{subsection}{DEC - Decrement by 1}
4+
\insnxeslabel{dec}
5+
\subsection*{DEC - Decrement by 1}
6+
7+
\begin{x86opcodetable}
8+
\xopcode{CAP + FF /1}{DEC \emph{r/mc}}
9+
{M}{Valid}{Valid}
10+
{Decrement address field of \emph{r/mc} by 1.}
11+
\end{x86opcodetable}
12+
13+
\begin{x86opentable}
14+
\xopen{M}{ModRM:r/m (r,w)}{NA}{NA}{NA}
15+
\end{x86opentable}
16+
17+
\subsubsection*{Description}
18+
19+
Subtracts 1 from the \textbf{address} field of the destination operand
20+
and then stores the result in the destination operand. The destination
21+
operand can be a register or a memory location.
22+
23+
If the new value of the \textbf{address} field makes the resulting
24+
capability unrepresentable, the \textbf{tag} field in the resulting
25+
capability is cleared.
26+
27+
\subsubsection*{Flags Affected}
28+
29+
The CF flag is not affected. The OF, SF, ZF, AF, and PF flags are set
30+
according to the value of the resulting \textbf{address} field.

insn-x86-64/inc.tex

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
\clearpage
2+
\phantomsection
3+
\addcontentsline{toc}{subsection}{INC - Increment by 1}
4+
\insnxeslabel{inc}
5+
\subsection*{INC - Increment by 1}
6+
7+
\begin{x86opcodetable}
8+
\xopcode{CAP + FF /0}{INC \emph{r/mc}}
9+
{M}{Valid}{Valid}
10+
{Increment address field of \emph{r/mc} by 1.}
11+
\end{x86opcodetable}
12+
13+
\begin{x86opentable}
14+
\xopen{M}{ModRM:r/m (r,w)}{NA}{NA}{NA}
15+
\end{x86opentable}
16+
17+
\subsubsection*{Description}
18+
19+
Adds 1 to the \textbf{address} field of the destination operand and
20+
then stores the result in the destination operand. The destination
21+
operand can be a register or a memory location.
22+
23+
If the new value of the \textbf{address} field makes the resulting
24+
capability unrepresentable, the \textbf{tag} field in the resulting
25+
capability is cleared.
26+
27+
\subsubsection*{Flags Affected}
28+
29+
The CF flag is not affected. The OF, SF, ZF, AF, and PF flags are set
30+
according to the value of the resulting \textbf{address} field.

0 commit comments

Comments
 (0)