coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bits.h File Reference

Go to the source code of this file.

Macros

#define CONST_POPCOUNT2(x)   ((((x) >> 0) & 1) + (((x) >> 1) & 1))
 
#define CONST_POPCOUNT4(x)   (CONST_POPCOUNT2(x) + CONST_POPCOUNT2((x)>>2))
 
#define CONST_POPCOUNT8(x)   (CONST_POPCOUNT4(x) + CONST_POPCOUNT4((x)>>4))
 
#define CONST_POPCOUNT16(x)   (CONST_POPCOUNT8(x) + CONST_POPCOUNT8((x)>>8))
 
#define CONST_POPCOUNT32(x)   (CONST_POPCOUNT16(x) + CONST_POPCOUNT16((x)>>16))
 
#define CONST_POPCOUNT64(x)   (CONST_POPCOUNT32(x) + CONST_POPCOUNT32((x)>>32))
 
#define CONST_POPCOUNT(x)   CONST_POPCOUNT64(x)
 
#define CONST_CTZ2(x)   CONST_POPCOUNT2(((x) & -(x))-1)
 
#define CONST_CTZ4(x)   CONST_POPCOUNT4(((x) & -(x))-1)
 
#define CONST_CTZ8(x)   CONST_POPCOUNT8(((x) & -(x))-1)
 
#define CONST_CTZ16(x)   CONST_POPCOUNT16(((x) & -(x))-1)
 
#define CONST_CTZ32(x)   CONST_POPCOUNT32(((x) & -(x))-1)
 
#define CONST_CTZ64(x)   CONST_POPCOUNT64(((x) & -(x))-1)
 
#define CONST_CTZ(x)   CONST_CTZ64(x)
 
#define STR(x)   XSTR(x)
 
#define XSTR(x)   #x
 
#define SLL32   sll
 
#define STORE   sw
 
#define LOAD   lw
 
#define LWU   lw
 
#define LOG_REGBYTES   2
 
#define REGBYTES   (1 << LOG_REGBYTES)
 

Macro Definition Documentation

◆ CONST_CTZ

#define CONST_CTZ (   x)    CONST_CTZ64(x)

Definition at line 20 of file bits.h.

◆ CONST_CTZ16

#define CONST_CTZ16 (   x)    CONST_POPCOUNT16(((x) & -(x))-1)

Definition at line 17 of file bits.h.

◆ CONST_CTZ2

#define CONST_CTZ2 (   x)    CONST_POPCOUNT2(((x) & -(x))-1)

Definition at line 14 of file bits.h.

◆ CONST_CTZ32

#define CONST_CTZ32 (   x)    CONST_POPCOUNT32(((x) & -(x))-1)

Definition at line 18 of file bits.h.

◆ CONST_CTZ4

#define CONST_CTZ4 (   x)    CONST_POPCOUNT4(((x) & -(x))-1)

Definition at line 15 of file bits.h.

◆ CONST_CTZ64

#define CONST_CTZ64 (   x)    CONST_POPCOUNT64(((x) & -(x))-1)

Definition at line 19 of file bits.h.

◆ CONST_CTZ8

#define CONST_CTZ8 (   x)    CONST_POPCOUNT8(((x) & -(x))-1)

Definition at line 16 of file bits.h.

◆ CONST_POPCOUNT

#define CONST_POPCOUNT (   x)    CONST_POPCOUNT64(x)

Definition at line 12 of file bits.h.

◆ CONST_POPCOUNT16

#define CONST_POPCOUNT16 (   x)    (CONST_POPCOUNT8(x) + CONST_POPCOUNT8((x)>>8))

Definition at line 9 of file bits.h.

◆ CONST_POPCOUNT2

#define CONST_POPCOUNT2 (   x)    ((((x) >> 0) & 1) + (((x) >> 1) & 1))

Definition at line 6 of file bits.h.

◆ CONST_POPCOUNT32

#define CONST_POPCOUNT32 (   x)    (CONST_POPCOUNT16(x) + CONST_POPCOUNT16((x)>>16))

Definition at line 10 of file bits.h.

◆ CONST_POPCOUNT4

#define CONST_POPCOUNT4 (   x)    (CONST_POPCOUNT2(x) + CONST_POPCOUNT2((x)>>2))

Definition at line 7 of file bits.h.

◆ CONST_POPCOUNT64

#define CONST_POPCOUNT64 (   x)    (CONST_POPCOUNT32(x) + CONST_POPCOUNT32((x)>>32))

Definition at line 11 of file bits.h.

◆ CONST_POPCOUNT8

#define CONST_POPCOUNT8 (   x)    (CONST_POPCOUNT4(x) + CONST_POPCOUNT4((x)>>4))

Definition at line 8 of file bits.h.

◆ LOAD

#define LOAD   lw

Definition at line 34 of file bits.h.

◆ LOG_REGBYTES

#define LOG_REGBYTES   2

Definition at line 36 of file bits.h.

◆ LWU

#define LWU   lw

Definition at line 35 of file bits.h.

◆ REGBYTES

#define REGBYTES   (1 << LOG_REGBYTES)

Definition at line 39 of file bits.h.

◆ SLL32

#define SLL32   sll

Definition at line 32 of file bits.h.

◆ STORE

#define STORE   sw

Definition at line 33 of file bits.h.

◆ STR

#define STR (   x)    XSTR(x)

Definition at line 22 of file bits.h.

◆ XSTR

#define XSTR (   x)    #x

Definition at line 23 of file bits.h.