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