]> begriffs open source - cmsis/blob - CMSIS/Core_A/Include/cmsis_iccarm.h
Core: Added __STATIC_FORCEINLINE macro for all compilers.
[cmsis] / CMSIS / Core_A / Include / cmsis_iccarm.h
1 /**************************************************************************//**
2  * @file     cmsis_iccarm.h
3  * @brief    CMSIS compiler ICCARM (IAR compiler) header file
4  * @version  V5.0.4
5  * @date     01. December 2017
6  ******************************************************************************/
7
8 //------------------------------------------------------------------------------
9 //
10 // Copyright (c) 2017 IAR Systems
11 //
12 // Licensed under the Apache License, Version 2.0 (the "License")
13 // you may not use this file except in compliance with the License.
14 // You may obtain a copy of the License at
15 //     http://www.apache.org/licenses/LICENSE-2.0
16 //
17 // Unless required by applicable law or agreed to in writing, software
18 // distributed under the License is distributed on an "AS IS" BASIS,
19 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 // See the License for the specific language governing permissions and
21 // limitations under the License.
22 //
23 //------------------------------------------------------------------------------
24
25
26 #ifndef __CMSIS_ICCARM_H__
27 #define __CMSIS_ICCARM_H__
28
29 #ifndef __ICCARM__
30   #error This file should only be compiled by ICCARM
31 #endif
32
33 #pragma system_include
34
35 #define __IAR_FT _Pragma("inline=forced") __intrinsic
36
37 #if (__VER__ >= 8000000)
38   #define __ICCARM_V8 1
39 #else
40   #define __ICCARM_V8 0
41 #endif
42
43 #pragma language=extended
44
45 #ifndef __ALIGNED
46   #if __ICCARM_V8
47     #define __ALIGNED(x) __attribute__((aligned(x)))
48   #elif (__VER__ >= 7080000)
49     /* Needs IAR language extensions */
50     #define __ALIGNED(x) __attribute__((aligned(x)))
51   #else
52     #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored.
53     #define __ALIGNED(x)
54   #endif
55 #endif
56
57
58 /* Define compiler macros for CPU architecture, used in CMSIS 5.
59  */
60 #if __ARM_ARCH_7A__
61 /* Macro already defined */
62 #else
63   #if defined(__ARM7A__)
64     #define __ARM_ARCH_7A__ 1
65   #endif
66 #endif
67
68 #ifndef __ASM
69   #define __ASM __asm
70 #endif
71
72 #ifndef __INLINE
73   #define __INLINE inline
74 #endif
75
76 #ifndef   __NO_RETURN
77   #if __ICCARM_V8
78     #define __NO_RETURN __attribute__((__noreturn__))
79   #else
80     #define __NO_RETURN _Pragma("object_attribute=__noreturn")
81   #endif
82 #endif
83
84 #ifndef   __PACKED
85   /* Needs IAR language extensions */
86   #if __ICCARM_V8
87     #define __PACKED __attribute__((packed, aligned(1)))
88   #else
89     #define __PACKED __packed
90   #endif
91 #endif
92
93 #ifndef   __PACKED_STRUCT
94   /* Needs IAR language extensions */
95   #if __ICCARM_V8
96     #define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
97   #else
98     #define __PACKED_STRUCT __packed struct
99   #endif
100 #endif
101
102 #ifndef   __PACKED_UNION
103   /* Needs IAR language extensions */
104   #if __ICCARM_V8
105     #define __PACKED_UNION union __attribute__((packed, aligned(1)))
106   #else
107     #define __PACKED_UNION __packed union
108   #endif
109 #endif
110
111 #ifndef   __RESTRICT
112   #define __RESTRICT            restrict
113 #endif
114
115 #ifndef   __STATIC_INLINE
116   #define __STATIC_INLINE       static inline
117 #endif
118
119 #ifndef   __FORCEINLINE
120   #define __FORCEINLINE         _Pragma("inline=forced")
121 #endif
122
123 #ifndef   __STATIC_FORCEINLINE
124   #define __STATIC_FORCEINLINE  __FORCEINLINE __STATIC_INLINE
125 #endif
126
127 #ifndef __UNALIGNED_UINT16_READ
128   #pragma language=save
129   #pragma language=extended
130   __IAR_FT uint16_t __iar_uint16_read(void const *ptr)
131   {
132     return *(__packed uint16_t*)(ptr);
133   }
134   #pragma language=restore
135   #define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR)
136 #endif
137
138
139 #ifndef __UNALIGNED_UINT16_WRITE
140   #pragma language=save
141   #pragma language=extended
142   __IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val)
143   {
144     *(__packed uint16_t*)(ptr) = val;;
145   }
146   #pragma language=restore
147   #define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL)
148 #endif
149
150 #ifndef __UNALIGNED_UINT32_READ
151   #pragma language=save
152   #pragma language=extended
153   __IAR_FT uint32_t __iar_uint32_read(void const *ptr)
154   {
155     return *(__packed uint32_t*)(ptr);
156   }
157   #pragma language=restore
158   #define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR)
159 #endif
160
161 #ifndef __UNALIGNED_UINT32_WRITE
162   #pragma language=save
163   #pragma language=extended
164   __IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val)
165   {
166     *(__packed uint32_t*)(ptr) = val;;
167   }
168   #pragma language=restore
169   #define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL)
170 #endif
171
172 #if 0
173 #ifndef __UNALIGNED_UINT32   /* deprecated */
174   #pragma language=save
175   #pragma language=extended
176   __packed struct  __iar_u32 { uint32_t v; };
177   #pragma language=restore
178   #define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v)
179 #endif
180 #endif
181
182 #ifndef   __USED
183   #if __ICCARM_V8
184     #define __USED __attribute__((used))
185   #else
186     #define __USED _Pragma("__root")
187   #endif
188 #endif
189
190 #ifndef   __WEAK
191   #if __ICCARM_V8
192     #define __WEAK __attribute__((weak))
193   #else
194     #define __WEAK _Pragma("__weak")
195   #endif
196 #endif
197
198
199 #ifndef __ICCARM_INTRINSICS_VERSION__
200   #define __ICCARM_INTRINSICS_VERSION__  0
201 #endif
202
203 #if __ICCARM_INTRINSICS_VERSION__ == 2
204
205   #if defined(__CLZ)
206     #undef __CLZ
207   #endif
208   #if defined(__REVSH)
209     #undef __REVSH
210   #endif
211   #if defined(__RBIT)
212     #undef __RBIT
213   #endif
214   #if defined(__SSAT)
215     #undef __SSAT
216   #endif
217   #if defined(__USAT)
218     #undef __USAT
219   #endif
220
221   #include "iccarm_builtin.h"
222
223   #define __enable_irq        __iar_builtin_enable_interrupt
224   #define __disable_irq       __iar_builtin_disable_interrupt
225   #define __enable_fault_irq    __iar_builtin_enable_fiq
226   #define __disable_fault_irq   __iar_builtin_disable_fiq
227   #define __arm_rsr           __iar_builtin_rsr
228   #define __arm_wsr           __iar_builtin_wsr
229
230   #if __FPU_PRESENT
231     #define __get_FPSCR()             (__arm_rsr("FPSCR"))
232   #else
233     #define __get_FPSCR()             ( 0 )
234   #endif
235
236   #define __set_FPSCR(VALUE)          (__arm_wsr("FPSCR", VALUE))
237
238   #define __get_CPSR()                (__arm_rsr("CPSR"))
239   #define __get_mode()                (__get_CPSR() & 0x1FU)
240
241   #define __set_CPSR(VALUE)           (__arm_wsr("CPSR", (VALUE)))
242   #define __set_mode(VALUE)           (__arm_wsr("CPSR_c", (VALUE)))
243
244
245   #define __get_FPEXC()       (__arm_rsr("FPEXC"))
246   #define __set_FPEXC(VALUE)    (__arm_wsr("FPEXC", VALUE))
247
248   #define __get_CP(cp, op1, RT, CRn, CRm, op2) \
249     ((RT) = __arm_rsr("p" # cp ":" # op1 ":c" # CRn ":c" # CRm ":" # op2))
250
251   #define __set_CP(cp, op1, RT, CRn, CRm, op2) \
252     (__arm_wsr("p" # cp ":" # op1 ":c" # CRn ":c" # CRm ":" # op2, (RT)))
253
254   #define __get_CP64(cp, op1, Rt, CRm) \
255     __ASM volatile("MRRC p" # cp ", " # op1 ", %Q0, %R0, c" # CRm  : "=r" (Rt) : : "memory" )
256
257   #define __set_CP64(cp, op1, Rt, CRm) \
258     __ASM volatile("MCRR p" # cp ", " # op1 ", %Q0, %R0, c" # CRm  : : "r" (Rt) : "memory" )
259
260   #include "cmsis_cp15.h"
261
262   #define __NOP     __iar_builtin_no_operation
263
264   #define __CLZ     __iar_builtin_CLZ
265   #define __CLREX   __iar_builtin_CLREX
266
267   #define __DMB     __iar_builtin_DMB
268   #define __DSB     __iar_builtin_DSB
269   #define __ISB     __iar_builtin_ISB
270
271   #define __LDREXB  __iar_builtin_LDREXB
272   #define __LDREXH  __iar_builtin_LDREXH
273   #define __LDREXW  __iar_builtin_LDREX
274
275   #define __RBIT    __iar_builtin_RBIT
276   #define __REV     __iar_builtin_REV
277   #define __REV16   __iar_builtin_REV16
278
279   __IAR_FT int16_t __REVSH(int16_t val)
280   {
281     return (int16_t) __iar_builtin_REVSH(val);
282   }
283
284   #define __ROR     __iar_builtin_ROR
285   #define __RRX     __iar_builtin_RRX
286
287   #define __SEV     __iar_builtin_SEV
288
289   #define __SSAT    __iar_builtin_SSAT
290
291   #define __STREXB  __iar_builtin_STREXB
292   #define __STREXH  __iar_builtin_STREXH
293   #define __STREXW  __iar_builtin_STREX
294
295   #define __USAT    __iar_builtin_USAT
296
297   #define __WFE     __iar_builtin_WFE
298   #define __WFI     __iar_builtin_WFI
299
300   #define __SADD8   __iar_builtin_SADD8
301   #define __QADD8   __iar_builtin_QADD8
302   #define __SHADD8  __iar_builtin_SHADD8
303   #define __UADD8   __iar_builtin_UADD8
304   #define __UQADD8  __iar_builtin_UQADD8
305   #define __UHADD8  __iar_builtin_UHADD8
306   #define __SSUB8   __iar_builtin_SSUB8
307   #define __QSUB8   __iar_builtin_QSUB8
308   #define __SHSUB8  __iar_builtin_SHSUB8
309   #define __USUB8   __iar_builtin_USUB8
310   #define __UQSUB8  __iar_builtin_UQSUB8
311   #define __UHSUB8  __iar_builtin_UHSUB8
312   #define __SADD16  __iar_builtin_SADD16
313   #define __QADD16  __iar_builtin_QADD16
314   #define __SHADD16 __iar_builtin_SHADD16
315   #define __UADD16  __iar_builtin_UADD16
316   #define __UQADD16 __iar_builtin_UQADD16
317   #define __UHADD16 __iar_builtin_UHADD16
318   #define __SSUB16  __iar_builtin_SSUB16
319   #define __QSUB16  __iar_builtin_QSUB16
320   #define __SHSUB16 __iar_builtin_SHSUB16
321   #define __USUB16  __iar_builtin_USUB16
322   #define __UQSUB16 __iar_builtin_UQSUB16
323   #define __UHSUB16 __iar_builtin_UHSUB16
324   #define __SASX    __iar_builtin_SASX
325   #define __QASX    __iar_builtin_QASX
326   #define __SHASX   __iar_builtin_SHASX
327   #define __UASX    __iar_builtin_UASX
328   #define __UQASX   __iar_builtin_UQASX
329   #define __UHASX   __iar_builtin_UHASX
330   #define __SSAX    __iar_builtin_SSAX
331   #define __QSAX    __iar_builtin_QSAX
332   #define __SHSAX   __iar_builtin_SHSAX
333   #define __USAX    __iar_builtin_USAX
334   #define __UQSAX   __iar_builtin_UQSAX
335   #define __UHSAX   __iar_builtin_UHSAX
336   #define __USAD8   __iar_builtin_USAD8
337   #define __USADA8  __iar_builtin_USADA8
338   #define __SSAT16  __iar_builtin_SSAT16
339   #define __USAT16  __iar_builtin_USAT16
340   #define __UXTB16  __iar_builtin_UXTB16
341   #define __UXTAB16 __iar_builtin_UXTAB16
342   #define __SXTB16  __iar_builtin_SXTB16
343   #define __SXTAB16 __iar_builtin_SXTAB16
344   #define __SMUAD   __iar_builtin_SMUAD
345   #define __SMUADX  __iar_builtin_SMUADX
346   #define __SMMLA   __iar_builtin_SMMLA
347   #define __SMLAD   __iar_builtin_SMLAD
348   #define __SMLADX  __iar_builtin_SMLADX
349   #define __SMLALD  __iar_builtin_SMLALD
350   #define __SMLALDX __iar_builtin_SMLALDX
351   #define __SMUSD   __iar_builtin_SMUSD
352   #define __SMUSDX  __iar_builtin_SMUSDX
353   #define __SMLSD   __iar_builtin_SMLSD
354   #define __SMLSDX  __iar_builtin_SMLSDX
355   #define __SMLSLD  __iar_builtin_SMLSLD
356   #define __SMLSLDX __iar_builtin_SMLSLDX
357   #define __SEL     __iar_builtin_SEL
358   #define __QADD    __iar_builtin_QADD
359   #define __QSUB    __iar_builtin_QSUB
360   #define __PKHBT   __iar_builtin_PKHBT
361   #define __PKHTB   __iar_builtin_PKHTB
362
363 #else /* __ICCARM_INTRINSICS_VERSION__ == 2 */
364
365   #if !__FPU_PRESENT
366   #define __get_FPSCR __cmsis_iar_get_FPSR_not_active
367   #endif
368
369   #ifdef __INTRINSICS_INCLUDED
370   #error intrinsics.h is already included previously!
371   #endif
372
373   #include <intrinsics.h>
374
375   #if !__FPU_PRESENT
376   #define __get_FPSCR() (0)
377   #endif
378
379   #pragma diag_suppress=Pe940
380   #pragma diag_suppress=Pe177
381
382   #define __enable_irq        __enable_interrupt
383   #define __disable_irq       __disable_interrupt
384   #define __enable_fault_irq    __enable_fiq
385   #define __disable_fault_irq   __disable_fiq
386   #define __NOP               __no_operation
387
388   #define __get_xPSR          __get_PSR
389
390   __IAR_FT void __set_mode(uint32_t mode)
391   {
392     __ASM volatile("MSR  cpsr_c, %0" : : "r" (mode) : "memory");
393   }
394
395   __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr)
396   {
397     return __LDREX((unsigned long *)ptr);
398   }
399
400   __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr)
401   {
402     return __STREX(value, (unsigned long *)ptr);
403   }
404
405
406   __IAR_FT uint32_t __RRX(uint32_t value)
407   {
408     uint32_t result;
409     __ASM("RRX      %0, %1" : "=r"(result) : "r" (value) : "cc");
410     return(result);
411   }
412
413
414   __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2)
415   {
416     return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2));
417   }
418
419   __IAR_FT uint32_t __get_FPEXC(void)
420   {
421   #if (__FPU_PRESENT == 1)
422     uint32_t result;
423     __ASM volatile("VMRS %0, fpexc" : "=r" (result) : : "memory");
424     return(result);
425   #else
426     return(0);
427   #endif
428   }
429
430   __IAR_FT void __set_FPEXC(uint32_t fpexc)
431   {
432   #if (__FPU_PRESENT == 1)
433     __ASM volatile ("VMSR fpexc, %0" : : "r" (fpexc) : "memory");
434   #endif
435   }
436
437
438   #define __get_CP(cp, op1, Rt, CRn, CRm, op2) \
439     __ASM volatile("MRC p" # cp ", " # op1 ", %0, c" # CRn ", c" # CRm ", " # op2 : "=r" (Rt) : : "memory" )
440   #define __set_CP(cp, op1, Rt, CRn, CRm, op2) \
441     __ASM volatile("MCR p" # cp ", " # op1 ", %0, c" # CRn ", c" # CRm ", " # op2 : : "r" (Rt) : "memory" )
442   #define __get_CP64(cp, op1, Rt, CRm) \
443     __ASM volatile("MRRC p" # cp ", " # op1 ", %Q0, %R0, c" # CRm  : "=r" (Rt) : : "memory" )
444   #define __set_CP64(cp, op1, Rt, CRm) \
445     __ASM volatile("MCRR p" # cp ", " # op1 ", %Q0, %R0, c" # CRm  : : "r" (Rt) : "memory" )
446
447   #include "cmsis_cp15.h"
448
449 #endif   /* __ICCARM_INTRINSICS_VERSION__ == 2 */
450
451 #define __BKPT(value)    __asm volatile ("BKPT     %0" : : "i"(value))
452
453
454 __IAR_FT uint32_t __get_SP_usr(void)
455 {
456   uint32_t cpsr;
457   uint32_t result;
458   __ASM volatile(
459     "MRS     %0, cpsr   \n"
460     "CPS     #0x1F      \n" // no effect in USR mode
461     "MOV     %1, sp     \n"
462     "MSR     cpsr_c, %2 \n" // no effect in USR mode
463     "ISB" :  "=r"(cpsr), "=r"(result) : "r"(cpsr) : "memory"
464    );
465   return result;
466 }
467
468 __IAR_FT void __set_SP_usr(uint32_t topOfProcStack)
469 {
470   uint32_t cpsr;
471   __ASM volatile(
472     "MRS     %0, cpsr   \n"
473     "CPS     #0x1F      \n" // no effect in USR mode
474     "MOV     sp, %1     \n"
475     "MSR     cpsr_c, %2 \n" // no effect in USR mode
476     "ISB" : "=r"(cpsr) : "r" (topOfProcStack), "r"(cpsr) : "memory"
477    );
478 }
479
480 #define __get_mode()                (__get_CPSR() & 0x1FU)
481
482
483 __STATIC_INLINE
484 void __L1C_CleanInvalidateCache(uint32_t op)
485 {
486   __ASM volatile(
487     "        PUSH    {R4-R11}                   \n"
488
489     "        MRC     p15, 1, R6, c0, c0, 1      \n" // Read CLIDR
490     "        ANDS    R3, R6, #0x07000000        \n" // Extract coherency level
491     "        MOV     R3, R3, LSR #23            \n" // Total cache levels << 1
492     "        BEQ     Finished                   \n" // If 0, no need to clean
493
494     "        MOV     R10, #0                    \n" // R10 holds current cache level << 1
495     "Loop1:  ADD     R2, R10, R10, LSR #1       \n" // R2 holds cache "Set" position
496     "        MOV     R1, R6, LSR R2             \n" // Bottom 3 bits are the Cache-type for this level
497     "        AND     R1, R1, #7                 \n" // Isolate those lower 3 bits
498     "        CMP     R1, #2                     \n"
499     "        BLT     Skip                       \n" // No cache or only instruction cache at this level
500
501     "        MCR     p15, 2, R10, c0, c0, 0     \n" // Write the Cache Size selection register
502     "        ISB                                \n" // ISB to sync the change to the CacheSizeID reg
503     "        MRC     p15, 1, R1, c0, c0, 0      \n" // Reads current Cache Size ID register
504     "        AND     R2, R1, #7                 \n" // Extract the line length field
505     "        ADD     R2, R2, #4                 \n" // Add 4 for the line length offset (log2 16 bytes)
506     "        MOVW    R4, #0x3FF                 \n"
507     "        ANDS    R4, R4, R1, LSR #3         \n" // R4 is the max number on the way size (right aligned)
508     "        CLZ     R5, R4                     \n" // R5 is the bit position of the way size increment
509     "        MOVW    R7, #0x7FFF                \n"
510     "        ANDS    R7, R7, R1, LSR #13        \n" // R7 is the max number of the index size (right aligned)
511
512     "Loop2:  MOV     R9, R4                     \n" // R9 working copy of the max way size (right aligned)
513
514     "Loop3:  ORR     R11, R10, R9, LSL R5       \n" // Factor in the Way number and cache number into R11
515     "        ORR     R11, R11, R7, LSL R2       \n" // Factor in the Set number
516     "        CMP     R0, #0                     \n"
517     "        BNE     Dccsw                      \n"
518     "        MCR     p15, 0, R11, c7, c6, 2     \n" // DCISW. Invalidate by Set/Way
519     "        B       cont                       \n"
520     "Dccsw:  CMP     R0, #1                     \n"
521     "        BNE     Dccisw                     \n"
522     "        MCR     p15, 0, R11, c7, c10, 2    \n" // DCCSW. Clean by Set/Way
523     "        B       cont                       \n"
524     "Dccisw: MCR     p15, 0, R11, c7, c14, 2    \n" // DCCISW. Clean and Invalidate by Set/Way
525     "cont:   SUBS    R9, R9, #1                 \n" // Decrement the Way number
526     "        BGE     Loop3                      \n"
527     "        SUBS    R7, R7, #1                 \n" // Decrement the Set number
528     "        BGE     Loop2                      \n"
529     "Skip:   ADD     R10, R10, #2               \n" // Increment the cache number
530     "        CMP     R3, R10                    \n"
531     "        BGT     Loop1                      \n"
532
533     "Finished:                                  \n"
534     "        DSB                                \n"
535     "        POP    {R4-R11}                      "
536   );
537 }
538
539
540 __STATIC_INLINE
541 void __FPU_Enable(void)
542 {
543   __ASM volatile(
544     //Permit access to VFP/NEON, registers by modifying CPACR
545     "        MRC     p15,0,R1,c1,c0,2  \n"
546     "        ORR     R1,R1,#0x00F00000 \n"
547     "        MCR     p15,0,R1,c1,c0,2  \n"
548
549     //Ensure that subsequent instructions occur in the context of VFP/NEON access permitted
550     "        ISB                       \n"
551
552     //Enable VFP/NEON
553     "        VMRS    R1,FPEXC          \n"
554     "        ORR     R1,R1,#0x40000000 \n"
555     "        VMSR    FPEXC,R1          \n"
556
557     //Initialise VFP/NEON registers to 0
558     "        MOV     R2,#0             \n"
559
560     //Initialise D16 registers to 0
561     "        VMOV    D0, R2,R2         \n"
562     "        VMOV    D1, R2,R2         \n"
563     "        VMOV    D2, R2,R2         \n"
564     "        VMOV    D3, R2,R2         \n"
565     "        VMOV    D4, R2,R2         \n"
566     "        VMOV    D5, R2,R2         \n"
567     "        VMOV    D6, R2,R2         \n"
568     "        VMOV    D7, R2,R2         \n"
569     "        VMOV    D8, R2,R2         \n"
570     "        VMOV    D9, R2,R2         \n"
571     "        VMOV    D10,R2,R2         \n"
572     "        VMOV    D11,R2,R2         \n"
573     "        VMOV    D12,R2,R2         \n"
574     "        VMOV    D13,R2,R2         \n"
575     "        VMOV    D14,R2,R2         \n"
576     "        VMOV    D15,R2,R2         \n"
577
578 #ifdef __ARM_ADVANCED_SIMD__
579     //Initialise D32 registers to 0
580     "        VMOV    D16,R2,R2         \n"
581     "        VMOV    D17,R2,R2         \n"
582     "        VMOV    D18,R2,R2         \n"
583     "        VMOV    D19,R2,R2         \n"
584     "        VMOV    D20,R2,R2         \n"
585     "        VMOV    D21,R2,R2         \n"
586     "        VMOV    D22,R2,R2         \n"
587     "        VMOV    D23,R2,R2         \n"
588     "        VMOV    D24,R2,R2         \n"
589     "        VMOV    D25,R2,R2         \n"
590     "        VMOV    D26,R2,R2         \n"
591     "        VMOV    D27,R2,R2         \n"
592     "        VMOV    D28,R2,R2         \n"
593     "        VMOV    D29,R2,R2         \n"
594     "        VMOV    D30,R2,R2         \n"
595     "        VMOV    D31,R2,R2         \n"
596 #endif
597
598     //Initialise FPSCR to a known state
599     "        VMRS    R2,FPSCR          \n"
600     "        MOV32   R3,#0x00086060    \n" //Mask off all bits that do not have to be preserved. Non-preserved bits can/should be zero.
601     "        AND     R2,R2,R3          \n"
602     "        VMSR    FPSCR,R2          \n");
603 }
604
605
606
607 #undef __IAR_FT
608 #undef __ICCARM_V8
609
610 #pragma diag_default=Pe940
611 #pragma diag_default=Pe177
612
613 #endif /* __CMSIS_ICCARM_H__ */