Skip to content

File util.h

FileList > bindings > cp > rv64 > util.h

Go to the source code of this file

  • #include <stdexcept>

Public Functions

Type Name
void ensure (bool cond)
void ensure (bool cond, const std::string & reason)

Macros

Type Name
define BIT_RANGE (instr, upper, lower) (instr & (((1 &lt;&lt; (upper - lower + 1)) - 1) &lt;&lt; lower))
define BIT_SINGLE (instr, pos) (instr & (1 &lt;&lt; pos))
define BIT_SINGLE_P1 (instr, pos) (BIT\_SINGLE(instr, pos) &gt;&gt; pos)
define BIT_SINGLE_PN (instr, pos, new_pos) ((BIT\_SINGLE(instr, pos) &gt;&gt; pos) &lt;&lt; new\_pos)
define BIT_SLICE (instr, upper, lower) (BIT\_RANGE(instr, upper, lower) &gt;&gt; lower)
define EXTRACT_SIGN_BIT (instr, pos, new_pos) ((BIT\_SINGLE\_P1(instr, pos) &lt;&lt; 31) &gt;&gt; (31 - new\_pos))
define UNUSED (x) (void)(x)
define likely (x) \_\_builtin\_expect((x), 1)
define unlikely (x) \_\_builtin\_expect((x), 0)

Public Functions Documentation

function ensure

inline void ensure (
    bool cond
) 

function ensure

inline void ensure (
    bool cond,
    const std::string & reason
) 

Macro Definition Documentation

define BIT_RANGE

#define BIT_RANGE (
    instr,
    upper,
    lower
) `(instr & (((1 << (upper - lower + 1)) - 1) << lower))`

define BIT_SINGLE

#define BIT_SINGLE (
    instr,
    pos
) `(instr & (1 << pos))`

define BIT_SINGLE_P1

#define BIT_SINGLE_P1 (
    instr,
    pos
) `(BIT_SINGLE(instr, pos) >> pos)`

define BIT_SINGLE_PN

#define BIT_SINGLE_PN (
    instr,
    pos,
    new_pos
) `((BIT_SINGLE(instr, pos) >> pos) << new_pos)`

define BIT_SLICE

#define BIT_SLICE (
    instr,
    upper,
    lower
) `(BIT_RANGE(instr, upper, lower) >> lower)`

define EXTRACT_SIGN_BIT

#define EXTRACT_SIGN_BIT (
    instr,
    pos,
    new_pos
) `((BIT_SINGLE_P1(instr, pos) << 31) >> (31 - new_pos))`

define UNUSED

#define UNUSED (
    x
) `(void)(x)`

define likely

#define likely (
    x
) `__builtin_expect((x), 1)`

define unlikely

#define unlikely (
    x
) `__builtin_expect((x), 0)`


The documentation for this class was generated from the following file projects/casvp/src/bindings/cp/rv64/util.h