cmsis_armcc.h 23 KB

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