A Pile of Parens - Episode 0 - Trying to learn some SIMD
Channel: Baggers
Date: 2018-10-24

Allo, in this week's stream we didnt push pixels but instead looked into how to add sse intrinsics to SBCL.

## WARNING ##

I do not know:

- assembly code programming
- low level programming
- simd
- sbcl internals
- what I'm talking about

Please don't use anything in here as advice or trust what I'm saying without looking it up first. I'm a total noob at this stuff and am only streaming it because it's fun to do with you lovely folks

Also if you find issues, please do not both the SBCL people about it. It's not their job do deal with the fallout of my lack of understanding

#############

We did make some progress and performed 4 dot products at once using simd by the end of the stream. We also learned a bit about sbcl's define-vop & defknown.

Thanks to everyone who could stop by, especially those in the twitch stream for the first time.

Not sure what we are doing next week, guess we'll find out then.

Peace

# Links!

- First Handmade Hero SIMD episode (fantastic stuff) https://www.youtube.com/watch?v=YnnTb0AQgYM&t=1s

- Intel Intrinsic Guide: Super useful for SIMD from C/C++: https://software.intel.com/sites/landingpage/IntrinsicsGuide/

- Intel Architecture Manuals: https://software.intel.com/sites/default/files/managed/a4/60/253665-sdm-vol-1.pdf

- Agner Fog is a lord of optimizing, heed his words: https://www.agner.org/optimize/

- Peter Cordes writes amazing answers to x86 asm related question on stackoverflow. They are a goldmine of info, links and hints: https://stackoverflow.com/search?q=user:224132+[x86]

- A very unofficial wiki to random stuff in the SBCL compiler: https://github.com/guicho271828/sbcl-wiki/wiki

- Paul Khuong's excellent blog: http://pvk.ca
 - https://www.pvk.ca/Blog/2013/06/05/fresh-in-sbcl-1-dot-1-8-sse-intrinsics/
 - https://www.pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/
 - https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/

- 'What Every Programmer Should Know About Memory' want to optimize code, read this first: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf

- Outstanding talk as an intro to SIMD and why it's useful: https://www.gdcvault.com/play/1022248/SIMD-at-Insomniac-Games-How
- Another lovely presentation on cpu, cache & simd from a chap at Valve: https://www.youtube.com/watch?v=Nsf2_Au6KxU
- Excllent talk for getting interested in how thinking about the architecture lets you make things that perform well: https://www.gdcvault.com/play/1014645/Hotspots-FLOPS-and-uOps-To


- Code with a massive VOP we didnt have time to look at in the episode: https://github.com/froydnj/ironclad/blob/master/src/sbcl-opt/x86oid-vm.lisp