瀏覽代碼

add andq and sarq, for issue #199

Jeremy Siek 2 周之前
父節點
當前提交
745960148c
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      book.tex

+ 7 - 7
book.tex

@@ -12141,11 +12141,6 @@ for the compilation of \LangLoop{}.
 \index{subject}{vector}
 \setcounter{footnote}{0}
 
-%% \margincomment{\scriptsize To do: Flesh out this chapter, e.g., make sure
-%%   all the IR grammars are spelled out! \\ --Jeremy}
-%% \margincomment{\scriptsize Be more explicit about how to deal with
-%%   the root stack. \\ --Jeremy}
-
 In this chapter we study the implementation of tuples\racket{, called
   vectors in Racket}.  A tuple is a fixed-length sequence of elements
 in which each element may have a different type.
@@ -13552,12 +13547,16 @@ movzbq %al, |$\Var$|
 
 \newcommand{\GrammarXGlobal}{
 \begin{array}{lcl}
+  \Instr &::=& \key{andq}~\Arg\key{,}~\Arg
+          \MID \key{sarq}~\Arg\key{,}~\Arg \\
   \Arg &::=& \itm{label} \key{(\%rip)} 
 \end{array}
 }
 
 \newcommand{\ASTXGlobalRacket}{
 \begin{array}{lcl}
+  \Instr &::=& \BININSTR{\scode{andq}}{\Arg}{\Arg} \MID
+               \BININSTR{\scode{sarq}}{\Arg}{\Arg} \\
   \Arg &::=&  \GLOBAL{\itm{label}} 
 \end{array}
 }
@@ -13631,8 +13630,9 @@ movzbq %al, |$\Var$|
 
 The definitions of the concrete and abstract syntax of the
 \LangXGlobal{} language are shown in figures~\ref{fig:x86-2-concrete}
-and \ref{fig:x86-2}.  It differs from \LangXIf{} only in the addition
-of global variables.
+and \ref{fig:x86-2}.  It differs from \LangXIf{} with the addition
+of global variables and the instructions needed to compile
+tuple length: \code{andq} and \code{sarq}.
 %
 Figure~\ref{fig:select-instr-output-gc} shows the output of the
 \code{select\_instructions} pass on the running example.