]> begriffs open source - cmsis/blob - CMSIS/Core/Include/cmsis_armcc.h
RTOS2: added Context Management API for ARMv8-M TrustZone
[cmsis] / CMSIS / Core / Include / cmsis_armcc.h
1 /**************************************************************************//**
2  * @file     cmsis_armcc.h
3  * @brief    CMSIS Cortex-M Core Function/Instruction Header File
4  * @version  V5.00
5  * @date     13. September 2016
6  ******************************************************************************/
7 /*
8  * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
9  *
10  * SPDX-License-Identifier: Apache-2.0
11  *
12  * Licensed under the Apache License, Version 2.0 (the License); you may
13  * not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24
25 #ifndef __CMSIS_ARMCC_H
26 #define __CMSIS_ARMCC_H
27
28
29 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)
30   #error "Please use ARM Compiler Toolchain V4.0.677 or later!"
31 #endif
32
33 /* CMSIS compiler specific defines */
34 #ifndef   __ASM
35   #define __ASM                     __asm
36 #endif
37 #ifndef   __INLINE
38   #define __INLINE                  __inline
39 #endif
40 #ifndef   __STATIC_INLINE
41   #define __STATIC_INLINE           static __inline
42 #endif
43 #ifndef   __NO_RETURN
44   #define __NO_RETURN               __declspec(noreturn)
45 #endif
46 #ifndef   __USED
47   #define __USED                    __attribute__((used))
48 #endif
49 #ifndef   __WEAK
50   #define __WEAK                    __attribute__((weak))
51 #endif
52 #ifndef   __UNALIGNED_UINT32
53   #define __UNALIGNED_UINT32(x)     (*((__packed uint32_t *)(x)))
54 #endif
55 #ifndef   __ALIGNED
56   #define __ALIGNED(x)              __attribute__((aligned(x)))
57 #endif
58 #ifndef   __PACKED
59   #define __PACKED                  __attribute__((packed))
60 #endif
61
62
63 /* ###########################  Core Function Access  ########################### */
64 /** \ingroup  CMSIS_Core_FunctionInterface
65     \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
66   @{
67  */
68
69 /**
70   \brief   Enable IRQ Interrupts
71   \details Enables IRQ interrupts by clearing the I-bit in the CPSR.
72            Can only be executed in Privileged modes.
73  */
74 /* intrinsic void __enable_irq();     */
75
76
77 /**
78   \brief   Disable IRQ Interrupts
79   \details Disables IRQ interrupts by setting the I-bit in the CPSR.
80            Can only be executed in Privileged modes.
81  */
82 /* intrinsic void __disable_irq();    */
83
84 /**
85   \brief   Get Control Register
86   \details Returns the content of the Control Register.
87   \return               Control Register value
88  */
89 __STATIC_INLINE uint32_t __get_CONTROL(void)
90 {
91   register uint32_t __regControl         __ASM("control");
92   return(__regControl);
93 }
94
95
96 /**
97   \brief   Set Control Register
98   \details Writes the given value to the Control Register.
99   \param [in]    control  Control Register value to set
100  */
101 __STATIC_INLINE void __set_CONTROL(uint32_t control)
102 {
103   register uint32_t __regControl         __ASM("control");
104   __regControl = control;
105 }
106
107
108 /**
109   \brief   Get IPSR Register
110   \details Returns the content of the IPSR Register.
111   \return               IPSR Register value
112  */
113 __STATIC_INLINE uint32_t __get_IPSR(void)
114 {
115   register uint32_t __regIPSR          __ASM("ipsr");
116   return(__regIPSR);
117 }
118
119
120 /**
121   \brief   Get APSR Register
122   \details Returns the content of the APSR Register.
123   \return               APSR Register value
124  */
125 __STATIC_INLINE uint32_t __get_APSR(void)
126 {
127   register uint32_t __regAPSR          __ASM("apsr");
128   return(__regAPSR);
129 }
130
131
132 /**
133   \brief   Get xPSR Register
134   \details Returns the content of the xPSR Register.
135   \return               xPSR Register value
136  */
137 __STATIC_INLINE uint32_t __get_xPSR(void)
138 {
139   register uint32_t __regXPSR          __ASM("xpsr");
140   return(__regXPSR);
141 }
142
143
144 /**
145   \brief   Get Process Stack Pointer
146   \details Returns the current value of the Process Stack Pointer (PSP).
147   \return               PSP Register value
148  */
149 __STATIC_INLINE uint32_t __get_PSP(void)
150 {
151   register uint32_t __regProcessStackPointer  __ASM("psp");
152   return(__regProcessStackPointer);
153 }
154
155
156 /**
157   \brief   Set Process Stack Pointer
158   \details Assigns the given value to the Process Stack Pointer (PSP).
159   \param [in]    topOfProcStack  Process Stack Pointer value to set
160  */
161 __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
162 {
163   register uint32_t __regProcessStackPointer  __ASM("psp");
164   __regProcessStackPointer = topOfProcStack;
165 }
166
167
168 /**
169   \brief   Get Main Stack Pointer
170   \details Returns the current value of the Main Stack Pointer (MSP).
171   \return               MSP Register value
172  */
173 __STATIC_INLINE uint32_t __get_MSP(void)
174 {
175   register uint32_t __regMainStackPointer     __ASM("msp");
176   return(__regMainStackPointer);
177 }
178
179
180 /**
181   \brief   Set Main Stack Pointer
182   \details Assigns the given value to the Main Stack Pointer (MSP).
183   \param [in]    topOfMainStack  Main Stack Pointer value to set
184  */
185 __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
186 {
187   register uint32_t __regMainStackPointer     __ASM("msp");
188   __regMainStackPointer = topOfMainStack;
189 }
190
191
192 /**
193   \brief   Get Priority Mask
194   \details Returns the current state of the priority mask bit from the Priority Mask Register.
195   \return               Priority Mask value
196  */
197 __STATIC_INLINE uint32_t __get_PRIMASK(void)
198 {
199   register uint32_t __regPriMask         __ASM("primask");
200   return(__regPriMask);
201 }
202
203
204 /**
205   \brief   Set Priority Mask
206   \details Assigns the given value to the Priority Mask Register.
207   \param [in]    priMask  Priority Mask
208  */
209 __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
210 {
211   register uint32_t __regPriMask         __ASM("primask");
212   __regPriMask = (priMask);
213 }
214
215
216 #if ((defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1)) || \
217      (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     )
218
219 /**
220   \brief   Enable FIQ
221   \details Enables FIQ interrupts by clearing the F-bit in the CPSR.
222            Can only be executed in Privileged modes.
223  */
224 #define __enable_fault_irq                __enable_fiq
225
226
227 /**
228   \brief   Disable FIQ
229   \details Disables FIQ interrupts by setting the F-bit in the CPSR.
230            Can only be executed in Privileged modes.
231  */
232 #define __disable_fault_irq               __disable_fiq
233
234
235 /**
236   \brief   Get Base Priority
237   \details Returns the current value of the Base Priority register.
238   \return               Base Priority register value
239  */
240 __STATIC_INLINE uint32_t  __get_BASEPRI(void)
241 {
242   register uint32_t __regBasePri         __ASM("basepri");
243   return(__regBasePri);
244 }
245
246
247 /**
248   \brief   Set Base Priority
249   \details Assigns the given value to the Base Priority register.
250   \param [in]    basePri  Base Priority value to set
251  */
252 __STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
253 {
254   register uint32_t __regBasePri         __ASM("basepri");
255   __regBasePri = (basePri & 0xFFU);
256 }
257
258
259 /**
260   \brief   Set Base Priority with condition
261   \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,
262            or the new value increases the BASEPRI priority level.
263   \param [in]    basePri  Base Priority value to set
264  */
265 __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)
266 {
267   register uint32_t __regBasePriMax      __ASM("basepri_max");
268   __regBasePriMax = (basePri & 0xFFU);
269 }
270
271
272 /**
273   \brief   Get Fault Mask
274   \details Returns the current value of the Fault Mask register.
275   \return               Fault Mask register value
276  */
277 __STATIC_INLINE uint32_t __get_FAULTMASK(void)
278 {
279   register uint32_t __regFaultMask       __ASM("faultmask");
280   return(__regFaultMask);
281 }
282
283
284 /**
285   \brief   Set Fault Mask
286   \details Assigns the given value to the Fault Mask register.
287   \param [in]    faultMask  Fault Mask value to set
288  */
289 __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
290 {
291   register uint32_t __regFaultMask       __ASM("faultmask");
292   __regFaultMask = (faultMask & (uint32_t)1U);
293 }
294
295 #endif /* ((defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1)) || \
296            (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     ) */
297
298
299 #if ((defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     )
300
301 /**
302   \brief   Get FPSCR
303   \details Returns the current value of the Floating Point Status/Control register.
304   \return               Floating Point Status/Control register value
305  */
306 __STATIC_INLINE uint32_t __get_FPSCR(void)
307 {
308 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
309      (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )
310   register uint32_t __regfpscr         __ASM("fpscr");
311   return(__regfpscr);
312 #else
313    return(0U);
314 #endif
315 }
316
317
318 /**
319   \brief   Set FPSCR
320   \details Assigns the given value to the Floating Point Status/Control register.
321   \param [in]    fpscr  Floating Point Status/Control value to set
322  */
323 __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
324 {
325 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
326      (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )
327   register uint32_t __regfpscr         __ASM("fpscr");
328   __regfpscr = (fpscr);
329 #endif
330 }
331
332 #endif /* ((defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     ) */
333
334
335
336 /*@} end of CMSIS_Core_RegAccFunctions */
337
338
339 /* ##########################  Core Instruction Access  ######################### */
340 /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
341   Access to dedicated instructions
342   @{
343 */
344
345 /**
346   \brief   No Operation
347   \details No Operation does nothing. This instruction can be used for code alignment purposes.
348  */
349 #define __NOP                             __nop
350
351
352 /**
353   \brief   Wait For Interrupt
354   \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
355  */
356 #define __WFI                             __wfi
357
358
359 /**
360   \brief   Wait For Event
361   \details Wait For Event is a hint instruction that permits the processor to enter
362            a low-power state until one of a number of events occurs.
363  */
364 #define __WFE                             __wfe
365
366
367 /**
368   \brief   Send Event
369   \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
370  */
371 #define __SEV                             __sev
372
373
374 /**
375   \brief   Instruction Synchronization Barrier
376   \details Instruction Synchronization Barrier flushes the pipeline in the processor,
377            so that all instructions following the ISB are fetched from cache or memory,
378            after the instruction has been completed.
379  */
380 #define __ISB() do {\
381                    __schedule_barrier();\
382                    __isb(0xF);\
383                    __schedule_barrier();\
384                 } while (0U)
385
386 /**
387   \brief   Data Synchronization Barrier
388   \details Acts as a special kind of Data Memory Barrier.
389            It completes when all explicit memory accesses before this instruction complete.
390  */
391 #define __DSB() do {\
392                    __schedule_barrier();\
393                    __dsb(0xF);\
394                    __schedule_barrier();\
395                 } while (0U)
396
397 /**
398   \brief   Data Memory Barrier
399   \details Ensures the apparent order of the explicit memory operations before
400            and after the instruction, without ensuring their completion.
401  */
402 #define __DMB() do {\
403                    __schedule_barrier();\
404                    __dmb(0xF);\
405                    __schedule_barrier();\
406                 } while (0U)
407
408 /**
409   \brief   Reverse byte order (32 bit)
410   \details Reverses the byte order in integer value.
411   \param [in]    value  Value to reverse
412   \return               Reversed value
413  */
414 #define __REV                             __rev
415
416
417 /**
418   \brief   Reverse byte order (16 bit)
419   \details Reverses the byte order in two unsigned short values.
420   \param [in]    value  Value to reverse
421   \return               Reversed value
422  */
423 #ifndef __NO_EMBEDDED_ASM
424 __attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
425 {
426   rev16 r0, r0
427   bx lr
428 }
429 #endif
430
431
432 /**
433   \brief   Reverse byte order in signed short value
434   \details Reverses the byte order in a signed short value with sign extension to integer.
435   \param [in]    value  Value to reverse
436   \return               Reversed value
437  */
438 #ifndef __NO_EMBEDDED_ASM
439 __attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
440 {
441   revsh r0, r0
442   bx lr
443 }
444 #endif
445
446
447 /**
448   \brief   Rotate Right in unsigned value (32 bit)
449   \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
450   \param [in]    op1  Value to rotate
451   \param [in]    op2  Number of Bits to rotate
452   \return               Rotated value
453  */
454 #define __ROR                             __ror
455
456
457 /**
458   \brief   Breakpoint
459   \details Causes the processor to enter Debug state.
460            Debug tools can use this to investigate system state when the instruction at a particular address is reached.
461   \param [in]    value  is ignored by the processor.
462                  If required, a debugger can use it to store additional information about the breakpoint.
463  */
464 #define __BKPT(value)                       __breakpoint(value)
465
466
467 /**
468   \brief   Reverse bit order of value
469   \details Reverses the bit order of the given value.
470   \param [in]    value  Value to reverse
471   \return               Reversed value
472  */
473 #if ((defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1)) || \
474      (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     )
475   #define __RBIT                          __rbit
476 #else
477 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
478 {
479   uint32_t result;
480   int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */
481
482   result = value;                      /* r will be reversed bits of v; first get LSB of v */
483   for (value >>= 1U; value; value >>= 1U)
484   {
485     result <<= 1U;
486     result |= value & 1U;
487     s--;
488   }
489   result <<= s;                        /* shift when v's highest bits are zero */
490   return(result);
491 }
492 #endif
493
494
495 /**
496   \brief   Count leading zeros
497   \details Counts the number of leading zeros of a data value.
498   \param [in]  value  Value to count the leading zeros
499   \return             number of leading zeros in value
500  */
501 #define __CLZ                             __clz
502
503
504 #if ((defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1)) || \
505      (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     )
506
507 /**
508   \brief   LDR Exclusive (8 bit)
509   \details Executes a exclusive LDR instruction for 8 bit value.
510   \param [in]    ptr  Pointer to data
511   \return             value of type uint8_t at (*ptr)
512  */
513 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
514   #define __LDREXB(ptr)                                                        ((uint8_t ) __ldrex(ptr))
515 #else
516   #define __LDREXB(ptr)          _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr))  _Pragma("pop")
517 #endif
518
519
520 /**
521   \brief   LDR Exclusive (16 bit)
522   \details Executes a exclusive LDR instruction for 16 bit values.
523   \param [in]    ptr  Pointer to data
524   \return        value of type uint16_t at (*ptr)
525  */
526 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
527   #define __LDREXH(ptr)                                                        ((uint16_t) __ldrex(ptr))
528 #else
529   #define __LDREXH(ptr)          _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr))  _Pragma("pop")
530 #endif
531
532
533 /**
534   \brief   LDR Exclusive (32 bit)
535   \details Executes a exclusive LDR instruction for 32 bit values.
536   \param [in]    ptr  Pointer to data
537   \return        value of type uint32_t at (*ptr)
538  */
539 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
540   #define __LDREXW(ptr)                                                        ((uint32_t ) __ldrex(ptr))
541 #else
542   #define __LDREXW(ptr)          _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr))  _Pragma("pop")
543 #endif
544
545
546 /**
547   \brief   STR Exclusive (8 bit)
548   \details Executes a exclusive STR instruction for 8 bit values.
549   \param [in]  value  Value to store
550   \param [in]    ptr  Pointer to location
551   \return          0  Function succeeded
552   \return          1  Function failed
553  */
554 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
555   #define __STREXB(value, ptr)                                                 __strex(value, ptr)
556 #else
557   #define __STREXB(value, ptr)   _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr)        _Pragma("pop")
558 #endif
559
560
561 /**
562   \brief   STR Exclusive (16 bit)
563   \details Executes a exclusive STR instruction for 16 bit values.
564   \param [in]  value  Value to store
565   \param [in]    ptr  Pointer to location
566   \return          0  Function succeeded
567   \return          1  Function failed
568  */
569 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
570   #define __STREXH(value, ptr)                                                 __strex(value, ptr)
571 #else
572   #define __STREXH(value, ptr)   _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr)        _Pragma("pop")
573 #endif
574
575
576 /**
577   \brief   STR Exclusive (32 bit)
578   \details Executes a exclusive STR instruction for 32 bit values.
579   \param [in]  value  Value to store
580   \param [in]    ptr  Pointer to location
581   \return          0  Function succeeded
582   \return          1  Function failed
583  */
584 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
585   #define __STREXW(value, ptr)                                                 __strex(value, ptr)
586 #else
587   #define __STREXW(value, ptr)   _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr)        _Pragma("pop")
588 #endif
589
590
591 /**
592   \brief   Remove the exclusive lock
593   \details Removes the exclusive lock which is created by LDREX.
594  */
595 #define __CLREX                           __clrex
596
597
598 /**
599   \brief   Signed Saturate
600   \details Saturates a signed value.
601   \param [in]  value  Value to be saturated
602   \param [in]    sat  Bit position to saturate to (1..32)
603   \return             Saturated value
604  */
605 #define __SSAT                            __ssat
606
607
608 /**
609   \brief   Unsigned Saturate
610   \details Saturates an unsigned value.
611   \param [in]  value  Value to be saturated
612   \param [in]    sat  Bit position to saturate to (0..31)
613   \return             Saturated value
614  */
615 #define __USAT                            __usat
616
617
618 /**
619   \brief   Rotate Right with Extend (32 bit)
620   \details Moves each bit of a bitstring right by one bit.
621            The carry input is shifted in at the left end of the bitstring.
622   \param [in]    value  Value to rotate
623   \return               Rotated value
624  */
625 #ifndef __NO_EMBEDDED_ASM
626 __attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)
627 {
628   rrx r0, r0
629   bx lr
630 }
631 #endif
632
633
634 /**
635   \brief   LDRT Unprivileged (8 bit)
636   \details Executes a Unprivileged LDRT instruction for 8 bit value.
637   \param [in]    ptr  Pointer to data
638   \return             value of type uint8_t at (*ptr)
639  */
640 #define __LDRBT(ptr)                      ((uint8_t )  __ldrt(ptr))
641
642
643 /**
644   \brief   LDRT Unprivileged (16 bit)
645   \details Executes a Unprivileged LDRT instruction for 16 bit values.
646   \param [in]    ptr  Pointer to data
647   \return        value of type uint16_t at (*ptr)
648  */
649 #define __LDRHT(ptr)                      ((uint16_t)  __ldrt(ptr))
650
651
652 /**
653   \brief   LDRT Unprivileged (32 bit)
654   \details Executes a Unprivileged LDRT instruction for 32 bit values.
655   \param [in]    ptr  Pointer to data
656   \return        value of type uint32_t at (*ptr)
657  */
658 #define __LDRT(ptr)                       ((uint32_t ) __ldrt(ptr))
659
660
661 /**
662   \brief   STRT Unprivileged (8 bit)
663   \details Executes a Unprivileged STRT instruction for 8 bit values.
664   \param [in]  value  Value to store
665   \param [in]    ptr  Pointer to location
666  */
667 #define __STRBT(value, ptr)               __strt(value, ptr)
668
669
670 /**
671   \brief   STRT Unprivileged (16 bit)
672   \details Executes a Unprivileged STRT instruction for 16 bit values.
673   \param [in]  value  Value to store
674   \param [in]    ptr  Pointer to location
675  */
676 #define __STRHT(value, ptr)               __strt(value, ptr)
677
678
679 /**
680   \brief   STRT Unprivileged (32 bit)
681   \details Executes a Unprivileged STRT instruction for 32 bit values.
682   \param [in]  value  Value to store
683   \param [in]    ptr  Pointer to location
684  */
685 #define __STRT(value, ptr)                __strt(value, ptr)
686
687 #endif /* ((defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1)) || \
688            (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     ) */
689
690 /*@}*/ /* end of group CMSIS_Core_InstructionInterface */
691
692
693 /* ###################  Compiler specific Intrinsics  ########################### */
694 /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
695   Access to dedicated SIMD instructions
696   @{
697 */
698
699 #if ((defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     )
700
701 #define __SADD8                           __sadd8
702 #define __QADD8                           __qadd8
703 #define __SHADD8                          __shadd8
704 #define __UADD8                           __uadd8
705 #define __UQADD8                          __uqadd8
706 #define __UHADD8                          __uhadd8
707 #define __SSUB8                           __ssub8
708 #define __QSUB8                           __qsub8
709 #define __SHSUB8                          __shsub8
710 #define __USUB8                           __usub8
711 #define __UQSUB8                          __uqsub8
712 #define __UHSUB8                          __uhsub8
713 #define __SADD16                          __sadd16
714 #define __QADD16                          __qadd16
715 #define __SHADD16                         __shadd16
716 #define __UADD16                          __uadd16
717 #define __UQADD16                         __uqadd16
718 #define __UHADD16                         __uhadd16
719 #define __SSUB16                          __ssub16
720 #define __QSUB16                          __qsub16
721 #define __SHSUB16                         __shsub16
722 #define __USUB16                          __usub16
723 #define __UQSUB16                         __uqsub16
724 #define __UHSUB16                         __uhsub16
725 #define __SASX                            __sasx
726 #define __QASX                            __qasx
727 #define __SHASX                           __shasx
728 #define __UASX                            __uasx
729 #define __UQASX                           __uqasx
730 #define __UHASX                           __uhasx
731 #define __SSAX                            __ssax
732 #define __QSAX                            __qsax
733 #define __SHSAX                           __shsax
734 #define __USAX                            __usax
735 #define __UQSAX                           __uqsax
736 #define __UHSAX                           __uhsax
737 #define __USAD8                           __usad8
738 #define __USADA8                          __usada8
739 #define __SSAT16                          __ssat16
740 #define __USAT16                          __usat16
741 #define __UXTB16                          __uxtb16
742 #define __UXTAB16                         __uxtab16
743 #define __SXTB16                          __sxtb16
744 #define __SXTAB16                         __sxtab16
745 #define __SMUAD                           __smuad
746 #define __SMUADX                          __smuadx
747 #define __SMLAD                           __smlad
748 #define __SMLADX                          __smladx
749 #define __SMLALD                          __smlald
750 #define __SMLALDX                         __smlaldx
751 #define __SMUSD                           __smusd
752 #define __SMUSDX                          __smusdx
753 #define __SMLSD                           __smlsd
754 #define __SMLSDX                          __smlsdx
755 #define __SMLSLD                          __smlsld
756 #define __SMLSLDX                         __smlsldx
757 #define __SEL                             __sel
758 #define __QADD                            __qadd
759 #define __QSUB                            __qsub
760
761 #define __PKHBT(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0x0000FFFFUL) |  \
762                                            ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL)  )
763
764 #define __PKHTB(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0xFFFF0000UL) |  \
765                                            ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL)  )
766
767 #define __SMMLA(ARG1,ARG2,ARG3)          ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
768                                                       ((int64_t)(ARG3) << 32U)     ) >> 32U))
769
770 #endif /* ((defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))     ) */
771 /*@} end of group CMSIS_SIMD_intrinsics */
772
773
774 #endif /* __CMSIS_ARMCC_H */