1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 15:57: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-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 10:29:19 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
cr
2020-08-11 18:39:45 -07:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 10:29:19 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-28 10:10:43 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 00:16:03 +00:00
2020-12-28 10:10:43 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-31 01:28:34 +00:00
2020-12-31 01:28:34 +00:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-22 22:57:40 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:59:41 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-28 10:10:43 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 01:28:34 +00:00
2020-12-19 19:08:52 -08:00
2020-12-31 00:16:03 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-26 20:53:47 +00:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-19 19:08:52 -08:00
2020-12-31 00:16:03 +00:00