1
0
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:
Bruce Mitchener
2021-01-30 14:18:09 +07:00
committed by GitHub
parent 0480fee86c
commit b09663b3e9
9 changed files with 26 additions and 47 deletions

View File

@@ -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 */

View File

@@ -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)

View File

@@ -66,6 +66,7 @@
#include "array6defs.h"
#include "bitbltdefs.h"
#include "bltdefs.h"
#include "byteswapdefs.h"
#include "car-cdrdefs.h"
#include "commondefs.h"
#include "conspagedefs.h"