sim: move scache init to dynamic modules.c
[deliverable/binutils-gdb.git] / sim / common / sim-bits.h
index fb6a8218d67594a13ce24f065733e178a7ca90dd..f8c2563e5bd163613f8735f7254c385088c97ba9 100644 (file)
@@ -1,6 +1,6 @@
 /* The common simulator framework for GDB, the GNU Debugger.
 
-   Copyright 2002-2015 Free Software Foundation, Inc.
+   Copyright 2002-2021 Free Software Foundation, Inc.
 
    Contributed by Andrew Cagney and Red Hat.
 
    EXTEND*(VALUE): Convert the `*' bit value to the targets natural
    word size.  Sign extend the value if needed.
 
-   ALIGN_*(VALUE): Round the value upwards so that it is aligned to a
-   `_*' byte boundary.
-
-   FLOOR_*(VALUE): Truncate the value so that it is aligned to a `_*'
-   byte boundary.
+   align_*(VALUE, BYTES): Round the value so that it is aligned to a
+   BYTES boundary.
 
    ROT*(VALUE, NR_BITS): Return the `*' bit VALUE rotated by NR_BITS
    right (positive) or left (negative).
@@ -501,11 +498,14 @@ INLINE_SIM_BITS(unsigned_word) MSINSERTED (unsigned_word val, int start, int sto
 
 #define EXTEND4(X)  (LSSEXT ((X), 3))
 #define EXTEND5(X)  (LSSEXT ((X), 4))
+#define EXTEND6(X)  (LSSEXT ((X), 5))
 #define EXTEND8(X)  ((signed_word)(signed8)(X))
 #define EXTEND11(X)  (LSSEXT ((X), 10))
+#define EXTEND12(X)  (LSSEXT ((X), 11))
 #define EXTEND15(X)  (LSSEXT ((X), 14))
 #define EXTEND16(X) ((signed_word)(signed16)(X))
 #define EXTEND24(X)  (LSSEXT ((X), 23))
+#define EXTEND25(X)  (LSSEXT ((X), 24))
 #define EXTEND32(X) ((signed_word)(signed32)(X))
 #define EXTEND64(X) ((signed_word)(signed64)(X))
 
@@ -522,14 +522,8 @@ INLINE_SIM_BITS(unsigned_word) MSINSERTED (unsigned_word val, int start, int sto
 
 
 /* memory alignment macro's */
-#define _ALIGNa(A,X)  (((X) + ((A) - 1)) & ~((A) - 1))
-#define _FLOORa(A,X)  ((X) & ~((A) - 1))
-
-#define ALIGN_8(X)     _ALIGNa (8, X)
-#define ALIGN_16(X)    _ALIGNa (16, X)
-
-#define ALIGN_PAGE(X)  _ALIGNa (0x1000, X)
-#define FLOOR_PAGE(X)   ((X) & ~(0x1000 - 1))
+#define align_up(v, n)         (((v) + (n) - 1) & -(n))
+#define align_down(v, n)       ((v) & -(n))
 
 
 /* bit bliting macro's */
This page took 0.02448 seconds and 4 git commands to generate.