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