#include <sparc/asm.h>
#ifdef _LP64
#define BASEREG %g4
#define LNGSZ 8
#define LNGSHFT 3
#define PTRSZ 8
#define PTRSHFT 3
#define POINTER .xword
#define ULONG .xword
#define LDLNG ldx
#define LDULNG ldx
#define STLNG stx
#define STULNG stx
#define LDPTR ldx
#define LDPTRA ldxa
#define STPTR stx
#define STPTRA stxa
#define CASPTR casx
#define CASPTRA casxa
#define STKB BIAS
#define CCCR %xcc
#else
#define BASEREG %g0
#define LNGSZ 4
#define LNGSHFT 2
#define PTRSZ 4
#define PTRSHFT 2
#define POINTER .word
#define ULONG .word
#define LDLNG ldsw
#define LDULNG lduw
#define STLNG stw
#define STULNG stw
#define LDPTR lduw
#define LDPTRA lduwa
#define STPTR stw
#define STPTRA stwa
#define CASPTR cas
#define CASPTRA casa
#define STKB 0
#define CCCR %icc
#endif
#if defined(_KERNEL) || defined(_RUMPKERNEL)
#define NOTREACHED sir
#else
#define NOTREACHED
#endif
#define BCOPY_SMALL 32
#define _ALIGN .align 8
#define ICACHE_ALIGN .align 32
#define COMBINE(r1, r2, d) \
clruw r2; \
sllx r1, 32, d; \
or d, r2, d
#define SPLIT(s, r0, r1) \
srl s, 0, r1; \
srlx s, 32, r0
#define SPLIT_RETL(s, r0, r1) \
srl s, 0, r1; \
retl; \
srlx s, 32, r0