mirror of
https://github.com/riscv-software-src/riscv-isa-sim.git
synced 2025-10-14 02:07:30 +08:00
23 lines
522 B
C
23 lines
522 B
C
// See LICENSE for license details.
|
|
|
|
#ifndef _RISCV_COMMON_H
|
|
#define _RISCV_COMMON_H
|
|
|
|
#ifdef __GNUC__
|
|
# define likely(x) __builtin_expect(x, 1)
|
|
# define unlikely(x) __builtin_expect(x, 0)
|
|
# define NOINLINE __attribute__ ((noinline))
|
|
# define NORETURN __attribute__ ((noreturn))
|
|
# define ALWAYS_INLINE __attribute__ ((always_inline))
|
|
# define UNUSED __attribute__ ((unused))
|
|
#else
|
|
# define likely(x) (x)
|
|
# define unlikely(x) (x)
|
|
# define NOINLINE
|
|
# define NORETURN
|
|
# define ALWAYS_INLINE
|
|
# define UNUSED
|
|
#endif
|
|
|
|
#endif
|