Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/c.tex
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ \subsection*{基于栈指针的加载和存储}
这些指令使用CSS格式。
% These instructions use the CSS format.

C.SWSP把一个32位的值存储到寄存器{\em rs2}。它通过将{\em 零}扩展的偏移量扩大4倍,加到栈指针{\tt x2}上,
C.SWSP把寄存器{\em rs2}中的一个32位的值存储到内存。它通过将{\em 零}扩展的偏移量扩大4倍,加到栈指针{\tt x2}上,
来计算出有效地址。它扩展到{\tt sw rs2, offset(x2)}。
% C.SWSP stores a 32-bit value in register {\em rs2} to memory. It computes
% an effective address by adding the {\em zero}-extended offset, scaled by 4, to
Expand Down Expand Up @@ -983,7 +983,7 @@ \subsection*{整数寄存器-立即数操作}
\end{center}

C.ADDI把非零的符号扩展的6位立即数加到寄存器{\em rd}中的值,然后把结果写到{\em rd}。
C.ADDI扩展到{\tt addi rd, rd, nzimm}。C.ADDI只有当{\tt addi rd, rd, nzimm}$\neq${\tt x0}且{\em nzimm}$\neq$0时有效。
C.ADDI扩展到{\tt addi rd, rd, nzimm}。C.ADDI只有当{\em rd}$\neq${\tt x0}且{\em nzimm}$\neq$0时有效。
{\em rd}={\tt x0}的代码点编码了C.NOP指令;余下的{\em nzimm}=0的代码点编码了HINT。
% C.ADDI adds the non-zero sign-extended 6-bit immediate to the value in
% register {\em rd} then writes the result to {\em rd}. C.ADDI expands
Expand Down Expand Up @@ -1210,7 +1210,7 @@ \subsection*{Integer Register-Register Operations}
% These instructions use the CR format.

C.MV把寄存器{\em rs2}中的值复制到寄存器{\em rd}中。C.MV扩展到{\tt add rd, x0, rs2}。
C.MV只在rs2=x0时有效;$\textit{rs2}{=}\texttt{x0}$的代码点对应于C.JR指令。
C.MV只在$\textit{rs2}{\neq}\texttt{x0}$时有效;$\textit{rs2}{=}\texttt{x0}$的代码点对应于C.JR指令。
$\textit{rs2}{\neq}\texttt{x0}$和$\textit{rd}{=}\texttt{x0}$的代码点是HINT。
% C.MV copies the value in register {\em rs2} into register {\em rd}. C.MV
% expands into {\tt add rd, x0, rs2}.
Expand All @@ -1229,8 +1229,8 @@ \subsection*{Integer Register-Register Operations}
\end{commentary}

C.ADD把寄存器{\em rd}和{\em rs2}中的值相加,并把结果写到寄存器{\em rd}。
C.ADD扩展到{\tt add rd, rd, rs2}。C.ADD只在$\textit{rs2}{\neq}\texttt{x0}$时有效;r$\textit{rs2}{=}\texttt{x0}$的代码点对应于C.JALR和C.EBREAK指令。
$\textit{rs2}{\neq}\texttt{x0}$0和$\textit{rd}{=}\texttt{x0}$的代码点是HINT。
C.ADD扩展到{\tt add rd, rd, rs2}。C.ADD只在$\textit{rs2}{\neq}\texttt{x0}$时有效;$\textit{rs2}{=}\texttt{x0}$的代码点对应于C.JALR和C.EBREAK指令。
$\textit{rs2}{\neq}\texttt{x0}$$\textit{rd}{=}\texttt{x0}$的代码点是HINT。
% C.ADD adds the values in registers {\em rd} and {\em rs2} and writes the
% result to register {\em rd}. C.ADD expands into {\tt add rd, rd, rs2}.
% C.ADD is only valid when $\textit{rs2}{\neq}\texttt{x0}$; the code points
Expand Down
2 changes: 1 addition & 1 deletion src/csr.tex
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ \section{CSR指令}

CSRRWI、CSRRSI和CSRRCI变体分别与CSRRW、CSRRS和CSRRC相似,
除了它们使用一个XLEN位的值来更新CSR,这个值通过零扩展编码在{\em rs1}中的一个5位的无符号立即数(uimm[4:0])域得到,
而不是来自一个整数寄存器。对于CSRRI和CSRRCI,如果uimm[4:0]域是零,那么这些指令将不会写CSR,
而不是来自一个整数寄存器。对于CSRRSI和CSRRCI,如果uimm[4:0]域是零,那么这些指令将不会写CSR,
并且应当既不引起任何只可能在写CSR时发生的副作用,也不在访问只读CSR时产生非法的指令异常。
对于CSRRWI,如果{\em rd}={\tt x0},那么指令不应当读CSR,也不应当跟引起任何可能在读CSR时发生的副作用。
不论{\em rd}和{\em rs1}域如何,CSRRSI和CSRRCI都将总是读CSR,和引起任何读的副作用。
Expand Down
2 changes: 1 addition & 1 deletion src/rvwmo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ \subsection*{句法依赖}
% In general, a register $r$ other than {\tt x0} is a {\em destination register} for an instruction $i$ if any of the following hold:
\begin{itemize}
\item 在i的操作码中,rd被设置为r % In the opcode of $i$, {\em rd} is set to $r$
\item $i$是一个CSR指令,且在$i$的操作码中,{\em csr}被设置为$r$(除非$i$是CSRRS或CSRRC,并且{\em rs1}被设置为{\em x0};或者$i$是CSRRI或CSRRCI,并且uimm[4:0]被设置为0) % $i$ is a CSR instruction, and in the opcode of $i$, {\em csr} is set to $r$, unless $i$ is CSRRS or CSRRC and {\em rs1} is set to {\tt x0} or $i$ is CSRRSI or CSRRCI and uimm[4:0] is set to zero.
\item $i$是一个CSR指令,且在$i$的操作码中,{\em csr}被设置为$r$(除非$i$是CSRRS或CSRRC,并且{\em rs1}被设置为{\em x0};或者$i$是CSRRSI或CSRRCI,并且uimm[4:0]被设置为0) % $i$ is a CSR instruction, and in the opcode of $i$, {\em csr} is set to $r$, unless $i$ is CSRRS or CSRRC and {\em rs1} is set to {\tt x0} or $i$ is CSRRSI or CSRRCI and uimm[4:0] is set to zero.
\item $r$是一个CSR,并且对于$i$,$r$是一个隐式的目的寄存器,正如~\ref{sec:source-dest-regs}节中定义的那样 % $r$ is a CSR and an implicit destination register for $i$, as defined in Section~\ref{sec:source-dest-regs}
\item 对于$i$,$r$是一个作为另一个目的寄存器的别名的CSR % $r$ is a CSR that aliases with another destination register for $i$
\end{itemize}
Expand Down