Make terminal ui binaries work well everywhere

Here's some screenshots of an emulator tui program that was compiled on
Linux, then scp'd it to Windows, Mac, and FreeBSD.

https://justine.storage.googleapis.com/blinkenlights-cmdexe.png
https://justine.storage.googleapis.com/blinkenlights-imac.png
https://justine.storage.googleapis.com/blinkenlights-freebsd.png
https://justine.storage.googleapis.com/blinkenlights-lisp.png

How is this even possible that we have a nontrivial ui binary that just
works on Mac, Windows, Linux, and BSD? Surely a first ever achievement.

Fixed many bugs. Bootstrapped John McCarthy's metacircular evaluator on
bare metal in half the size of Altair BASIC (about 2.5kb) and ran it in
emulator for fun and profit.
This commit is contained in:
Justine Tunney 2020-10-10 21:18:53 -07:00
parent 680daf1210
commit 9e3e985ae5
276 changed files with 7026 additions and 3790 deletions

View file

@ -23,14 +23,14 @@
tinymath_ceil:
.leafprologue
.profilable
movsd .Llol(%rip),%xmm1
movsd .Lcat(%rip),%xmm2
movsd nan(%rip),%xmm1
movsd sig(%rip),%xmm2
andpd %xmm0,%xmm1
comisd %xmm1,%xmm2
jbe 1f
cvttsd2siq %xmm0,%rax
pxor %xmm1,%xmm1
movsd .Lmog(%rip),%xmm2
movsd one(%rip),%xmm2
cvtsi2sdq %rax,%xmm1
cmpnlesd %xmm1,%xmm0
andpd %xmm2,%xmm0
@ -39,16 +39,9 @@ tinymath_ceil:
.endfn tinymath_ceil,globl
.alias tinymath_ceil,ceil
.rodata.cst16
.Llol: .long 4294967295
.long 2147483647
.long 0
.long 0
.rodata.cst8
.Lcat: .long 0
.long 1127219200
.Lmog: .long 0
.long 1072693248
nan: .double nan
sig: .double 0x0010000000000000
one: .double 1
/ vroundsd $_MM_FROUND_TO_POS_INF|_MM_FROUND_NO_EXC,%xmm0,%xmm0,%xmm0