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