3 ms·
If you want to be fluent in bare-metal, you must know the bare metal. Writing functions in bare metal provides performance boost over compilers only if know how
by nabla9 7y ago
If you want to be fluent in bare-metal, you must know the bare metal. Writing functions in bare metal provides performance boost over compilers only if know how to match the computation and data to the underlying architecture better than the compiler. Assembly is just a way to write it down.
There are two recently updated great books I recommend:
- Computer Architecture: A Quantitative Approach (2017) by Hennessy & Patterson
- Computer Organization and Design - RISC-V Edition (2017) by Hennessy & Patterson (I have the older MIPS edition)
You also need a book and documentation for the specific architecture (x86 or ARM), but the two books above teach generic stuff that is useful everywhere.
If you do numerical HPC programming, you usually write very little assembly. You might add some some inline Assembler tweaks inside (C/C++/Fortran) functions when needed. You must know to program in C, C++ or Fortran depending on what the code base you are working on uses and how to embed assembly code inside them.
EDIT: CUDA programming might be important to learn if you want to do low level numerical programming.
- na85 7y agoIn the case of x86 where the microcode is fluid and can be patched, and frankly does not really represent what the processor is really doing, can assembly really be considered "bare metal" these days?
- p1esk 7y agoThese days even programming mainstream FPGAs with Verilog is not really “bare metal”. Lots of complexity and control is hidden.