Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/include Provide assmebler versions of BITS(3) ...



details:   https://anonhg.NetBSD.org/src/rev/964e90dff187
branches:  trunk
changeset: 974811:964e90dff187
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Aug 12 08:56:37 2020 +0000

description:
Provide assmebler versions of BITS(3) macros.  These are only good for
32 bit masks

diffstat:

 sys/arch/mips/include/asm.h |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r fa41e518de26 -r 964e90dff187 sys/arch/mips/include/asm.h
--- a/sys/arch/mips/include/asm.h       Wed Aug 12 08:53:20 2020 +0000
+++ b/sys/arch/mips/include/asm.h       Wed Aug 12 08:56:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asm.h,v 1.60 2020/08/10 14:37:38 skrll Exp $   */
+/*     $NetBSD: asm.h,v 1.61 2020/08/12 08:56:37 skrll Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -57,6 +57,13 @@
 #include <sys/cdefs.h>         /* for API selection */
 #include <mips/regdef.h>
 
+#define        __BIT(n)        (1 << (n))
+#define        __BITS(hi,lo)   ((~((~0)<<((hi)+1)))&((~0)<<(lo)))
+
+#define        __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask))
+#define        __SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask))
+#define        __SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask))
+
 /*
  * Define -pg profile entry code.
  * Must always be noreorder, must never use a macro instruction



Home | Main Index | Thread Index | Old Index