3 ms·
SBCL is mostly written in Common Lisp. It has a compiler that can compile itself. Part of that compiler are definitions of building blocks (VOPs or virtual oper
by fiveop 9y ago
SBCL is mostly written in Common Lisp. It has a compiler that can compile itself. Part of that compiler are definitions of building blocks (VOPs or virtual operations) that describe snippets of assembly code. So as always, you use the tools provided by Lisp to create a DSL that allows you to write code as is practical for your use case.
For an example look at https://github.com/sbcl/sbcl/blob/master/src/compiler/x86-64/arith.lisp#L1681 https://github.com/sbcl/sbcl/blob/master/src/compiler/x86-64...
You can find similar code for other ISAs in neighbouring directories.