1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 07:54:13 +00:00
Bruce Mitchener d717946929
Cleanup byteswap.c a bit (#154)
* Remove word_swap_longword.

This was the same as `swapx` and not used except in one place which
now uses `swapx` instead.

* Remove assembly versions of swapx, byte_swap_word, word_swap_page.

`swapx` and `byte_swap_word` were defined as:

```
extern inline const unsigned int swapx (unsigned int word)
{
   asm("roll  $16,%0" : "=g" (word) : "0" (word));
   return(word);
}

extern inline const unsigned short byte_swap_word (unsigned short word)
{
   asm("rolw  $8,%0" : "=r" (word) : "0" (word));

   return(word);
}
```

But the generated code from the C version is:

```
(lldb) disassemble -n swapx
ldex`swapx:
ldex[0x10002e0d0] <+0>:  pushq  %rbp
ldex[0x10002e0d1] <+1>:  movq   %rsp, %rbp
ldex[0x10002e0d4] <+4>:  movl   %edi, %eax
ldex[0x10002e0d6] <+6>:  roll   $0x10, %eax
ldex[0x10002e0d9] <+9>:  popq   %rbp
ldex[0x10002e0da] <+10>: retq

(lldb) disassemble -n byte_swap_word
ldex`byte_swap_word:
ldex[0x10002e0e0] <+0>:  pushq  %rbp
ldex[0x10002e0e1] <+1>:  movq   %rsp, %rbp
ldex[0x10002e0e4] <+4>:  rolw   $0x8, %di
ldex[0x10002e0e8] <+8>:  movzwl %di, %eax
ldex[0x10002e0eb] <+11>: popq   %rbp
ldex[0x10002e0ec] <+12>: retq
```

So we don't really stand to gain by re-enabling this old assembler code.

We would gain from switching to C99 or C11 and improving our
inlining.

* Remove 386 asm version of bit_reverse_region.

This is implemented in C and the code isn't actually set up to
allow using the assembler version.
2020-12-31 10:29:19 -08:00
2020-12-31 10:29:19 -08:00
2020-12-31 10:29:19 -08:00
2020-12-29 11:00:24 -08:00

Maiko

This is the implementation of the Medley Interlisp virtual machine, for a byte-coded Lisp instruction set and some low-level functions for connecting with Lisp for access to display and disk etc.

There are make file fragments that include all the flags and variables you have to set for each hardware/OS target.

  • cd to the "bin" directory
  • have "." on your PATH
  • do "./makeright x"

It will (attempt to) detect the OS-type and cpu-type, and put together the makefile parts that it needs. It will build in ../ostype.cputype-x (for the .o files) and ../ostype.cputype for the executables.

Development Platforms

We are developing on FreeBSD, Linux, macOS, and Solaris currently on arm, arm64, PowerPC, SPARC, x86, and x86_64 hardware.

We believe it will work on these platforms.

Fixes and improvements for additional platforms and hardware is welcome. Work is underway to run better on Windows.

In the past, Maiko ran on DOS. This may or may not still work.

Languages
C 95.6%
Assembly 3.4%
CMake 0.5%
Shell 0.3%
sed 0.2%