I wonder: since there are only thirteen factorials that fit into int32, and thus only 13 possible valid inputs, is it faster or slower to use a very small lookup table? https://godbolt.org/g/9ii0S0 It seems like this is the sort of thing a good compiler can figure out on its own, but I don't fully understand what clang is doing with this loop: https://godbolt.org/g/ze5ycb
This was neat. I enjoyed reading it. It wouldn't take much more to add the level below the machine code to this write up showing how the bits in the in the opcode generate control signals to carry out the micro-ops that make up the function.
I used to have a visual example of how it works. Couldn't find it in a quick search. Anyway, here's a text example for PDP-11 to illustrate what it looks like along with a detailed paper on concepts and some tooling.
Oh sure, I know. I was just staying it would be a nice addition, since the post is pretty original and novel. By the way was this the link you were thinking of?
Glad you found something fun. If it's L3 for CPU's you mean, then one project of value nobody has done is put in specs for VAMP processor. It was mathematically verified in PVS as part of Verisoft project. They did OS and C subset for it. Adding it to L3 and Myreen et al's toolkit for doing machine code in Isabelle/HOL would let their spec-to-machine-code verifications run on a verified processor.
Just throwing that out there for you or anyone interested in lengthening the chain of verification. VAMP doesn't get enough attention. On HW side, someone could do a verified front-end for RISC-V on top of the VAMP components to get a mostly-verified RISC-V. Lots of low-hanging fruit out there.
If the author is reading this thread, would you please comment on how math expressions are rendered in your blog? The factorial definition near the beginning looks absolutely perfect. I'd like to learn how to do this in Jekyll.
Not the author, but their page is using the client-side javascript MathJax renderer https://www.mathjax.org/ which renders the mathematical subset of LaTeX.
14 comments
[ 3.9 ms ] story [ 79.7 ms ] threadThis is code produced by GHC 8.0.2 for the program
The module thing is necessary to produce the object file without a "main" function.http://www.cdf.toronto.edu/~ajr/258/notes/micro/microcode.ht...
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.472...
https://cseweb.ucsd.edu/classes/wi13/cse141-b/slides/05-Sing...
By the they way second link is a nice read. Thanks.
http://www.cl.cam.ac.uk/~mom22/miniml/hol2miniml.pdf
The resulting ML can be compiled to assembly by verified, CakeML compiler.
https://cakeml.org
[1] https://www.cse.unsw.edu.au/~cs4161/lect.html
Just throwing that out there for you or anyone interested in lengthening the chain of verification. VAMP doesn't get enough attention. On HW side, someone could do a verified front-end for RISC-V on top of the VAMP components to get a mostly-verified RISC-V. Lots of low-hanging fruit out there.