summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-11-17 23:56:45 +0100
committerCamil Staps2016-11-18 10:24:31 +0100
commit6b5e8eb67ed718e5eba61f143c48e4a7cc0bbb19 (patch)
tree334e2da76abfd42ef0836933774ecabf97b80651
parentlog (diff)
Formatting & makefile
-rw-r--r--.gitignore1
-rw-r--r--thesis/Makefile30
-rw-r--r--thesis/intro.tex30
-rw-r--r--thesis/preamble.tex84
m---------thesis/rutitlepage0
-rw-r--r--thesis/thesis.tex103
6 files changed, 142 insertions, 106 deletions
diff --git a/.gitignore b/.gitignore
index e6d3d8d..6985242 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
*.dvi
*.fdb_latexmk
*.fls
+*.fmt
*.glg
*.glo
*.gls
diff --git a/thesis/Makefile b/thesis/Makefile
new file mode 100644
index 0000000..4e70993
--- /dev/null
+++ b/thesis/Makefile
@@ -0,0 +1,30 @@
+DOC:=thesis
+LATEX?=pdflatex
+LATEXFLAGS?=-file-line-error -halt-on-error -shell-escape
+BIBER?=biber
+TEXS:=$(wildcard *.tex)
+STYS:=$(wildcard *.sty)
+
+.PHONY: all clean
+.SECONDARY: $(DOC).fmt
+
+all: $(DOC).pdf
+
+%.fmt: preamble.tex $(STYS)
+ $(LATEX) $(LATEXFLAGS) -ini -jobname="$(basename $@)" "&$(LATEX) $<\dump"
+
+%.bcf: %.tex %.fmt $(TEXS)
+ $(LATEX) $(LATEXFLAGS) $<
+
+%.bbl: %.bcf
+ $(BIBER) $(basename $@)
+
+%.pdf: %.tex %.fmt $(TEXS) %.bbl
+ $(LATEX) $(LATEXFLAGS) $< | tee $(basename $<).mlog
+ grep -qF 'Please rerun LaTeX.' $(basename $<).mlog &&\
+ $(LATEX) $(LATEXFLAGS) $< || true
+ $(RM) $(basename $<).mlog
+
+clean:
+ $(RM) $(addprefix $(DOC).,aux bbl bcf blg fmt log mlog run.xml out pdf toc)\
+ $(DOC)-blx.bib
diff --git a/thesis/intro.tex b/thesis/intro.tex
index 8640811..71a667e 100644
--- a/thesis/intro.tex
+++ b/thesis/intro.tex
@@ -3,14 +3,6 @@
\begin{multicols}{2}
-\subsection{Introduction}
-\label{sec:intro:intro}
-The Thumb-2 instruction set combines the best features of the ARM and Thumb instruction sets (speed and small code size, respectively).
-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
-
\subsection{ARM, Thumb and Thumb-2}
\label{sec:intro:arm-thumb-thumb2}
ARM is a RISC architecture with several enhancements to a basic RISC architecture allowing ARM processors to
@@ -56,17 +48,7 @@ ARM instructions have 4-bit register fields to address them.
Some 16-bit Thumb instructions have 3-bit register fields that can only address the lowest eight registers.
For these instructions there exist 32-bit variants that can address all sixteen registers.
-\subsubsection{Interworking}
-\label{sec:intro:interworking}
-The ARM and Thumb instruction sets are designed to \emph{interwork}:
- different parts of a program can be assembled for different instruction sets
- and it is possible to switch instruction set when the program counter is written to~\parencite[A4.1]{armv7ar}.
-
-The Thumb-2 code generator proposed in this thesis does not produce ARM code,
- though the existence of the interworking facility has effects on the techniques that can be used in it.
-This will be covered in \cref{sec:two-bits}.
-
-\begin{figure*}
+\begin{figure*}[t]
\centering
\begin{subfigure}[b]{.2\linewidth}
\centering
@@ -116,6 +98,16 @@ This will be covered in \cref{sec:two-bits}.
\caption{Rewriting a Clean node\label{fig:intro:rewriting}}
\end{figure*}
+\subsubsection{Interworking}
+\label{sec:intro:interworking}
+The ARM and Thumb instruction sets are designed to \emph{interwork}:
+ different parts of a program can be assembled for different instruction sets
+ and it is possible to switch instruction set when the program counter is written to~\parencite[A4.1]{armv7ar}.
+
+The Thumb-2 code generator proposed in this thesis does not produce ARM code,
+ though the existence of the interworking facility has effects on the techniques that can be used in it.
+This will be covered in \cref{sec:two-bits}.
+
\subsection{Clean}
\label{sec:intro:clean}
Clean is \enquote{a general purpose, state-of-the-art, pure and lazy functional programming language designed for making real-world applications}~\parencite{clean}.
diff --git a/thesis/preamble.tex b/thesis/preamble.tex
new file mode 100644
index 0000000..10c6d59
--- /dev/null
+++ b/thesis/preamble.tex
@@ -0,0 +1,84 @@
+\documentclass[a4paper,twoside]{article}
+
+\usepackage[hmarginratio={3:2}]{geometry}
+\usepackage{multicol}
+
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage[scaled]{beramono}
+
+\usepackage[british]{babel}
+\usepackage[babel=true]{csquotes}
+
+\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
+\definecolor{linkcolor}{rgb}{0,0.65,0}
+\definecolor{citecolor}{rgb}{0.65,0,0}
+\definecolor{urlcolor}{rgb}{0,0,0.65}
+\usepackage[colorlinks=true,linkcolor=linkcolor,urlcolor=urlcolor,citecolor=citecolor]{hyperref}
+
+\usepackage{cleveref}
+\crefname{figure}{figure}{figures}
+
+\usepackage[style=authoryear,backend=biber]{biblatex}
+\bibliography{thesis}
+\renewcommand\nameyeardelim{, }
+\DefineBibliographyStrings{english}{%
+ urlseen={Retrieved}
+}
+
+\usepackage{rutitlepage}
+\usepackage{latexgit}
+
+\usepackage{minted}
+\usepackage{mdframed}
+% Need to patch mdframed, see http://tex.stackexchange.com/a/292090/23992
+\usepackage{xpatch}
+\makeatletter
+\xpatchcmd{\endmdframed}
+ {\aftergroup\endmdf@trivlist\color@endgroup}
+ {\endmdf@trivlist\color@endgroup\@doendpe}
+ {}{}
+\makeatother
+\definecolor{mintedbg}{rgb}{0.95,0.95,0.95}
+\surroundwithmdframed[%
+ backgroundcolor=mintedbg,
+ linewidth=0pt,
+ skipabove=.5em,skipbelow=.5em]{minted}
+\setminted{%
+ autogobble,
+ tabsize=4,
+ fontsize=\scriptsize,
+ style=lovelace
+ %bgcolor=mintedbg
+}
+\setmintedinline{fontsize=\footnotesize,bgcolor={}}
+\usepackage{ual}
+\usepackage{clean}
+\newmintinline[bash]{bash}{style=bw}
+
+\usepackage{subcaption}
+\usepackage{tikz}
+\usetikzlibrary{positioning}
+
+\let\oldtexttt\texttt
+\def\texttt#1{\oldtexttt{\footnotesize #1}}
+
+\newcommand*{\blankpage}{%
+ \vspace*{\fill}
+ {\centering\it This page intentionally left blank.\par}
+ \vspace{\fill}}
+\makeatletter
+\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
+ \blankpage\thispagestyle{empty}\newpage
+ \if@twocolumn\hbox{}\newpage\fi\fi\fi}
+\makeatother
+
+\let\oldsection\section
+\renewcommand{\section}{\cleardoublepage\oldsection}
+
+\raggedcolumns
+\renewcommand{\baselinestretch}{1.1}
+
+\title{Code generation for Thumb-2 processors}
+\author{Camil Staps}
+\date{\gitcommitdate[formatDate]}
diff --git a/thesis/rutitlepage b/thesis/rutitlepage
-Subproject b6aa2bf105d774573dac37a810273fb225aa62a
+Subproject 8b8399fe636ee839ddfe6d545276f9ab2156b74
diff --git a/thesis/thesis.tex b/thesis/thesis.tex
index 1d2a54f..7e3ac1e 100644
--- a/thesis/thesis.tex
+++ b/thesis/thesis.tex
@@ -1,101 +1,30 @@
-\documentclass[a4paper,twoside]{amsart}
-
-\usepackage[hmarginratio={3:2}]{geometry}
-\usepackage{multicol}
-
-\usepackage[T1]{fontenc}
-\usepackage{lmodern}
-\usepackage[scaled]{beramono}
-
-\usepackage[british]{babel}
-\usepackage[babel=true]{csquotes}
-
-\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
-\definecolor{linkcolor}{rgb}{0,0.65,0}
-\definecolor{citecolor}{rgb}{0.65,0,0}
-\definecolor{urlcolor}{rgb}{0,0,0.65}
-\usepackage[colorlinks=true,linkcolor=linkcolor,urlcolor=urlcolor,citecolor=citecolor]{hyperref}
-
-\usepackage{cleveref}
-\crefname{figure}{figure}{figures}
-
-\usepackage[style=authoryear,backend=biber]{biblatex}
-\bibliography{thesis}
-\renewcommand\nameyeardelim{, }
-\DefineBibliographyStrings{english}{%
- urlseen={Retrieved}
-}
-
-\usepackage{rutitlepage}
-\usepackage{latexgit}
-
-\usepackage{minted}
-\usepackage{mdframed}
-% Need to patch mdframed, see http://tex.stackexchange.com/a/292090/23992
-\usepackage{xpatch}
-\makeatletter
-\xpatchcmd{\endmdframed}
- {\aftergroup\endmdf@trivlist\color@endgroup}
- {\endmdf@trivlist\color@endgroup\@doendpe}
- {}{}
-\makeatother
-\definecolor{mintedbg}{rgb}{0.95,0.95,0.95}
-\surroundwithmdframed[%
- backgroundcolor=mintedbg,
- linewidth=0pt,
- skipabove=.5em,skipbelow=.5em]{minted}
-\setminted{%
- autogobble,
- tabsize=4,
- fontsize=\scriptsize,
- style=lovelace
- %bgcolor=mintedbg
-}
-\setmintedinline{fontsize=\footnotesize,bgcolor={}}
-\usepackage{ual}
-\usepackage{clean}
-\newmintinline[bash]{bash}{style=bw}
-
-\usepackage{subcaption}
-\usepackage{tikz}
-\usetikzlibrary{positioning}
-
-\let\oldtexttt\texttt
-\def\texttt#1{\oldtexttt{\footnotesize #1}}
-
-\newcommand*{\blankpage}{%
- \vspace*{\fill}
- {\centering\it This page intentionally left blank.\par}
- \vspace{\fill}}
-\makeatletter
-\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
- \blankpage\thispagestyle{empty}\newpage
- \if@twocolumn\hbox{}\newpage\fi\fi\fi}
-\makeatother
-
-\let\oldsection\section
-\renewcommand{\section}{\clearpage\oldsection}
-
-\raggedcolumns
-
-\title{Code generation for Thumb-2 processors}
-\author{Camil Staps}
-\date{\gitcommitdate[formatDate]}
-
+%&thesis
\begin{document}
\maketitleru[
- course={Bachelor Thesis},
+ course={Bachelor Thesis\\[.4em]Computer Science},
authorstext={Author:},
authors={Camil Staps},
- righttextheader={Supervisors:},
- righttext={prof.~dr.~dr.h.c.~ir.~M.J.~Plasmeijer and drs.~J.H.G.~van~Groningen},
+ righttextheader={First supervisor:},
+ righttext={prof.~dr.~dr.h.c.~ir.~M.J.~Plasmeijer},
+ righttextBheader={Second supervisor:},
+ righttextB={drs.~J.H.G.~van~Groningen},
pagenr=1]
\setcounter{page}{2}
\cleardoublepage
+\begin{abstract}
+The Thumb-2 instruction set combines the best features of the ARM and Thumb instruction sets (speed and small code size, respectively).
+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
+\end{abstract}
+
+\cleardoublepage
+
\thispagestyle{empty}
\tableofcontents