This shows you the differences between two versions of the page.
iocla:cursuri:curs-12 [2019/09/24 11:27] cristian.vijelie |
iocla:cursuri:curs-12 [2019/12/31 20:25] (current) razvan.deaconescu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Curs 10 - 11: Functii ====== | + | ====== Curs 12: C + asm ====== |
<html> | <html> | ||
- | <iframe src="https://ctipub-my.sharepoint.com/personal/dragos_niculescu_upb_ro/_layouts/15/Doc.aspx?sourcedoc={b1bf8df5-fc2d-4748-a6bc-82cd8882141e}&action=embedview&wdAr=1.3333333333333333" width="722px" height="565px" frameborder="0">This is an embedded <a target="_blank" href="https://office.com">Microsoft Office</a> presentation, powered by <a target="_blank" href="https://office.com/webapps">Office</a>.</iframe> | + | <iframe src="https://ctipub-my.sharepoint.com/personal/dragos_niculescu_upb_ro/_layouts/15/Doc.aspx?sourcedoc={32da1aa4-6b1d-4ed8-a794-42493a904e97}&action=embedview&wdAr=1.3333333333333333" width="722px" height="565px" frameborder="0">This is an embedded <a target="_blank" href="https://office.com">Microsoft Office</a> presentation, powered by <a target="_blank" href="https://office.com/webapps">Office</a>.</iframe> |
</html> | </html> | ||
- | * [[https://ctipub-my.sharepoint.com/:p:/g/personal/dragos_niculescu_upb_ro/EfWNv7Et_EhHpryCzYiCFB4BV3j_qWeDS5e2rA2fGRaxNg?e=JwnwyJ|Curs 10 - 11: Functii ]] | + | * [[https://ctipub-my.sharepoint.com/:p:/g/personal/dragos_niculescu_upb_ro/EaQa2jIda9hOp5RCSTqQTpcBeNlXwd0D_zZjZtp36LW9QQ?e=FZ7r1u|Curs 12: C + asm ]] |
* Suport curs | * Suport curs | ||
- | * Ray Sefarth, "Introduction to 64 Bit Intel Assembly Language Programming for Linux", 2011, capitolul 15 | + | * Sivarama P. Dandamudi: Introduction to Assembly Language Programming |
- | * Richard Blum, "Professional Assembly Language", 2005, capitolul 16 | + | * Chapter 17: High-Level Language Interface |
- | * De citit, alte surse | + | |
- | * [[http://agner.org/optimize/| Agner Fog optimization manuals - optimizarea e un curs de semestru! ]] | + | |
- | * [[https://danluu.com/assembly-intrinsics/|Hand coded assembly beats intrinsics in speed and simplicity]] | + | |
- | * [[http://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel|Let's write a kernel]] | + | |
- | * [[http://neilkemp.us/src/sse_tutorial/sse_tutorial.html|Intel SSE Tutorial : An Introduction to the SSE Instruction Set]] | + | |
- | + | ||
- | + | ||
===== Demo-uri ===== | ===== Demo-uri ===== | ||
- | Pentru parcurgerea demo-urilor, folosim<code bash> | + | Demo-urile se găsesc în [[https://github.com/iocla/demo|repository]]. Pentru a clona și accesa repository-ul folosiți comenzile: |
- | git clone https://github.com/iocla/curs-12-demo.git | + | <code> |
- | </code> și accesăm directorul rezultat în urma decomprimării<code bash> | + | git clone https://github.com/iocla/demo iocla-demo.git |
- | cd curs-12-demo/ | + | cd iocla-demo.git/ |
</code> | </code> | ||
- | Acum putem parcurge secțiunile cu demo-uri de mai jos. | + | Apoi accesați directorul ''curs-12/'' folosind, în directorul repository-ului (''iocla-demo.git/'') comanda: |
- | + | <code> | |
- | ==== Demo ==== | + | cd curs-12/ |
- | + | </code> | |
- | ''cd curs-12-demo/'' | + | |
- | + | ||
- | ''cat /proc/cpuinfo | grep Hz'' | + | |
- | + | ||
- | ''make'' | + | |
- | + | ||
- | ''./test_freq'' | + | |
- | estimează frecvența procesorului folosind registrul TSC pentru sleep(1) | + | |
- | + | ||
- | ''./test_rdtsc'' | + | |
- | în bucla rep trebuie încercate diverse combinații de instrucțiuni. | + | |
- | Programul afișează numărul de instrucțiuni din buclă și numărul de cicli folositi. | + | |
- | + | ||
- | ''./test_sse'' | + | |
- | se compară viteza de execuție cu operații SSE cu prelucrarea clasică octet cu octet | + | |
- | + | ||
- | ''./lock'' | + | |
- | Cum arată inline assembly? Cu C++ | + | |
- | Cum arată un "race condition"? | + | |
- | Instrucțiunile nu sunt atomice! | + | |
- | Prefixul lock. | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||