![]() |
NMSIS-Core
Version 1.4.1
NMSIS-Core support for Nuclei processor-based devices
|
A few functions that compatiable with ARM CMSIS-Core. More...
Macros | |
| #define | __ISB() __RWMB() |
| Instruction Synchronization Barrier, compatiable with ARM. More... | |
| #define | __DSB() __RWMB() |
| Data Synchronization Barrier, compatiable with ARM. More... | |
| #define | __DMB() __RWMB() |
| Data Memory Barrier, compatiable with ARM. More... | |
| #define | __LDRBT(ptr) __LB((ptr)) |
| LDRT Unprivileged (8 bit), ARM Compatiable. More... | |
| #define | __LDRHT(ptr) __LH((ptr)) |
| LDRT Unprivileged (16 bit), ARM Compatiable. More... | |
| #define | __LDRT(ptr) __LW((ptr)) |
| LDRT Unprivileged (32 bit), ARM Compatiable. More... | |
| #define | __STRBT(val, ptr) __SB((ptr), (val)) |
| STRT Unprivileged (8 bit), ARM Compatiable. More... | |
| #define | __STRHT(val, ptr) __SH((ptr), (val)) |
| STRT Unprivileged (16 bit), ARM Compatiable. More... | |
| #define | __STRT(val, ptr) __SW((ptr), (val)) |
| STRT Unprivileged (32 bit), ARM Compatiable. More... | |
| #define | __SSAT(val, sat) __RV_SCLIP32((val), (sat-1)) |
| Signed Saturate. More... | |
| #define | __USAT(val, sat) __RV_UCLIP32((val), (sat)) |
| Unsigned Saturate. More... | |
| #define | __RBIT(value) __RV_BITREVI((value), 31) |
| Reverse bit order of value. More... | |
| #define | __CLZ(data) __RV_CLZ32(data) |
| Count leading zeros. More... | |
| #define | __EXPD_BYTE(x) |
| Expand byte to unsigned long value. More... | |
Functions | |
| __STATIC_FORCEINLINE uint32_t | __REV (uint32_t value) |
| Reverse byte order (32 bit) More... | |
| __STATIC_FORCEINLINE uint32_t | __REV16 (uint32_t value) |
| Reverse byte order (16 bit) More... | |
| __STATIC_FORCEINLINE int16_t | __REVSH (int16_t value) |
| Reverse byte order (16 bit) More... | |
| __STATIC_FORCEINLINE uint32_t | __ROR (uint32_t op1, uint32_t op2) |
| Rotate Right in unsigned value (32 bit) More... | |
| __STATIC_INLINE uint64_t | __ROR64 (uint64_t op1, uint32_t op2) |
| Rotate Right in uint32x2 value (64 bit) More... | |
| __STATIC_INLINE unsigned long | __CTZ (unsigned long data) |
| Count tailing zero. More... | |
A few functions that compatiable with ARM CMSIS-Core.
Here we provided a few functions that compatiable with ARM CMSIS-Core, mostly used in the DSP and NN library.
| #define __CLZ | ( | data | ) | __RV_CLZ32(data) |
Count leading zeros.
Counts the number of leading zeros of a data value.
| [in] | data | Value to count the leading zeros |
Definition at line 235 of file core_compatiable.h.
| #define __DMB | ( | ) | __RWMB() |
Data Memory Barrier, compatiable with ARM.
Definition at line 48 of file core_compatiable.h.
| #define __DSB | ( | ) | __RWMB() |
Data Synchronization Barrier, compatiable with ARM.
Definition at line 45 of file core_compatiable.h.
| #define __EXPD_BYTE | ( | x | ) |
Expand byte to unsigned long value.
Expand byte value x to unsigned long value's each byte.
| [in] | x | the byte value to be expand, the input must be uint8_t type |
Definition at line 276 of file core_compatiable.h.
| #define __ISB | ( | ) | __RWMB() |
Instruction Synchronization Barrier, compatiable with ARM.
Definition at line 42 of file core_compatiable.h.
| #define __LDRBT | ( | ptr | ) | __LB((ptr)) |
LDRT Unprivileged (8 bit), ARM Compatiable.
Definition at line 51 of file core_compatiable.h.
| #define __LDRHT | ( | ptr | ) | __LH((ptr)) |
LDRT Unprivileged (16 bit), ARM Compatiable.
Definition at line 53 of file core_compatiable.h.
| #define __LDRT | ( | ptr | ) | __LW((ptr)) |
LDRT Unprivileged (32 bit), ARM Compatiable.
Definition at line 55 of file core_compatiable.h.
| #define __RBIT | ( | value | ) | __RV_BITREVI((value), 31) |
Reverse bit order of value.
Reverses the bit order of the given value.
| [in] | value | Value to reverse |
Definition at line 210 of file core_compatiable.h.
| #define __SSAT | ( | val, | |
| sat | |||
| ) | __RV_SCLIP32((val), (sat-1)) |
Signed Saturate.
Saturates a signed value.
| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to (1..32) |
Definition at line 73 of file core_compatiable.h.
| #define __STRBT | ( | val, | |
| ptr | |||
| ) | __SB((ptr), (val)) |
STRT Unprivileged (8 bit), ARM Compatiable.
Definition at line 58 of file core_compatiable.h.
| #define __STRHT | ( | val, | |
| ptr | |||
| ) | __SH((ptr), (val)) |
STRT Unprivileged (16 bit), ARM Compatiable.
Definition at line 60 of file core_compatiable.h.
| #define __STRT | ( | val, | |
| ptr | |||
| ) | __SW((ptr), (val)) |
STRT Unprivileged (32 bit), ARM Compatiable.
Definition at line 62 of file core_compatiable.h.
| #define __USAT | ( | val, | |
| sat | |||
| ) | __RV_UCLIP32((val), (sat)) |
Unsigned Saturate.
Saturates an unsigned value.
| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to (0..31) |
Definition at line 98 of file core_compatiable.h.
| __STATIC_INLINE unsigned long __CTZ | ( | unsigned long | data | ) |
Count tailing zero.
Return the count of least-significant bit zero.for example, return 3 if x=0bxxx1000
| [in] | data | Value to count the tailing zeros |
Definition at line 257 of file core_compatiable.h.
Referenced by __get_PMPENTRYx(), __get_sPMPENTRYx(), PMA_GetRegion(), and PMA_GetRegion_S().
| __STATIC_FORCEINLINE uint32_t __REV | ( | uint32_t | value | ) |
Reverse byte order (32 bit)
Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
| [in] | value | Value to reverse |
Definition at line 122 of file core_compatiable.h.
| __STATIC_FORCEINLINE uint32_t __REV16 | ( | uint32_t | value | ) |
Reverse byte order (16 bit)
Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
| [in] | value | Value to reverse |
Definition at line 140 of file core_compatiable.h.
| __STATIC_FORCEINLINE int16_t __REVSH | ( | int16_t | value | ) |
Reverse byte order (16 bit)
Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
| [in] | value | Value to reverse |
Definition at line 159 of file core_compatiable.h.
| __STATIC_FORCEINLINE uint32_t __ROR | ( | uint32_t | op1, |
| uint32_t | op2 | ||
| ) |
Rotate Right in unsigned value (32 bit)
Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
| [in] | op1 | Value to rotate |
| [in] | op2 | Number of Bits to rotate(0-31) |
Definition at line 174 of file core_compatiable.h.
| __STATIC_INLINE uint64_t __ROR64 | ( | uint64_t | op1, |
| uint32_t | op2 | ||
| ) |
Rotate Right in uint32x2 value (64 bit)
Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
| [in] | op1 | Value to rotate([63:32] and [31:0] rotate separately) |
| [in] | op2 | Number of Bits to rotate |
Definition at line 191 of file core_compatiable.h.