NMSIS-Core  Version 1.0.0-HummingBird
NMSIS-Core support for HummingBird RISC-V processor-based devices
Compiler Control

Compiler agnostic #define symbols for generic c/c++ source code. More...

Macros

#define __has_builtin(x)   (0)
 
#define __ASM   __asm
 Pass information from the compiler to the assembler. More...
 
#define __INLINE   inline
 Recommend that function should be inlined by the compiler. More...
 
#define __STATIC_INLINE   static inline
 Define a static function that may be inlined by the compiler. More...
 
#define __STATIC_FORCEINLINE   __attribute__((always_inline)) static inline
 Define a static function that should be always inlined by the compiler. More...
 
#define __NO_RETURN   __attribute__((__noreturn__))
 Inform the compiler that a function does not return. More...
 
#define __USED   __attribute__((used))
 Inform that a variable shall be retained in executable image. More...
 
#define __WEAK   __attribute__((weak))
 restrict pointer qualifier to enable additional optimizations. More...
 
#define __VECTOR_SIZE(x)   __attribute__((vector_size(x)))
 specified the vector size of the variable, measured in bytes More...
 
#define __PACKED   __attribute__((packed, aligned(1)))
 Request smallest possible alignment. More...
 
#define __PACKED_STRUCT   struct __attribute__((packed, aligned(1)))
 Request smallest possible alignment for a structure. More...
 
#define __PACKED_UNION   union __attribute__((packed, aligned(1)))
 Request smallest possible alignment for a union. More...
 
#define __UNALIGNED_UINT16_WRITE(addr, val)   (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
 Pointer for unaligned write of a uint16_t variable. More...
 
#define __UNALIGNED_UINT16_READ(addr)   (((const struct T_UINT16_READ *)(const void *)(addr))->v)
 Pointer for unaligned read of a uint16_t variable. More...
 
#define __UNALIGNED_UINT32_WRITE(addr, val)   (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
 Pointer for unaligned write of a uint32_t variable. More...
 
#define __UNALIGNED_UINT32_READ(addr)   (((const struct T_UINT32_READ *)(const void *)(addr))->v)
 Pointer for unaligned read of a uint32_t variable. More...
 
#define __ALIGNED(x)   __attribute__((aligned(x)))
 Minimum x bytes alignment for a variable. More...
 
#define __RESTRICT   __restrict
 restrict pointer qualifier to enable additional optimizations. More...
 
#define __COMPILER_BARRIER()   __ASM volatile("":::"memory")
 Barrier to prevent compiler from reordering instructions. More...
 
#define __USUALLY(exp)   __builtin_expect((exp), 1)
 provide the compiler with branch prediction information, the branch is usually true More...
 
#define __RARELY(exp)   __builtin_expect((exp), 0)
 provide the compiler with branch prediction information, the branch is rarely true More...
 
#define __INTERRUPT
 Use this attribute to indicate that the specified function is an interrupt handler. More...
 

Variables

__PACKED_STRUCT T_UINT16_WRITE
 Packed struct for unaligned uint16_t write access. More...
 
__PACKED_STRUCT T_UINT16_READ
 Packed struct for unaligned uint16_t read access. More...
 
__PACKED_STRUCT T_UINT32_WRITE
 Packed struct for unaligned uint32_t write access. More...
 
__PACKED_STRUCT T_UINT32_READ
 Packed struct for unaligned uint32_t read access. More...
 

Detailed Description

Compiler agnostic #define symbols for generic c/c++ source code.

The NMSIS-Core provides the header file nmsis_compiler.h with consistent #define symbols for generate C or C++ source files that should be compiler agnostic. Each NMSIS compliant compiler should support the functionality described in this section.

The header file nmsis_compiler.h is also included by each Device Header File <device.h> so that these definitions are available.

Macro Definition Documentation

◆ __ALIGNED

#define __ALIGNED (   x)    __attribute__((aligned(x)))

Minimum x bytes alignment for a variable.

Definition at line 166 of file nmsis_gcc.h.

◆ __ASM

#define __ASM   __asm

Pass information from the compiler to the assembler.

Definition at line 59 of file nmsis_gcc.h.

◆ __COMPILER_BARRIER

#define __COMPILER_BARRIER ( )    __ASM volatile("":::"memory")

Barrier to prevent compiler from reordering instructions.

Definition at line 176 of file nmsis_gcc.h.

◆ __has_builtin

#define __has_builtin (   x)    (0)

Definition at line 53 of file nmsis_gcc.h.

◆ __INLINE

