diff options
-rw-r--r-- | thesis/Makefile | 2 | ||||
-rw-r--r-- | thesis/intro.tex | 2 | ||||
-rw-r--r-- | thesis/preamble.tex | 2 | ||||
-rw-r--r-- | thesis/results.tex | 6 | ||||
-rw-r--r-- | thesis/storing-pc.tex | 24 | ||||
-rw-r--r-- | thesis/thesis.bib | 22 | ||||
-rw-r--r-- | thesis/thesis.tex | 2 |
7 files changed, 41 insertions, 19 deletions
diff --git a/thesis/Makefile b/thesis/Makefile index 4e70993..f8cec89 100644 --- a/thesis/Makefile +++ b/thesis/Makefile @@ -13,7 +13,7 @@ all: $(DOC).pdf %.fmt: preamble.tex $(STYS) $(LATEX) $(LATEXFLAGS) -ini -jobname="$(basename $@)" "&$(LATEX) $<\dump" -%.bcf: %.tex %.fmt $(TEXS) +%.bcf: %.tex %.bib %.fmt $(TEXS) $(LATEX) $(LATEXFLAGS) $< %.bbl: %.bcf diff --git a/thesis/intro.tex b/thesis/intro.tex index 71a667e..9299305 100644 --- a/thesis/intro.tex +++ b/thesis/intro.tex @@ -39,7 +39,7 @@ This is UAL syntax. When assembling for Thumb, an \ual{it} instruction with three \ual{mov} instructions (without conditional field) is generated. For ARM, the \ual{it} instruction is ignored and three conditional \ual{mov} instructions are generated. -%ARMv8-A deprecates some uses of the \ual{it} instruction for performance reasons~\parencite[J5.2]{armv8a}. +ARMv8-A deprecates some uses of the \ual{it} instruction for performance reasons~\parencite[J5.2]{armv8a}. \subsubsection{Register usage} \label{sec:intro:registers} diff --git a/thesis/preamble.tex b/thesis/preamble.tex index 10c6d59..636d2ad 100644 --- a/thesis/preamble.tex +++ b/thesis/preamble.tex @@ -82,3 +82,5 @@ \title{Code generation for Thumb-2 processors} \author{Camil Staps} \date{\gitcommitdate[formatDate]} + +\def\todo#1{\textcolor{orange}{\textsc{TODO}: \emph{#1}}} diff --git a/thesis/results.tex b/thesis/results.tex index 561de6c..8ffb2a7 100644 --- a/thesis/results.tex +++ b/thesis/results.tex @@ -3,4 +3,10 @@ \begin{multicols}{2} +\subsection{Code size} +\label{sec:results:size} + +\subsection{Running time} +\label{sec:results:time} + \end{multicols} diff --git a/thesis/storing-pc.tex b/thesis/storing-pc.tex index 98b03ae..b642ee9 100644 --- a/thesis/storing-pc.tex +++ b/thesis/storing-pc.tex @@ -83,7 +83,7 @@ Only after that can we check if its constructor is \abc{_Nil} (the empty list), Evaluating the argument is done by jumping to the subroutine indicated by the node entry of that argument. Hence, we store the PC, jump to that address, and continue with \abc{eq_desc _Nil 0 0} when the node has been evaluated to head normal form. -The ARM code for pattern matching is: +The ARM code for the pattern match is: \begin{minted}{ual} sisEmpty_P1: @@ -100,8 +100,8 @@ The ARM code for pattern matching is: \end{minted} We can see here - (a) that evaluating a node requires a \abc{jsr_eval} ABC instruction, and - (b) that \abc{jsr} ABC instructions require storing the PC in ARM assembly. + that evaluating a node requires a \abc{jsr_eval} ABC instruction, and + that \abc{jsr} ABC instructions require storing the PC in ARM assembly. Of course, evaluating nodes is something that happens throughout the source code and has to be done all the time during the execution of a Clean program. We therefore need a fast, small Thumb alternative for the ARM code. @@ -142,9 +142,19 @@ It is an easier solution to have the caller responsible for storing the return a and why we continue along these lines for the Thumb backend. \subsection{Comparison} -To be done. %TODO - -For every occurrence: +1 word code size; -for every function call: +1 instruction. +Assuming the worst case, that all instructions in the jump block are wide, we need four more bytes in Thumb than in ARM. +As a benchmark, the Clean compiler has 41,006 jumps of this kind in 1,253,978 instructions, a rough 3.27\%. +The four extra bytes in Thumb mean a size increase of $41006\cdot4\approx160$KiB on the 5.3MiB file, an increase of 3.00\%. + +As for the time complexity: every jump requires an extra instruction cycle. +In particular, every reduction needs an extra cycle. +It is hard to tell what effect this has on Clean programs in general, + and it may well be very dependent on the kind of program. +A general comparison of running time under ARM and Thumb is made in \cref{sec:results:time}. + +% pi@rasppi:~/clean/exe$ objdump -d cocl | grep -E '^\s+[0123456789abcdef]{5,8}:\s+[0123456789abcdef]{8}\s+push\s+\{pc\}' | wc -l +% 41006 +% pi@rasppi:~/clean/exe$ objdump -d cocl | grep -E '^\s+[0123456789abcdef]{5,8}:\s+[0123456789abcdef]{8}' | wc -l +% 1253978 \end{multicols} diff --git a/thesis/thesis.bib b/thesis/thesis.bib index 23b7875..f7e5134 100644 --- a/thesis/thesis.bib +++ b/thesis/thesis.bib @@ -1,28 +1,32 @@ @manual{armv7ar, - label="ARMv7-AR", + label="ARM Ltd.", + key="ARM Ltd.", title="ARM Architecture Reference Manual. ARMv7-A and ARMv7-R edition", - organization="ARM Limited", + organization="ARM Ltd.", year=1996 } @manual{armv7m, - label="ARMv7-M", + label="ARM Ltd.", + key="ARM Ltd.", title="ARMv7-M Architecture Reference Manual", - organization="ARM Limited", + organization="ARM Ltd.", year=2006 } @manual{armv8a, - label="ARMv8-A", + label="ARM Ltd.", + key="ARM Ltd.", title="ARM Architecture Reference Manual. ARMv8, for ARMv8-A architecture profile (Beta)", - organization="ARM Limited", + organization="ARM Ltd.", year=2013 } @Online{clean, - label="Clean", - key="Clean", - organization="Radboud University Nijmegen", + label="Software Technology Research Group", + key="Software Technology Research Group", + title="The Clean Home Page", + organization="Radboud University Nij\-me\-gen", url="http://clean.cs.ru.nl/", year=2004, urldate="2016-11-15" diff --git a/thesis/thesis.tex b/thesis/thesis.tex index 7e3ac1e..d2f1e06 100644 --- a/thesis/thesis.tex +++ b/thesis/thesis.tex @@ -20,7 +20,7 @@ The Thumb-2 instruction set combines the best features of the ARM and Thumb inst We discuss the differences between the ARM and Thumb-2 instruction sets, and their influences on code generation. Specifically, we look at code generation for the purely functional programming language Clean. -%todo results +\todo{results, efficiency, etc.} \end{abstract} \cleardoublepage |