cosmopolitan/libc/nexgen32e
Justine Tunney face6b61d5 Add APE support for 32-bit programs
This is an experimental proof of concept demo:

    make -j8 o//examples/i386.i386.com
    o//examples/i386.i386.com --32
    echo $?  # <-- prints main32's argc parameter

Please note there's no libc support at the moment. This change is just
for fun and shouldn't be interpreted as intent to support. Having this
project on the whole support i386 would be tough because the calling
conventions are so different. There really isn't much in the way of low
hanging fruit opportunities to do something like NOP out REX prefixes
and call it a day. It'd likely need disjoint builds or possibly better
yet really cleverly crafted code generation in //third_party/chibicc!

Another challenge is is that Linux changed its SYSCALL ordinals when it
migrated from i386 to x86_64. Linux used to use the same magic numbers
as everyone else for functions like exit/write/read/etc. BSDs on the
other hand didn't pointlessly renumber things. So we'd need to find a
way to define the ordinals in libc/sysv/syscalls.sh twice for Linux. The
same goes for other ISAs too. Especially MIPS. For the Linux Kernel
alone, syscall magic numbers and data structure layouts are totally
different, and that's likely the case for other ISAs on other operating
systems too. Probably because ISA code historically got contributed to
open source by the companies that made the chips. Ulrich Drepper wrote
an amusing essay on the subject some years back.
2021-02-20 15:58:48 -08:00
..
doc Fix Clang support 2021-02-06 00:29:09 -08:00
bench.h Initial import 2020-06-15 07:18:57 -07:00
bsf.h Add chibicc 2020-12-06 16:20:21 -08:00
bsr.h Add chibicc 2020-12-06 16:20:21 -08:00
bsrmax.S Add APE support for 32-bit programs 2021-02-20 15:58:48 -08:00
bzero.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cachesize.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
cescapec.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpsb.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpsl.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpsq.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpsw.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpub.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpul.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpuq.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cmpuw.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
cpuid4.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
crc32-pclmul.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
crc32.h Fix Clang support 2021-02-06 00:29:09 -08:00
crc32init.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
div10int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
div100int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
div1000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
div10000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
div1000000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
div1000000000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
djbsort-avx2.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
environ.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
errno.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
errnolocation.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
explicit_bzero.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
fentry.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
ffs.h Auto-generate some documentation 2020-12-26 02:09:07 -08:00
ffs.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
ffsl.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
g_argv.S Change license 2020-12-27 17:18:44 -08:00
g_auxv.S Change license 2020-12-27 17:18:44 -08:00
gc.internal.h Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
gc.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
gclongjmp.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
hascharacter.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
identity.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
imapxlatab.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
kbase36.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
kcp437.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
kcpuids.h Auto-generate some documentation 2020-12-26 02:09:07 -08:00
kcpuids.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
kcrc32ctab.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
khalfcache3.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
kompressor.h Initial import 2020-06-15 07:18:57 -07:00
kreversebits.S Change license 2020-12-27 17:18:44 -08:00
ksha256tab.S Add scouts honor escape hatch for source embedding 2020-06-15 19:01:28 -07:00
ksigsetempty.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
ksigsetfull.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
kstarttsc.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
ktolower.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
llog10.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
loadxmm.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
lolendian.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
longjmp.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
lz4.h Improve dead code elimination 2021-02-08 04:04:42 -08:00
lzcnt.h Initial import 2020-06-15 07:18:57 -07:00
lzcnt.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
lzcntl.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
macros.h Make improvements 2020-12-01 03:43:40 -08:00
macros.internal.inc Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
mcount.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memcpy.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memeqmask.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memjmpinit.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memmove.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
mempcpy.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memrchr.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memrchr16.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memrchr32.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
memset.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
missingno.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
msr.h Initial import 2020-06-15 07:18:57 -07:00
nexgen32e.h Make more functions friendly to Address Sanitizer 2021-02-02 03:45:31 -08:00
nexgen32e.mk Make more functions friendly to Address Sanitizer 2021-02-02 03:45:31 -08:00
nt2sysv.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
nt2sysv.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
pcmpstr.inc Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
program_invocation_name.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rdtsc.h Initial import 2020-06-15 07:18:57 -07:00
rdtscp.h Get binaries closer to running without an o/s 2020-11-02 19:12:47 -08:00
rem10int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rem100int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rem1000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rem10000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rem1000000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rem1000000000int64.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
rldecode.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
savexmm.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
setjmp.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
slowcall.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
slowcall.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
stackframe.h Get address sanitizer mostly working 2020-09-03 05:44:37 -07:00
strcpyzbw.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strcspn.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strlen.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strsak.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strsak16.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strsak32.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strstr-sse42.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strstr.inc Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
strstr16-sse42.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinydivsi.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinystrlen.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinystrlen.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
tinystrlen16.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinystrncmp.ncabi.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinystrnlen.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinystrnlen16.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinywcslen.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tinywcsnlen.greg.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
trampoline.h Replace .pushsection directives (#30) 2021-01-10 13:36:31 -08:00
triplf.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tzcnt.h Initial import 2020-06-15 07:18:57 -07:00
tzcnt.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
tzcntl.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
uart.internal.h Add epoll and do more release readiness changes 2020-11-28 12:01:51 -08:00
vcls.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
vendor.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
vidya.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
wmemset.inc Change license 2020-12-27 17:18:44 -08:00
x86compiler.h Initial import 2020-06-15 07:18:57 -07:00
x86feature.h Add pseudoteletypewriter to emulator 2020-08-29 23:51:09 -07:00
x86info.h Improve dead code elimination 2021-02-08 04:04:42 -08:00
x87conf.inc Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
xlm.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
zip.S Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00