mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-27 12:22:24 +00:00
Inline swapx and byte_swap_word. (#323)
This lets us remove `SWAP_WORDS` and some bits of assembly.
This commit is contained in:
@@ -27,24 +27,6 @@
|
||||
|
||||
#include "byteswapdefs.h"
|
||||
|
||||
/****************************************************************/
|
||||
/* */
|
||||
/* swap halves of a single 4-byte word */
|
||||
/* */
|
||||
/****************************************************************/
|
||||
unsigned int swapx(unsigned int word) {
|
||||
return (((word >> 16) & 0xffff) | ((word & 0xffff) << 16));
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
/* */
|
||||
/* Byte-swap a single 2-byte word */
|
||||
/* */
|
||||
/****************************************************************/
|
||||
unsigned short byte_swap_word(unsigned short word) {
|
||||
return (((word >> 8) & 0xff) | ((word & 0xff) << 8));
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
/* */
|
||||
/* Byte-swap a region wordcount words long */
|
||||
|
||||
@@ -90,14 +90,6 @@ done: ! else done;
|
||||
be fixed through the ifdef flats.
|
||||
*/
|
||||
|
||||
/* SWAP halves of a register */
|
||||
|
||||
.inline _swapx,4
|
||||
sll %o0,16,%o1
|
||||
srl %o0,16,%o0
|
||||
or %o0,%o1,%o0
|
||||
.end
|
||||
|
||||
/*
|
||||
***************************************************************
|
||||
DIFFERENCE VERSIONS sp@ - sp@(4) i.e. (tos-1) - (tos)
|
||||
|
||||
Reference in New Issue
Block a user