27#ifndef __CMSIS_ARMCLANG_H
28#define __CMSIS_ARMCLANG_H
30#pragma clang system_header
33#include <arm_compat.h>
41 #define __INLINE __inline
43#ifndef __STATIC_INLINE
44 #define __STATIC_INLINE static __inline
46#ifndef __STATIC_FORCEINLINE
47 #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline
50 #define __NO_RETURN __attribute__((__noreturn__))
53 #define __USED __attribute__((used))
56 #define __WEAK __attribute__((weak))
59 #define __PACKED __attribute__((packed, aligned(1)))
61#ifndef __PACKED_STRUCT
62 #define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
65 #define __PACKED_UNION union __attribute__((packed, aligned(1)))
67#ifndef __UNALIGNED_UINT32
68 #pragma clang diagnostic push
69 #pragma clang diagnostic ignored "-Wpacked"
72 #pragma clang diagnostic pop
73 #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
75#ifndef __UNALIGNED_UINT16_WRITE
76 #pragma clang diagnostic push
77 #pragma clang diagnostic ignored "-Wpacked"
79 __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
80 #pragma clang diagnostic pop
81 #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
83#ifndef __UNALIGNED_UINT16_READ
84 #pragma clang diagnostic push
85 #pragma clang diagnostic ignored "-Wpacked"
87 __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
88 #pragma clang diagnostic pop
89 #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
91#ifndef __UNALIGNED_UINT32_WRITE
92 #pragma clang diagnostic push
93 #pragma clang diagnostic ignored "-Wpacked"
95 __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
96 #pragma clang diagnostic pop
97 #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
99#ifndef __UNALIGNED_UINT32_READ
100 #pragma clang diagnostic push
101 #pragma clang diagnostic ignored "-Wpacked"
103 __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
104 #pragma clang diagnostic pop
105 #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
108 #define __ALIGNED(x) __attribute__((aligned(x)))
111 #define __RESTRICT __restrict
146 __ASM
volatile (
"MRS %0, control" :
"=r" (result) );
151#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
157__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(
void)
161 __ASM
volatile (
"MRS %0, control_ns" :
"=r" (result) );
174 __ASM
volatile (
"MSR control, %0" : :
"r" (control) :
"memory");
178#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
184__STATIC_FORCEINLINE
void __TZ_set_CONTROL_NS(uint32_t control)
186 __ASM
volatile (
"MSR control_ns, %0" : :
"r" (control) :
"memory");
200 __ASM
volatile (
"MRS %0, ipsr" :
"=r" (result) );
214 __ASM
volatile (
"MRS %0, apsr" :
"=r" (result) );
228 __ASM
volatile (
"MRS %0, xpsr" :
"=r" (result) );
238__STATIC_FORCEINLINE uint32_t
__get_PSP(
void)
242 __ASM
volatile (
"MRS %0, psp" :
"=r" (result) );
247#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
253__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(
void)
257 __ASM
volatile (
"MRS %0, psp_ns" :
"=r" (result) );
268__STATIC_FORCEINLINE
void __set_PSP(uint32_t topOfProcStack)
270 __ASM
volatile (
"MSR psp, %0" : :
"r" (topOfProcStack) : );
274#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
280__STATIC_FORCEINLINE
void __TZ_set_PSP_NS(uint32_t topOfProcStack)
282 __ASM
volatile (
"MSR psp_ns, %0" : :
"r" (topOfProcStack) : );
292__STATIC_FORCEINLINE uint32_t
__get_MSP(
void)
296 __ASM
volatile (
"MRS %0, msp" :
"=r" (result) );
301#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
307__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(
void)
311 __ASM
volatile (
"MRS %0, msp_ns" :
"=r" (result) );
322__STATIC_FORCEINLINE
void __set_MSP(uint32_t topOfMainStack)
324 __ASM
volatile (
"MSR msp, %0" : :
"r" (topOfMainStack) : );
328#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
334__STATIC_FORCEINLINE
void __TZ_set_MSP_NS(uint32_t topOfMainStack)
336 __ASM
volatile (
"MSR msp_ns, %0" : :
"r" (topOfMainStack) : );
341#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
347__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(
void)
351 __ASM
volatile (
"MRS %0, sp_ns" :
"=r" (result) );
361__STATIC_FORCEINLINE
void __TZ_set_SP_NS(uint32_t topOfStack)
363 __ASM
volatile (
"MSR sp_ns, %0" : :
"r" (topOfStack) : );
377 __ASM
volatile (
"MRS %0, primask" :
"=r" (result) );
382#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
388__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(
void)
392 __ASM
volatile (
"MRS %0, primask_ns" :
"=r" (result) );
405 __ASM
volatile (
"MSR primask, %0" : :
"r" (priMask) :
"memory");
409#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
415__STATIC_FORCEINLINE
void __TZ_set_PRIMASK_NS(uint32_t priMask)
417 __ASM
volatile (
"MSR primask_ns, %0" : :
"r" (priMask) :
"memory");
422#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
423 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
424 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
430#define __enable_fault_irq __enable_fiq
438#define __disable_fault_irq __disable_fiq
446__STATIC_FORCEINLINE uint32_t __get_BASEPRI(
void)
450 __ASM
volatile (
"MRS %0, basepri" :
"=r" (result) );
455#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
461__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(
void)
465 __ASM
volatile (
"MRS %0, basepri_ns" :
"=r" (result) );
476__STATIC_FORCEINLINE
void __set_BASEPRI(uint32_t basePri)
478 __ASM
volatile (
"MSR basepri, %0" : :
"r" (basePri) :
"memory");
482#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
488__STATIC_FORCEINLINE
void __TZ_set_BASEPRI_NS(uint32_t basePri)
490 __ASM
volatile (
"MSR basepri_ns, %0" : :
"r" (basePri) :
"memory");
501__STATIC_FORCEINLINE
void __set_BASEPRI_MAX(uint32_t basePri)
503 __ASM
volatile (
"MSR basepri_max, %0" : :
"r" (basePri) :
"memory");
512__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(
void)
516 __ASM
volatile (
"MRS %0, faultmask" :
"=r" (result) );
521#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
527__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(
void)
531 __ASM
volatile (
"MRS %0, faultmask_ns" :
"=r" (result) );
542__STATIC_FORCEINLINE
void __set_FAULTMASK(uint32_t faultMask)
544 __ASM
volatile (
"MSR faultmask, %0" : :
"r" (faultMask) :
"memory");
548#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
554__STATIC_FORCEINLINE
void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
556 __ASM
volatile (
"MSR faultmask_ns, %0" : :
"r" (faultMask) :
"memory");
565#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
566 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
577__STATIC_FORCEINLINE uint32_t __get_PSPLIM(
void)
579#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
580 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
585 __ASM
volatile (
"MRS %0, psplim" :
"=r" (result) );
590#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))
600__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(
void)
602#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
607 __ASM
volatile (
"MRS %0, psplim_ns" :
"=r" (result) );
623__STATIC_FORCEINLINE
void __set_PSPLIM(uint32_t ProcStackPtrLimit)
625#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
626 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
628 (void)ProcStackPtrLimit;
630 __ASM
volatile (
"MSR psplim, %0" : :
"r" (ProcStackPtrLimit));
635#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
645__STATIC_FORCEINLINE
void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
647#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
649 (void)ProcStackPtrLimit;
651 __ASM
volatile (
"MSR psplim_ns, %0\n" : :
"r" (ProcStackPtrLimit));
665__STATIC_FORCEINLINE uint32_t __get_MSPLIM(
void)
667#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
668 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
673 __ASM
volatile (
"MRS %0, msplim" :
"=r" (result) );
679#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
688__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(
void)
690#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
695 __ASM
volatile (
"MRS %0, msplim_ns" :
"=r" (result) );
710__STATIC_FORCEINLINE
void __set_MSPLIM(uint32_t MainStackPtrLimit)
712#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
713 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
715 (void)MainStackPtrLimit;
717 __ASM
volatile (
"MSR msplim, %0" : :
"r" (MainStackPtrLimit));
722#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
731__STATIC_FORCEINLINE
void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)
733#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
735 (void)MainStackPtrLimit;
737 __ASM
volatile (
"MSR msplim_ns, %0" : :
"r" (MainStackPtrLimit));
750#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
751 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
752#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr
754#define __get_FPSCR() ((uint32_t)0U)
762#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
763 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
764#define __set_FPSCR __builtin_arm_set_fpscr
766#define __set_FPSCR(x) ((void)(x))
782#if defined (__thumb__) && !defined (__thumb2__)
783#define __CMSIS_GCC_OUT_REG(r) "=l" (r)
784#define __CMSIS_GCC_RW_REG(r) "+l" (r)
785#define __CMSIS_GCC_USE_REG(r) "l" (r)
787#define __CMSIS_GCC_OUT_REG(r) "=r" (r)
788#define __CMSIS_GCC_RW_REG(r) "+r" (r)
789#define __CMSIS_GCC_USE_REG(r) "r" (r)
796#define __NOP __builtin_arm_nop
802#define __WFI __builtin_arm_wfi
810#define __WFE __builtin_arm_wfe
817#define __SEV __builtin_arm_sev
826#define __ISB() __builtin_arm_isb(0xF)
833#define __DSB() __builtin_arm_dsb(0xF)
841#define __DMB() __builtin_arm_dmb(0xF)
850#define __REV(value) __builtin_bswap32(value)
859#define __REV16(value) __ROR(__REV(value), 16)
868#define __REVSH(value) (int16_t)__builtin_bswap16(value)
878__STATIC_FORCEINLINE uint32_t
__ROR(uint32_t op1, uint32_t op2)
885 return (op1 >> op2) | (op1 << (32U - op2));
896#define __BKPT(value) __ASM volatile ("bkpt "#value)
905#define __RBIT __builtin_arm_rbit
913__STATIC_FORCEINLINE uint8_t
__CLZ(uint32_t value)
928 return __builtin_clz(value);
932#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
933 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
934 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
935 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
942#define __LDREXB (uint8_t)__builtin_arm_ldrex
951#define __LDREXH (uint16_t)__builtin_arm_ldrex
960#define __LDREXW (uint32_t)__builtin_arm_ldrex
971#define __STREXB (uint32_t)__builtin_arm_strex
982#define __STREXH (uint32_t)__builtin_arm_strex
993#define __STREXW (uint32_t)__builtin_arm_strex
1000#define __CLREX __builtin_arm_clrex
1008#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
1009 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
1010 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
1019#define __SSAT __builtin_arm_ssat
1029#define __USAT __builtin_arm_usat
1039__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value)
1043 __ASM
volatile (
"rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
1054__STATIC_FORCEINLINE uint8_t __LDRBT(
volatile uint8_t *ptr)
1058 __ASM
volatile (
"ldrbt %0, %1" :
"=r" (result) :
"Q" (*ptr) );
1059 return ((uint8_t) result);
1069__STATIC_FORCEINLINE uint16_t __LDRHT(
volatile uint16_t *ptr)
1073 __ASM
volatile (
"ldrht %0, %1" :
"=r" (result) :
"Q" (*ptr) );
1074 return ((uint16_t) result);
1084__STATIC_FORCEINLINE uint32_t __LDRT(
volatile uint32_t *ptr)
1088 __ASM
volatile (
"ldrt %0, %1" :
"=r" (result) :
"Q" (*ptr) );
1099__STATIC_FORCEINLINE
void __STRBT(uint8_t value,
volatile uint8_t *ptr)
1101 __ASM
volatile (
"strbt %1, %0" :
"=Q" (*ptr) :
"r" ((uint32_t)value) );
1111__STATIC_FORCEINLINE
void __STRHT(uint16_t value,
volatile uint16_t *ptr)
1113 __ASM
volatile (
"strht %1, %0" :
"=Q" (*ptr) :
"r" ((uint32_t)value) );
1123__STATIC_FORCEINLINE
void __STRT(uint32_t value,
volatile uint32_t *ptr)
1125 __ASM
volatile (
"strt %1, %0" :
"=Q" (*ptr) :
"r" (value) );
1139__STATIC_FORCEINLINE int32_t
__SSAT(int32_t val, uint32_t sat)
1141 if ((sat >= 1U) && (sat <= 32U))
1143 const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
1144 const int32_t min = -1 - max ;
1164__STATIC_FORCEINLINE uint32_t
__USAT(int32_t val, uint32_t sat)
1168 const uint32_t max = ((1U << sat) - 1U);
1169 if (val > (int32_t)max)
1178 return (uint32_t)val;
1186#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
1187 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
1194__STATIC_FORCEINLINE uint8_t __LDAB(
volatile uint8_t *ptr)
1198 __ASM
volatile (
"ldab %0, %1" :
"=r" (result) :
"Q" (*ptr) );
1199 return ((uint8_t) result);
1209__STATIC_FORCEINLINE uint16_t __LDAH(
volatile uint16_t *ptr)
1213 __ASM
volatile (
"ldah %0, %1" :
"=r" (result) :
"Q" (*ptr) );
1214 return ((uint16_t) result);
1224__STATIC_FORCEINLINE uint32_t __LDA(
volatile uint32_t *ptr)
1228 __ASM
volatile (
"lda %0, %1" :
"=r" (result) :
"Q" (*ptr) );
1239__STATIC_FORCEINLINE
void __STLB(uint8_t value,
volatile uint8_t *ptr)
1241 __ASM
volatile (
"stlb %1, %0" :
"=Q" (*ptr) :
"r" ((uint32_t)value) );
1251__STATIC_FORCEINLINE
void __STLH(uint16_t value,
volatile uint16_t *ptr)
1253 __ASM
volatile (
"stlh %1, %0" :
"=Q" (*ptr) :
"r" ((uint32_t)value) );
1263__STATIC_FORCEINLINE
void __STL(uint32_t value,
volatile uint32_t *ptr)
1265 __ASM
volatile (
"stl %1, %0" :
"=Q" (*ptr) :
"r" ((uint32_t)value) );
1275#define __LDAEXB (uint8_t)__builtin_arm_ldaex
1284#define __LDAEXH (uint16_t)__builtin_arm_ldaex
1293#define __LDAEX (uint32_t)__builtin_arm_ldaex
1304#define __STLEXB (uint32_t)__builtin_arm_stlex
1315#define __STLEXH (uint32_t)__builtin_arm_stlex
1326#define __STLEX (uint32_t)__builtin_arm_stlex
1340#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
1342#define __SADD8 __builtin_arm_sadd8
1343#define __QADD8 __builtin_arm_qadd8
1344#define __SHADD8 __builtin_arm_shadd8
1345#define __UADD8 __builtin_arm_uadd8
1346#define __UQADD8 __builtin_arm_uqadd8
1347#define __UHADD8 __builtin_arm_uhadd8
1348#define __SSUB8 __builtin_arm_ssub8
1349#define __QSUB8 __builtin_arm_qsub8
1350#define __SHSUB8 __builtin_arm_shsub8
1351#define __USUB8 __builtin_arm_usub8
1352#define __UQSUB8 __builtin_arm_uqsub8
1353#define __UHSUB8 __builtin_arm_uhsub8
1354#define __SADD16 __builtin_arm_sadd16
1355#define __QADD16 __builtin_arm_qadd16
1356#define __SHADD16 __builtin_arm_shadd16
1357#define __UADD16 __builtin_arm_uadd16
1358#define __UQADD16 __builtin_arm_uqadd16
1359#define __UHADD16 __builtin_arm_uhadd16
1360#define __SSUB16 __builtin_arm_ssub16
1361#define __QSUB16 __builtin_arm_qsub16
1362#define __SHSUB16 __builtin_arm_shsub16
1363#define __USUB16 __builtin_arm_usub16
1364#define __UQSUB16 __builtin_arm_uqsub16
1365#define __UHSUB16 __builtin_arm_uhsub16
1366#define __SASX __builtin_arm_sasx
1367#define __QASX __builtin_arm_qasx
1368#define __SHASX __builtin_arm_shasx
1369#define __UASX __builtin_arm_uasx
1370#define __UQASX __builtin_arm_uqasx
1371#define __UHASX __builtin_arm_uhasx
1372#define __SSAX __builtin_arm_ssax
1373#define __QSAX __builtin_arm_qsax
1374#define __SHSAX __builtin_arm_shsax
1375#define __USAX __builtin_arm_usax
1376#define __UQSAX __builtin_arm_uqsax
1377#define __UHSAX __builtin_arm_uhsax
1378#define __USAD8 __builtin_arm_usad8
1379#define __USADA8 __builtin_arm_usada8
1380#define __SSAT16 __builtin_arm_ssat16
1381#define __USAT16 __builtin_arm_usat16
1382#define __UXTB16 __builtin_arm_uxtb16
1383#define __UXTAB16 __builtin_arm_uxtab16
1384#define __SXTB16 __builtin_arm_sxtb16
1385#define __SXTAB16 __builtin_arm_sxtab16
1386#define __SMUAD __builtin_arm_smuad
1387#define __SMUADX __builtin_arm_smuadx
1388#define __SMLAD __builtin_arm_smlad
1389#define __SMLADX __builtin_arm_smladx
1390#define __SMLALD __builtin_arm_smlald
1391#define __SMLALDX __builtin_arm_smlaldx
1392#define __SMUSD __builtin_arm_smusd
1393#define __SMUSDX __builtin_arm_smusdx
1394#define __SMLSD __builtin_arm_smlsd
1395#define __SMLSDX __builtin_arm_smlsdx
1396#define __SMLSLD __builtin_arm_smlsld
1397#define __SMLSLDX __builtin_arm_smlsldx
1398#define __SEL __builtin_arm_sel
1399#define __QADD __builtin_arm_qadd
1400#define __QSUB __builtin_arm_qsub
1402#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
1403 ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
1405#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
1406 ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
1408__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
1412 __ASM
volatile (
"smmla %0, %1, %2, %3" :
"=r" (result):
"r" (op1),
"r" (op2),
"r" (op3) );
__STATIC_INLINE void __set_CONTROL(uint32_t control)
Set Control Register.
Definition cmsis_armcc.h:146
__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
Set Main Stack Pointer.
Definition cmsis_armcc.h:230
__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
Set Process Stack Pointer.
Definition cmsis_armcc.h:206
__STATIC_INLINE uint32_t __get_PRIMASK(void)
Get Priority Mask.
Definition cmsis_armcc.h:242
__STATIC_INLINE uint32_t __get_MSP(void)
Get Main Stack Pointer.
Definition cmsis_armcc.h:218
__STATIC_INLINE uint32_t __get_CONTROL(void)
Enable IRQ Interrupts.
Definition cmsis_armcc.h:134
__STATIC_INLINE uint32_t __get_PSP(void)
Get Process Stack Pointer.
Definition cmsis_armcc.h:194
__STATIC_INLINE uint32_t __get_APSR(void)
Get APSR Register.
Definition cmsis_armcc.h:170
#define __get_xPSR
Get xPSR Register.
Definition cmsis_iccarm.h:553
__STATIC_INLINE uint32_t __get_IPSR(void)
Get IPSR Register.
Definition cmsis_armcc.h:158
__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
Set Priority Mask.
Definition cmsis_armcc.h:254
__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat)
Signed Saturate.
Definition cmsis_armclang.h:1139
#define __CLZ
Count leading zeros.
Definition cmsis_armcc.h:544
__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat)
Unsigned Saturate.
Definition cmsis_armclang.h:1164
#define __ROR
Rotate Right in unsigned value (32 bit).
Definition cmsis_armcc.h:497
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
Reverse byte order (16 bit).
Definition cmsis_armcc.h:467