x86-64 nativní backend pro TinyC
x86-64 native backend for TinyC
Typ dokumentu
diplomová prácemaster thesis
Autor
Michal Vlasák
Vedoucí práce
Máj Petr
Oponent práce
Siek Konrad
Studijní obor
Systémové programováníStudijní program
InformatikaInstituce přidělující hodnost
katedra teoretické informatikyPráva
A university thesis is a work protected by the Copyright Act. Extracts, copies and transcripts of the thesis are allowed for personal use only and at one?s own expense. The use of thesis should be in compliance with the Copyright Act http://www.mkcr.cz/assets/autorske-pravo/01-3982006.pdf and the citation ethics http://knihovny.cvut.cz/vychova/vskp.htmlVysokoškolská závěrečná práce je dílo chráněné autorským zákonem. Je možné pořizovat z něj na své náklady a pro svoji osobní potřebu výpisy, opisy a rozmnoženiny. Jeho využití musí být v souladu s autorským zákonem http://www.mkcr.cz/assets/autorske-pravo/01-3982006.pdf a citační etikou http://knihovny.cvut.cz/vychova/vskp.html
Metadata
Zobrazit celý záznamAbstrakt
Tato práce popisuje backend překladače, který kompiluje TinyC mezireprezentaci do nativních x86-64 instrukcí. Cílem bylo vytvořit překladač, který by ukázal složitosti spojené s architekturou x86-64, zvláště pak ve srovnání s architekturou Tiny86, kterou používají studenti předmětu NI-GEN. V teoretické části je dán zvláštní zřetel na historii architektury x86-64 a pravou podstatu jejích omezení. Je vyhodnocen dosavadní výzkum v oblasti backendů překladačů a to s přihlédnutím k možnostem architektury x86-64. Práce prezentuje návrh x86-64 TinyC backendu. Ten je založen na výběru instrukcí extenzivní peephole optimalizací a na alokaci registrů barvením grafů. Implementace samotná je důkladně rozebrána a mnoho praktických detailů je zváženo a vysvětleno. Přeložené programy mohou buď využít systémový runtime jazyka C, nebo na Linuxu mohou být rozšířeny o vlastní minimalistický runtime dovolující programům běžet bez externích závislostí. Text této práce a implementace jsou volně dostupné a mohou být použity nejen studenty předmětu NI-GEN. This thesis describes a compiler back end compiling TinyC IR to x86-64 native machine code. The goal was to create a compiler that would showcase additional difficulties imposed by the x86-64 architecture, especially compared to the simplified Tiny86 architecture targeted by students in the NI-GEN course. In the theoretical part a close attention is paid to x86-64's history and the true nature of its limitations. Existing compiler back end research is surveyed and evaluated with respect to x86-64's capabilities. A design for a x86-64 TinyC back end is presented. It is based on instruction selection by extensive peephole optimization and graph coloring register allocation. The implementation itself is presented thoroughly and many practical details are considered and explained. The compiled programs are either able to use the system C runtime, or on Linux can be bundled with a custom minimalistic runtime allowing the programs to run without any dependencies. The text of this thesis and the implementation are freely available, and can be used not only by NI-GEN students.
Kolekce
- Diplomové práce - 18101 [208]