#define __INLINE   inline

Recommend that function should be inlined by the compiler.

Definition at line 64 of file nmsis_gcc.h.

◆ __INTERRUPT

#define __INTERRUPT

Use this attribute to indicate that the specified function is an interrupt handler.

Definition at line 191 of file nmsis_gcc.h.

◆ __NO_RETURN

#define __NO_RETURN   __attribute__((__noreturn__))

Inform the compiler that a function does not return.

Definition at line 79 of file nmsis_gcc.h.

◆ __PACKED

#define __PACKED   __attribute__((packed, aligned(1)))

Request smallest possible alignment.

Definition at line 99 of file nmsis_gcc.h.

◆ __PACKED_STRUCT

#define __PACKED_STRUCT   struct __attribute__((packed, aligned(1)))

Request smallest possible alignment for a structure.

Definition at line 104 of file nmsis_gcc.h.

◆ __PACKED_UNION

#define __PACKED_UNION   union __attribute__((packed, aligned(1)))

Request smallest possible alignment for a union.

Definition at line 109 of file nmsis_gcc.h.

◆ __RARELY

#define __RARELY (   exp)    __builtin_expect((exp), 0)

provide the compiler with branch prediction information, the branch is rarely true

Definition at line 186 of file nmsis_gcc.h.

◆ __RESTRICT

#define __RESTRICT   __restrict

restrict pointer qualifier to enable additional optimizations.

Definition at line 171 of file nmsis_gcc.h.

◆ __STATIC_FORCEINLINE

#define __STATIC_FORCEINLINE   __attribute__((always_inline)) static inline

Define a static function that should be always inlined by the compiler.

Definition at line 74 of file nmsis_gcc.h.

◆ __STATIC_INLINE

#define __STATIC_INLINE   static inline

Define a static function that may be inlined by the compiler.

Definition at line 69 of file nmsis_gcc.h.

◆ __UNALIGNED_UINT16_READ

#define __UNALIGNED_UINT16_READ (   addr)    (((const struct T_UINT16_READ *)(const void *)(addr))->v)

Pointer for unaligned read of a uint16_t variable.

Definition at line 135 of file nmsis_gcc.h.

◆ __UNALIGNED_UINT16_WRITE

#define __UNALIGNED_UINT16_WRITE (   addr,
  val 
)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))

Pointer for unaligned write of a uint16_t variable.

Definition at line 122 of file nmsis_gcc.h.

◆ __UNALIGNED_UINT32_READ

#define __UNALIGNED_UINT32_READ (   addr)    (((const struct T_UINT32_READ *)(const void *)(addr))->v)

Pointer for unaligned read of a uint32_t variable.

Definition at line 161 of file nmsis_gcc.h.

◆ __UNALIGNED_UINT32_WRITE

#define __UNALIGNED_UINT32_WRITE (   addr,
  val 
)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))

Pointer for unaligned write of a uint32_t variable.

Definition at line 148 of file nmsis_gcc.h.

◆ __USED

#define __USED   __attribute__((used))

Inform that a variable shall be retained in executable image.

Definition at line 84 of file nmsis_gcc.h.

◆ __USUALLY

#define __USUALLY (   exp)    __builtin_expect((exp), 1)

provide the compiler with branch prediction information, the branch is usually true

Definition at line 181 of file nmsis_gcc.h.

◆ __VECTOR_SIZE

#define __VECTOR_SIZE (   x)    __attribute__((vector_size(x)))

specified the vector size of the variable, measured in bytes

Definition at line 94 of file nmsis_gcc.h.

◆ __WEAK

#define __WEAK   __attribute__((weak))

restrict pointer qualifier to enable additional optimizations.

Definition at line 89 of file nmsis_gcc.h.

Variable Documentation

◆ T_UINT16_READ

__PACKED_STRUCT T_UINT16_READ

Packed struct for unaligned uint16_t read access.

Definition at line 130 of file nmsis_gcc.h.

◆ T_UINT16_WRITE

__PACKED_STRUCT T_UINT16_WRITE

Packed struct for unaligned uint16_t write access.

Definition at line 117 of file nmsis_gcc.h.

◆ T_UINT32_READ

__PACKED_STRUCT T_UINT32_READ

Packed struct for unaligned uint32_t read access.

Definition at line 156 of file nmsis_gcc.h.

◆ T_UINT32_WRITE

__PACKED_STRUCT T_UINT32_WRITE

Packed struct for unaligned uint32_t write access.

Definition at line 143 of file nmsis_gcc.h.