]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/Ref_cm4_simd.txt
CoreValidation: Fix Arm Compiler 6 linker warnings.
[cmsis] / CMSIS / DoxyGen / Core / src / Ref_cm4_simd.txt
1 /* ######################  CMSIS Support for Cortex-M4 SIMD Instructions  ####################### */
2 /**
3
4 \defgroup  intrinsic_SIMD_gr  Intrinsic Functions for SIMD Instructions [only Cortex-M4 and Cortex-M7]
5 \brief     Access to dedicated SIMD instructions.
6
7 \details
8
9 <b>Single Instruction Multiple Data (SIMD)</b> extensions are provided <b>only for Cortex-M4 and Cortex-M7 cores</b>
10 to simplify development of application software. SIMD extensions increase the processing capability
11 without materially increasing the power consumption. The SIMD extensions are completely transparent
12 to the operating system (OS), allowing existing OS ports to be used.
13
14 <b>SIMD Features:</b>
15
16  - Simultaneous computation of 2x16-bit or 4x8-bit operands
17  - Fractional arithmetic
18  - User definable saturation modes (arbitrary word-width)
19  - Dual 16x16 multiply-add/subtract 32x32 fractional MAC
20  - Simultaneous 8/16-bit select operations
21  - Performance up to 3.2 GOPS at 800MHz
22  - Performance is achieved with a "near zero" increase in power consumption on a typical implementation
23
24 \b Examples:
25
26 \b Addition: Add two values using SIMD function
27
28 \code
29 uint32_t add_halfwords(uint32_t val1, uint32_t val2)
30 {
31   return __SADD16(val1, val2);
32 }
33 \endcode
34
35
36
37 \b Subtraction: Subtract two values using SIMD function
38
39 \code
40 uint32_t sub_halfwords(uint32_t val1, uint32_t val2)
41 {
42   return __SSUB16(val1, val2);
43 }
44 \endcode
45
46
47 \b Multiplication: Performing a multiplication using SIMD function
48
49 \code
50 uint32_t dual_mul_add_products(uint32_t val1, uint32_t val2)
51 {
52   return __SMUAD(val1, val2);
53 }
54 \endcode
55
56  @{
57 */
58
59
60 /**************************************************************************************************/
61 /**
62     \brief      GE setting quad 8-bit signed addition
63     \details     This function performs four 8-bit signed integer additions.
64           The GE bits of the APSR are set according to the results of the additions.
65     \param      val1    first four 8-bit summands.
66     \param      val2    second four 8-bit summands.
67
68     \returns
69             \li the addition of the first bytes from each operand, in the first byte of the return value.
70             \li the addition of the second bytes of each operand, in the second byte of the return value.
71             \li the addition of the third bytes of each operand, in the third byte of the return value.
72             \li the addition of the fourth bytes of each operand, in the fourth byte of the return value.
73         \par
74             Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
75              the results of the operation.
76         \par
77             If \em res is the return value, then:
78             \li if res[7:0] \>= 0 then APSR.GE[0] = 1 else 0
79             \li if res[15:8] \>= 0 then APSR.GE[1] = 1 else 0
80             \li if res[23:16] \>= 0 then APSR.GE[2] = 1 else 0
81             \li if res[31:24] \>= 0 then APSR.GE[3] = 1 else 0
82
83     \par Operation:
84         \code
85    res[7:0]   = val1[7:0]   + val2[7:0]
86    res[15:8]  = val1[15:8]  + val2[15:8]
87    res[23:16] = val1[23:16] + val2[23:16]
88    res[31:24] = val1[31:24] + val2[31:24]
89         \endcode
90 */
91 uint32_t __SADD8(uint32_t val1, uint32_t val2);
92
93
94 /**************************************************************************************************/
95 /** \ingroup    Intrinsic_SIMD_gr
96     \brief      Q setting quad 8-bit saturating addition
97     \details     This function enables you to perform four 8-bit integer additions, saturating the results to
98           the 8-bit signed integer range -2<sup>7</sup> \<= x \<= 2<sup>7</sup> - 1.
99     \param      val1    first four 8-bit summands.
100     \param      val2    second four 8-bit summands.
101
102     \returns
103             \li the saturated addition of the first byte of each operand in the first byte of the return value.
104             \li the saturated addition of the second byte of each operand in the second byte of the return value.
105             \li the saturated addition of the third byte of each operand in the third byte of the return value.
106             \li the saturated addition of the fourth byte of each operand in the fourth byte of the return value.
107         \par
108             The returned results are saturated to the 16-bit signed integer range -2<sup>7</sup> \<= x \<= 2<sup>7</sup> - 1.
109
110     \par Operation:
111         \code
112    res[7:0]   = val1[7:0]   + val2[7:0]
113    res[15:8]  = val1[15:8]  + val2[15:8]
114    res[23:16] = val1[23:16] + val2[23:16]
115    res[31:24] = val1[31:24] + val2[31:24]
116         \endcode
117 */
118 uint32_t __QADD8(uint32_t val1, uint32_t val2);
119
120
121 /**************************************************************************************************/
122 /**
123     \brief      Quad 8-bit signed addition with halved results
124     \details     This function enables you to perform four signed 8-bit integer additions, halving the results.
125     \param      val1    first four 8-bit summands.
126     \param      val2    second four 8-bit summands.
127
128     \returns
129             \li the halved addition of the first bytes from each operand, in the first byte of the return value.
130             \li the halved addition of the second bytes from each operand, in the second byte of the return value.
131             \li the halved addition of the third bytes from each operand, in the third byte of the return value.
132             \li the halved addition of the fourth bytes from each operand, in the fourth byte of the return value.
133
134     \par Operation:
135         \code
136    res[7:0]   = val1[7:0]   + val2[7:0]  >> 1
137    res[15:8]  = val1[15:8]  + val2[15:8] >> 1
138    res[23:16] = val1[23:16] + val2[23:16] >> 1
139    res[31:24] = val1[31:24] + val2[31:24] >> 1
140         \endcode
141 */
142 uint32_t __SHADD8(uint32_t val1, uint32_t val2);
143
144
145 /**************************************************************************************************/
146 /** \ingroup    Intrinsic_SIMD_gr
147     \brief      GE setting quad 8-bit unsigned addition
148
149     \details    This function enables you to perform four unsigned 8-bit integer additions.
150                 The GE bits of the APSR are set according to the results.
151
152     \param      val1    first four 8-bit summands for each addition.
153     \param      val2    second four 8-bit summands for each addition.
154
155     \returns
156             \li the halved addition of the first bytes from each operand, in the first byte of the return value.
157             \li the halved addition of the second bytes from each operand, in the second byte of the return value.
158             \li the halved addition of the third bytes from each operand, in the third byte of the return value.
159             \li the halved addition of the fourth bytes from each operand, in the fourth byte of the return value.
160
161     \par
162             Each bit in APSR.GE is set or cleared for each byte in the return value, depending on the results of the operation.
163
164     \par
165             If \em res is the return value, then:
166             \li if res[7:0] \>= 0x100 then APSR.GE[0] = 1 else 0
167             \li if res[15:8] \>= 0x100 then APSR.GE[1] = 1 else 0
168             \li if res[23:16] \>= 0x100 then APSR.GE[2] = 1 else 0
169             \li if res[31:24] \>= 0x100 then APSR.GE[3] = 1 else 0
170
171     \par Operation:
172         \code
173    res[7:0]   = val1[7:0]   + val2[7:0]
174    res[15:8]  = val1[15:8]  + val2[15:8]
175    res[23:16] = val1[23:16] + val2[23:16]
176    res[31:24] = val1[31:24] + val2[31:24]
177         \endcode
178 */
179 uint32_t __UADD8(uint32_t val1, uint32_t val2);
180
181
182 /**************************************************************************************************/
183 /**
184     \brief      Quad 8-bit unsigned saturating addition
185
186     \details    This function enables you to perform four unsigned 8-bit integer additions, saturating the
187            results to the 8-bit unsigned integer range 0 \< x \< 2<sup>8</sup> - 1.
188
189     \param      val1    first four 8-bit summands.
190     \param      val2    second four 8-bit summands.
191
192     \returns
193             \li the halved addition of the first bytes in each operand, in the first byte of the return value.
194             \li the halved addition of the second bytes in each operand, in the second byte of the return value.
195             \li the halved addition of the third bytes in each operand, in the third byte of the return value.
196             \li the halved addition of the fourth bytes in each operand, in the fourth byte of the return value.
197
198     \par
199             The results are saturated to the 8-bit unsigned integer range 0 \< x \< 2<sup>8</sup> - 1.
200
201     \par Operation:
202         \code
203    res[7:0]   = val1[7:0]   + val2[7:0]
204    res[15:8]  = val1[15:8]  + val2[15:8]
205    res[23:16] = val1[23:16] + val2[23:16]
206    res[31:24] = val1[31:24] + val2[31:24]
207         \endcode
208 */
209 uint32_t __UQADD8(uint32_t val1, uint32_t val2);
210
211
212 /**************************************************************************************************/
213 /**
214     \brief      Quad 8-bit unsigned addition with halved results
215
216     \details    This function enables you to perform four unsigned 8-bit integer additions, halving the results.
217
218     \param      val1    first four 8-bit summands.
219     \param      val2    second four 8-bit summands.
220
221     \returns
222             \li the halved addition of the first bytes in each operand, in the first byte of the return value.
223             \li the halved addition of the second bytes in each operand, in the second byte of the return value.
224             \li the halved addition of the third bytes in each operand, in the third byte of the return value.
225             \li the halved addition of the fourth bytes in each operand, in the fourth byte of the return value.
226
227     \par Operation:
228         \code
229    res[7:0]   = val1[7:0]   + val2[7:0]   >> 1
230    res[15:8]  = val1[15:8]  + val2[15:8]  >> 1
231    res[23:16] = val1[23:16] + val2[23:16] >> 1
232    res[31:24] = val1[31:24] + val2[31:24] >> 1
233         \endcode
234 */
235 uint32_t __UHADD8(uint32_t val1, uint32_t val2);
236
237
238 /**************************************************************************************************/
239 /**
240     \brief      GE setting quad 8-bit signed subtraction
241
242     \details    This function enables you to perform four 8-bit signed integer subtractions.<br>
243                 The GE bits in the APSR are set according to the results.
244
245     \param      val1    first four 8-bit  operands of each subtraction.
246     \param      val2    second four 8-bit  operands of each subtraction.
247
248     \returns
249             \li the subtraction of the first byte in the second operand from the first byte in the
250                 first operand, in the first bytes of the return value.
251             \li the subtraction of the second byte in the second operand from the second byte in
252                 the first operand, in the second byte of the return value.
253             \li the subtraction of the third byte in the second operand from the third byte in the
254                 first operand, in the third byte of the return value.
255             \li the subtraction of the fourth byte in the second operand from the fourth byte in
256                 the first operand, in the fourth byte of the return value.
257
258         \par    Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
259              the results of the operation.
260
261         \par
262             If \em res is the return value, then:
263             \li if res[8:0] \>= 0 then APSR.GE[0] = 1 else 0
264             \li if res[15:8] \>= 0 then APSR.GE[1] = 1 else 0
265             \li if res[23:16] \>= 0 then APSR.GE[2] = 1 else 0
266             \li if res[31:24] \>= 0 then APSR.GE[3] = 1 else 0
267
268
269     \par Operation:
270         \code
271    res[7:0]   = val1[7:0]   - val2[7:0]
272    res[15:8]  = val1[15:8]  - val2[15:8]
273    res[23:16] = val1[23:16] - val2[23:16]
274    res[31:24] = val1[31:24] - val2[31:24]
275         \endcode
276 */
277 uint32_t __SSUB8(uint32_t val1, uint32_t val2);
278
279
280 /**************************************************************************************************/
281 /**
282     \brief      Q setting quad 8-bit saturating subtract
283
284     \details    This function enables you to perform four 8-bit integer subtractions, saturating the results
285           to the 8-bit signed integer range -2<sup>7</sup> \<= x \<= 2<sup>7</sup> - 1.
286
287     \param      val1    first four 8-bit  operands.
288     \param      val2    second four 8-bit  operands.
289
290     \returns
291             \li the subtraction of the first byte in the second operand from the first byte in the
292                 first operand, in the first bytes of the return value.
293             \li the subtraction of the second byte in the second operand from the second byte in
294                 the first operand, in the second byte of the return value.
295             \li the subtraction of the third byte in the second operand from the third byte in the
296                 first operand, in the third byte of the return value.
297             \li the subtraction of the fourth byte in the second operand from the fourth byte in
298                 the first operand, in the fourth byte of the return value.
299
300         \par
301             The returned results are saturated to the 8-bit signed integer range -2<sup>7</sup> \<= x \<= 2<sup>7</sup> - 1.
302
303
304     \par Operation:
305         \code
306    res[7:0]   = val1[7:0]   - val2[7:0]
307    res[15:8]  = val1[15:8]  - val2[15:8]
308    res[23:16] = val1[23:16] - val2[23:16]
309    res[31:24] = val1[31:24] - val2[31:24]
310         \endcode
311 */
312 uint32_t __QSUB8(uint32_t val1, uint32_t val2);
313
314
315 /**************************************************************************************************/
316 /**
317     \brief      Quad 8-bit signed subtraction with halved results
318
319     \details    This function enables you to perform four signed 8-bit integer subtractions, halving the
320      results.
321
322     \param      val1    first four 8-bit  operands.
323     \param      val2    second four 8-bit  operands.
324
325     \returns
326             \li the halved subtraction of the first byte in the second operand from the first byte in the
327                 first operand, in the first bytes of the return value.
328             \li the halved subtraction of the second byte in the second operand from the second byte in
329                 the first operand, in the second byte of the return value.
330             \li the halved subtraction of the third byte in the second operand from the third byte in the
331                 first operand, in the third byte of the return value.
332             \li the halved subtraction of the fourth byte in the second operand from the fourth byte in
333                 the first operand, in the fourth byte of the return value.
334
335     \par Operation:
336         \code
337    res[7:0]   = val1[7:0]   - val2[7:0]   >> 1
338    res[15:8]  = val1[15:8]  - val2[15:8]  >> 1
339    res[23:16] = val1[23:16] - val2[23:16] >> 1
340    res[31:24] = val1[31:24] - val2[31:24] >> 1
341         \endcode
342 */
343 uint32_t __SHSUB8(uint32_t val1, uint32_t val2);
344
345
346 /**************************************************************************************************/
347 /**
348     \brief      GE setting quad 8-bit unsigned subtract
349
350     \details    This function enables you to perform four 8-bit unsigned integer subtractions.
351           The GE bits in the APSR are set according to the results.
352
353     \param      val1    first four 8-bit  operands.
354     \param      val2    second four 8-bit  operands.
355
356     \returns
357             \li the subtraction of the first byte in the second operand from the first byte in the
358                 first operand, in the first bytes of the return value.
359             \li the subtraction of the second byte in the second operand from the second byte in
360                 the first operand, in the second byte of the return value.
361             \li the subtraction of the third byte in the second operand from the third byte in the
362                 first operand, in the third byte of the return value.
363             \li the subtraction of the fourth byte in the second operand from the fourth byte in
364                 the first operand, in the fourth byte of the return value.
365
366     \par
367         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
368              the results of the operation.
369
370     \par
371         If \em res is the return value, then:
372             \li if res[8:0] \>= 0 then APSR.GE[0] = 1 else 0
373             \li if res[15:8] \>= 0 then APSR.GE[1] = 1 else 0
374             \li if res[23:16] \>= 0 then APSR.GE[2] = 1 else 0
375             \li if res[31:24] \>= 0 then APSR.GE[3] = 1 else 0
376
377
378     \par Operation:
379         \code
380    res[7:0]   = val1[7:0]   - val2[7:0]
381    res[15:8]  = val1[15:8]  - val2[15:8]
382    res[23:16] = val1[23:16] - val2[23:16]
383    res[31:24] = val1[31:24] - val2[31:24]
384         \endcode
385 */
386 uint32_t __USUB8(uint32_t val1, uint32_t val2);
387
388
389 /**************************************************************************************************/
390 /**
391     \brief      Quad 8-bit unsigned saturating subtraction
392
393     \details    This function enables you to perform four unsigned 8-bit integer subtractions, saturating
394           the results to the 8-bit unsigned integer range 0 \< x \< 2<sup>8</sup> - 1.
395
396     \param      val1    first four 8-bit  operands.
397     \param      val2    second four 8-bit  operands.
398
399     \returns
400             \li the subtraction of the first byte in the second operand from the first byte in the
401                 first operand, in the first bytes of the return value.
402             \li the subtraction of the second byte in the second operand from the second byte in
403                 the first operand, in the second byte of the return value.
404             \li the subtraction of the third byte in the second operand from the third byte in the
405                 first operand, in the third byte of the return value.
406             \li the subtraction of the fourth byte in the second operand from the fourth byte in
407                 the first operand, in the fourth byte of the return value.
408
409     \par
410         The results are saturated to the 8-bit unsigned integer range 0 \< x \< 2<sup>8</sup> - 1.
411
412
413     \par Operation:
414         \code
415    res[7:0]   = val1[7:0]   - val2[7:0]
416    res[15:8]  = val1[15:8]  - val2[15:8]
417    res[23:16] = val1[23:16] - val2[23:16]
418    res[31:24] = val1[31:24] - val2[31:24]
419         \endcode
420 */
421 uint32_t __UQSUB8(uint32_t val1, uint32_t val2);
422
423
424 /**************************************************************************************************/
425 /**
426     \brief      Quad 8-bit unsigned subtraction with halved results
427
428     \details    This function enables you to perform four unsigned 8-bit integer subtractions, halving the
429      results.
430
431     \param      val1    first four 8-bit  operands.
432     \param      val2    second four 8-bit  operands.
433
434     \returns
435             \li the halved subtraction of the first byte in the second operand from the first byte in the
436                 first operand, in the first bytes of the return value.
437             \li the halved subtraction of the second byte in the second operand from the second byte in
438                 the first operand, in the second byte of the return value.
439             \li the halved subtraction of the third byte in the second operand from the third byte in the
440                 first operand, in the third byte of the return value.
441             \li the halved subtraction of the fourth byte in the second operand from the fourth byte in
442                 the first operand, in the fourth byte of the return value.
443
444     \par Operation:
445         \code
446    res[7:0]   = val1[7:0]   - val2[7:0]    >> 1
447    res[15:8]  = val1[15:8]  - val2[15:8]   >> 1
448    res[23:16] = val1[23:16] - val2[23:16]  >> 1
449    res[31:24] = val1[31:24] - val2[31:24]  >> 1
450         \endcode
451 */
452 uint32_t __UHSUB8(uint32_t val1, uint32_t val2);
453
454
455 /**************************************************************************************************/
456 /**
457     \brief      GE setting dual 16-bit signed addition
458
459     \details    This function enables you to perform two 16-bit signed integer additions.<br>
460           The GE bits in the APSR are set according to the results of the additions.
461
462     \param      val1    first two 16-bit  summands.
463     \param      val2    second two 16-bit  summands.
464
465     \returns
466             \li the addition of the low halfwords in the low halfword of the return value.
467             \li the addition of the high halfwords in the high halfword of the return value.
468
469     \par
470         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
471              the results of the operation.
472     \par
473         If \em res is the return value, then:
474             \li if res[15:0] \>= 0 then APSR.GE[1:0] = 11 else 00
475             \li if res[31:16] \>= 0 then APSR.GE[3:2] = 11 else 00
476
477
478     \par Operation:
479         \code
480    res[15:0]  = val1[15:0]  + val2[15:0]
481    res[31:16] = val1[31:16] + val2[31:16]
482         \endcode
483 */
484 uint32_t __SADD16(uint32_t val1, uint32_t val2);
485
486
487 /**************************************************************************************************/
488 /**
489     \brief      Q setting dual 16-bit saturating addition
490
491     \details    This function enables you to perform two 16-bit integer arithmetic additions in parallel,
492           saturating the results to the 16-bit signed integer range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
493
494     \param      val1    first two 16-bit  summands.
495     \param      val2    second two 16-bit  summands.
496
497     \returns
498             \li the saturated addition of the low halfwords, in the low halfword of the return value.
499             \li the saturated addition of the high halfwords, in the high halfword of the return value.
500
501     \par
502         The returned results are saturated to the 16-bit signed integer
503              range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1
504
505     \par Operation:
506         \code
507    res[15:0]  = val1[15:0]  + val2[15:0]
508    res[31:16] = val1[31:16] + val2[31:16]
509         \endcode
510 */
511 uint32_t __QADD16(uint32_t val1, uint32_t val2);
512
513
514 /**************************************************************************************************/
515 /**
516     \brief      Dual 16-bit signed addition with halved results
517
518     \details    This function enables you to perform two signed 16-bit integer additions, halving the
519      results.
520
521     \param      val1    first two 16-bit  summands.
522     \param      val2    second two 16-bit  summands.
523
524     \returns
525             \li the halved addition of the low halfwords, in the low halfword of the return value.
526             \li the halved addition of the high halfwords, in the high halfword of the return value.
527
528     \par Operation:
529         \code
530    res[15:0]  = val1[15:0]  + val2[15:0]  >> 1
531    res[31:16] = val1[31:16] + val2[31:16] >> 1
532         \endcode
533 */
534 uint32_t __SHADD16(uint32_t val1, uint32_t val2);
535
536
537 /**************************************************************************************************/
538 /**
539     \brief      GE setting dual 16-bit unsigned addition
540
541     \details    This function enables you to perform two 16-bit unsigned integer additions.<br>
542           The GE bits in the APSR are set according to the results.
543
544     \param      val1    first two 16-bit  summands for each addition.
545     \param      val2    second two 16-bit  summands for each addition.
546
547     \returns
548             \li the addition of the low halfwords in each operand, in the low halfword of the
549                 return value.
550             \li the addition of the high halfwords in each operand, in the high halfword of the
551                 return value.
552
553     \par
554         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
555              the results of the operation.
556     \par
557         If \em res is the return value, then:
558             \li if res[15:0] \>= 0x10000 then APSR.GE[0] = 11 else 00
559             \li if res[31:16] \>= 0x10000 then APSR.GE[1] = 11 else 00
560
561     \par Operation:
562         \code
563    res[15:0]  = val1[15:0]  + val2[15:0]
564    res[31:16] = val1[31:16] + val2[31:16]
565         \endcode
566 */
567 uint32_t __UADD16(uint32_t val1, uint32_t val2);
568
569
570 /**************************************************************************************************/
571 /**
572     \brief      Dual 16-bit unsigned saturating addition
573
574     \details    This function enables you to perform two unsigned 16-bit integer additions, saturating the
575      results to the 16-bit unsigned integer range 0 \< x \< 2<sup>16</sup> - 1.
576
577     \param      val1    first two 16-bit  summands.
578     \param      val2    second two 16-bit  summands.
579
580     \returns
581             \li the addition of the low halfword in the first operand and the low halfword in the
582                 second operand, in the low halfword of the return value.
583             \li the addition of the high halfword in the first operand and the high halfword in the
584                 second operand, in the high halfword of the return value.
585
586     \par
587         The results are saturated to the 16-bit unsigned integer
588              range 0 \< x \< 2<sup>16</sup> - 1.
589
590     \par Operation:
591         \code
592    res[15:0]  = val1[15:0]  + val2[15:0]
593    res[31:16] = val1[31:16] + val2[31:16]
594         \endcode
595 */
596 uint32_t __UQADD16(uint32_t val1, uint32_t val2);
597
598
599 /**************************************************************************************************/
600 /**
601     \brief      Dual 16-bit unsigned addition with halved results
602
603     \details    This function enables you to perform two unsigned 16-bit integer additions, halving the
604      results.
605
606     \param      val1    first two 16-bit  summands.
607     \param      val2    second two 16-bit  summands.
608
609     \returns
610             \li the halved addition of the low halfwords in each operand, in the low halfword of
611                 the return value.
612             \li the halved addition of the high halfwords in each operand, in the high halfword
613                 of the return value.
614
615     \par Operation:
616         \code
617    res[15:0]  = val1[15:0]  + val2[15:0]   >> 1
618    res[31:16] = val1[31:16] + val2[31:16]  >> 1
619         \endcode
620 */
621 uint32_t __UHADD16(uint32_t val1, uint32_t val2);
622
623
624 /**************************************************************************************************/
625 /**
626     \brief      GE setting dual 16-bit signed subtraction
627
628     \details    This function enables you to perform two 16-bit signed integer subtractions.<br>
629           The GE bits in the APSR are set according to the results.
630
631     \param      val1    first two 16-bit operands of each subtraction.
632     \param      val2    second two 16-bit operands of each subtraction.
633
634     \returns
635             \li the subtraction of the low halfword in the second operand from the low halfword
636                 in the first operand, in the low halfword of the return value.
637             \li the subtraction of the high halfword in the second operand from the high halfword
638                 in the first operand, in the high halfword of the return value.
639
640     \par
641         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
642              the results of the operation.
643     \par
644         If \li res is the return value, then:
645             \li if res[15:0] \>= 0 then APSR.GE[1:0] = 11 else 00
646             \li if res[31:16] \>= 0 then APSR.GE[3:2] = 11 else 00
647
648
649     \par Operation:
650         \code
651    res[15:0]  = val1[15:0]  - val2[15:0]
652    res[31:16] = val1[31:16] - val2[31:16]
653         \endcode
654 */
655 uint32_t __SSUB16(uint32_t val1, uint32_t val2);
656
657
658 /**************************************************************************************************/
659 /**
660     \brief      Q setting dual 16-bit saturating subtract
661
662     \details    This function enables you to perform two 16-bit integer subtractions, saturating the
663           results to the 16-bit signed integer range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
664
665     \param      val1    first two 16-bit operands.
666     \param      val2    second two 16-bit operands.
667
668     \returns
669             \li the saturated subtraction of the low halfword in the second operand from the low
670                 halfword in the first operand, in the low halfword of the returned result.
671             \li the saturated subtraction of the high halfword in the second operand from the high
672                 halfword in the first operand, in the high halfword of the returned result.
673
674     \par
675         The returned results are saturated to the 16-bit signed integer
676              range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
677
678     \par Operation:
679         \code
680    res[15:0]  = val1[15:0]  - val2[15:0]
681    res[31:16] = val1[31:16] - val2[31:16]
682         \endcode
683 */
684 uint32_t __QSUB16(uint32_t val1, uint32_t val2);
685
686
687 /**************************************************************************************************/
688 /**
689     \brief      Dual 16-bit signed subtraction with halved results
690
691     \details    This function enables you to perform two signed 16-bit integer subtractions, halving the
692           results.
693
694     \param      val1    first two 16-bit operands.
695     \param      val2    second two 16-bit operands.
696
697     \returns
698             \li the halved subtraction of the low halfword in the second operand from the low
699                 halfword in the first operand, in the low halfword of the returned result.
700             \li the halved subtraction of the high halfword in the second operand from the high
701                 halfword in the first operand, in the high halfword of the returned result.
702
703
704     \par Operation:
705         \code
706    res[15:0]  = val1[15:0]  - val2[15:0]   >> 1
707    res[31:16] = val1[31:16] - val2[31:16]  >> 1
708         \endcode
709 */
710 uint32_t __SHSUB16(uint32_t val1, uint32_t val2);
711
712
713 /**************************************************************************************************/
714 /**
715     \brief      GE setting dual 16-bit unsigned subtract
716
717     \details    This function enables you to perform two 16-bit unsigned integer subtractions.<br>
718           The GE bits in the APSR are set according to the results.
719
720     \param      val1    first two 16-bit operands.
721     \param      val2    second two 16-bit operands.
722
723     \returns
724             \li the subtraction of the low halfword in the second operand from the low halfword
725                 in the first operand, in the low halfword of the return value.
726             \li the subtraction of the high halfword in the second operand from the high halfword
727                 in the first operand, in the high halfword of the return value.
728
729     \par
730         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
731              the results of the operation.
732
733     \par
734         If \em res is the return value, then:
735             \li if res[15:0] \>= 0 then APSR.GE[1:0] = 11 else 00
736             \li if res[31:16] \>= 0 then APSR.GE[3:2] = 11 else 00
737
738     \par Operation:
739         \code
740    res[15:0]  = val1[15:0]  - val2[15:0]
741    res[31:16] = val1[31:16] - val2[31:16]
742         \endcode
743 */
744 uint32_t __USUB16(uint32_t val1, uint32_t val2);
745
746
747 /**************************************************************************************************/
748 /**
749     \brief      Dual 16-bit unsigned saturating subtraction
750
751     \details    This function enables you to perform two unsigned 16-bit integer subtractions, saturating
752           the results to the 16-bit unsigned integer range 0 \< x \< 2<sup>16</sup> - 1.
753
754     \param      val1    first two 16-bit operands for each subtraction.
755     \param      val2    second two 16-bit operands for each subtraction.
756
757     \returns
758             \li the subtraction of the low halfword in the second operand from the low halfword
759                 in the first operand, in the low halfword of the return value.
760             \li the subtraction of the high halfword in the second operand from the high halfword
761                 in the first operand, in the high halfword of the return value.
762
763     \par
764             The results are saturated to the 16-bit unsigned integer range 0 \< x \< 2<sup>16</sup> - 1.
765
766
767     \par Operation:
768         \code
769    res[15:0]  = val1[15:0]  - val2[15:0]
770    res[31:16] = val1[31:16] - val2[31:16]
771         \endcode
772 */
773 uint32_t __UQSUB16(uint32_t val1, uint32_t val2);
774
775
776 /**************************************************************************************************/
777 /**
778     \brief      Dual 16-bit unsigned subtraction with halved results
779
780     \details    This function enables you to perform two unsigned 16-bit integer subtractions, halving
781           the results.
782
783     \param      val1    first two 16-bit operands.
784     \param      val2    second two 16-bit operands.
785
786     \returns
787             \li the halved subtraction of the low halfword in the second operand from the low halfword
788                 in the first operand, in the low halfword of the return value.
789             \li the halved subtraction of the high halfword in the second operand from the high halfword
790                 in the first operand, in the high halfword of the return value.
791
792
793     \par Operation:
794         \code
795    res[15:0]  = val1[15:0]  - val2[15:0]   >> 1
796    res[31:16] = val1[31:16] - val2[31:16]  >> 1
797         \endcode
798 */
799 uint32_t __UHSUB16(uint32_t val1, uint32_t val2);
800
801
802 /**************************************************************************************************/
803 /**
804     \brief      GE setting dual 16-bit addition and subtraction with exchange
805
806     \details    This function inserts an SASX instruction into the instruction stream generated by the
807           compiler. It enables you to exchange the halfwords of the second operand, add the high
808           halfwords and subtract the low halfwords.<br>
809           The GE bits in the APRS are set according to the results.
810
811     \param      val1    first operand for the subtraction in the low halfword, and the
812               first operand for the addition in the high halfword.
813     \param      val2    second operand for the subtraction in the high halfword, and the
814               second operand for the addition in the low halfword.
815
816     \returns
817             \li the subtraction of the high halfword in the second operand from the low halfword
818                 in the first operand, in the low halfword of the return value.
819             \li the addition of the high halfword in the first operand and the low halfword in the
820                 second operand, in the high halfword of the return value.
821
822     \par
823         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
824              the results of the operation.
825     \par
826         If \em res is the return value, then:
827             \li if res[15:0] \>= 0 then APSR.GE[1:0] = 11 else 00
828             \li if res[31:16] \>= 0 then APSR.GE[3:2] = 11 else 00
829
830     \par Operation:
831         \code
832    res[15:0]  = val1[15:0]  - val2[31:16]
833    res[31:16] = val1[31:16] + val2[15:0]
834         \endcode
835 */
836 uint32_t __SASX(uint32_t val1, uint32_t val2);
837
838
839 /**************************************************************************************************/
840 /**
841     \brief      Q setting dual 16-bit add and subtract with exchange
842
843     \details    This function enables you to exchange the halfwords of the one operand, then add the high
844           halfwords and subtract the low halfwords, saturating the results to the 16-bit signed
845           integer range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
846
847     \param      val1    first operand for the subtraction in the low halfword, and the
848                        first operand for the addition in the high halfword.
849     \param      val2    second operand for the subtraction in the high halfword, and the
850                        second operand for the addition in the low halfword.
851
852     \returns
853             \li the saturated subtraction of the high halfword in the second operand from the low
854                 halfword in the first operand, in the low halfword of the return value.
855             \li the saturated addition of the high halfword in the first operand and the low
856                 halfword in the second operand, in the high halfword of the return value.
857
858     \par
859         The returned results are saturated to the 16-bit signed integer
860              range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
861
862     \par Operation:
863         \code
864    res[15:0]  = val1[15:0]  - val2[31:16]
865    res[31:16] = val1[31:16] + val2[15:0]
866         \endcode
867 */
868 uint32_t __QASX(uint32_t val1, uint32_t val2);
869
870
871 /**************************************************************************************************/
872 /**
873     \brief      Dual 16-bit signed addition and subtraction with halved results
874
875     \details    This function enables you to exchange the two halfwords of one operand, perform one
876           signed 16-bit integer addition and one signed 16-bit subtraction, and halve the results.
877
878     \param      val1    first 16-bit operands.
879     \param      val2    second 16-bit operands.
880
881     \returns
882             \li the halved subtraction of the high halfword in the second operand from the low
883                 halfword in the first operand, in the low halfword of the return value.
884             \li the halved addition of the low halfword in the second operand and the high
885                 halfword in the first operand, in the high halfword of the return value.
886
887     \par Operation:
888         \code
889    res[15:0]  = (val1[15:0]  - val2[31:16]) >> 1
890    res[31:16] = (val1[31:16] + val2[15:0] ) >> 1
891         \endcode
892 */
893 uint32_t __SHASX(uint32_t val1, uint32_t val2);
894
895
896 /**************************************************************************************************/
897 /**
898     \brief      GE setting dual 16-bit unsigned addition and subtraction with exchange
899
900     \details    This function enables you to exchange the two halfwords of the second operand, add the
901           high halfwords and subtract the low halfwords.<br>
902           The GE bits in the APSR are set according to the results.
903
904     \param      val1    first operand for the subtraction in the low halfword, and the
905               first operand for the addition in the high halfword.
906     \param      val2    second operand for the subtraction in the high halfword and the
907               second operand for the addition in the low halfword.
908
909     \returns
910             \li the subtraction of the high halfword in the second operand from the low halfword
911                 in the first operand, in the low halfword of the return value.
912             \li the addition of the high halfword in the first operand and the low halfword in the
913                 second operand, in the high halfword of the return value.
914
915     \par
916             Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
917              the results of the operation.
918
919     \par    If \em res is the return value, then:
920             \li if res[15:0] \>= 0 then APSR.GE[1:0] = 11 else 00
921             \li if res[31:16] \>= 0x10000 then APSR.GE[3:2] = 11 else 00
922
923     \par Operation:
924         \code
925    res[15:0]  = val1[15:0]  - val2[31:16]
926    res[31:16] = val1[31:16] + val2[15:0]
927         \endcode
928 */
929 uint32_t __UASX(uint32_t val1, uint32_t val2);
930
931
932 /**************************************************************************************************/
933 /**
934     \brief      Dual 16-bit unsigned saturating addition and subtraction with exchange
935
936     \details    This function enables you to exchange the halfwords of the second operand and perform
937           one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, saturating the
938           results to the 16-bit unsigned integer range 0 \<= x \<= 2<sup>16</sup> - 1.
939
940     \param      val1    first two 16-bit operands.
941     \param      val2    second two 16-bit operands.
942
943     \returns
944             \li the subtraction of the high halfword in the second operand from the low halfword
945                 in the first operand, in the low halfword of the return value.
946             \li the subtraction of the low halfword in the second operand from the high halfword
947                 in the first operand, in the high halfword of the return value.
948
949     \par
950             The results are saturated to the 16-bit unsigned integer
951              range 0 \<= x \<= 2<sup>16</sup> - 1.
952
953     \par Operation:
954         \code
955    res[15:0]  = val1[15:0]  - val2[31:16]
956    res[31:16] = val1[31:16] + val2[15:0]
957         \endcode
958 */
959 uint32_t __UQASX(uint32_t val1, uint32_t val2);
960
961
962 /**************************************************************************************************/
963 /**
964     \brief      Dual 16-bit unsigned addition and subtraction with halved results and exchange
965
966     \details    This function enables you to exchange the halfwords of the second operand, add the high
967           halfwords and subtract the low halfwords, halving the results.
968
969     \param      val1    first operand for the subtraction in the low halfword, and the
970            first operand for the addition in the high halfword.
971     \param      val2    second operand for the subtraction in the high halfword, and the
972            second operand for the addition in the low halfword.
973
974     \returns
975             \li the halved subtraction of the high halfword in the second operand from the low
976                 halfword in the first operand.
977             \li the halved addition of the high halfword in the first operand and the low halfword
978                 in the second operand.
979
980
981     \par Operation:
982         \code
983    res[15:0]  = (val1[15:0]  - val2[31:16]) >> 1
984    res[31:16] = (val1[31:16] + val2[15:0] ) >> 1
985         \endcode
986 */
987 uint32_t __UHASX(uint32_t val1, uint32_t val2);
988
989
990 /**************************************************************************************************/
991 /**
992     \brief      GE setting dual 16-bit signed subtraction and addition with exchange
993
994     \details    This function enables you to exchange the two halfwords of one operand and perform one
995           16-bit integer subtraction and one 16-bit addition.<br>
996           The GE bits in the APSR are set according to the results.
997
998     \param      val1    first operand for the addition in the low halfword, and the first
999               operand for the subtraction in the high halfword.
1000     \param      val2    second operand for the addition in the high halfword, and the
1001               second operand for the subtraction in the low halfword.
1002
1003     \returns
1004             \li the addition of the low halfword in the first operand and the high halfword in the
1005                 second operand, in the low halfword of the return value.
1006             \li the subtraction of the low halfword in the second operand from the high halfword
1007                 in the first operand, in the high halfword of the return value.
1008     \par
1009         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
1010              the results of the operation.
1011     \par
1012         If \em res is the return value, then:
1013             \li if res[15:0] \>= 0 then APSR.GE[1:0] = 11 else 00
1014             \li if res[31:16] \>= 0 then APSR.GE[3:2] = 11 else 00
1015
1016     \par Operation:
1017         \code
1018    res[15:0]  = val1[15:0]  + val2[31:16]
1019    res[31:16] = val1[31:16] - val2[15:0]
1020         \endcode
1021 */
1022 uint32_t __SSAX(uint32_t val1, uint32_t val2);
1023
1024
1025 /**************************************************************************************************/
1026 /**
1027     \brief      Q setting dual 16-bit subtract and add with exchange
1028
1029     \details    This function enables you to exchange the halfwords of one operand, then subtract the
1030           high halfwords and add the low halfwords, saturating the results to the 16-bit signed
1031           integer range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
1032
1033     \param      val1    first operand for the addition in the low halfword, and the first
1034            operand for the subtraction in the high halfword.
1035     \param      val2    second operand for the addition in the high halfword, and the
1036            second operand for the subtraction in the low halfword.
1037
1038     \returns
1039             \li the saturated addition of the low halfword of the first operand and the high
1040                 halfword of the second operand, in the low halfword of the return value.
1041             \li the saturated subtraction of the low halfword of the second operand from the high
1042                 halfword of the first operand, in the high halfword of the return value.
1043     \par
1044         The returned results are saturated to the 16-bit signed integer
1045              range -2<sup>15</sup> \<= x \<= 2<sup>15</sup> - 1.
1046
1047     \par Operation:
1048         \code
1049    res[15:0]  = val1[15:0]  + val2[31:16]
1050    res[31:16] = val1[31:16] - val2[15:0]
1051         \endcode
1052 */
1053 uint32_t __QSAX(uint32_t val1, uint32_t val2);
1054
1055
1056 /**************************************************************************************************/
1057 /**
1058     \brief      Dual 16-bit signed subtraction and addition with halved results
1059
1060     \details    This function enables you to exchange the two halfwords of one operand, perform one
1061           signed 16-bit integer subtraction and one signed 16-bit addition, and halve the results.
1062
1063     \param      val1    first 16-bit operands.
1064     \param      val2    second 16-bit operands.
1065
1066     \returns
1067             \li the halved addition of the low halfword in the first operand and the high halfword
1068                 in the second operand, in the low halfword of the return value.
1069             \li the halved subtraction of the low halfword in the second operand from the high
1070                 halfword in the first operand, in the high halfword of the return value.
1071
1072     \par Operation:
1073         \code
1074    res[15:0]  = (val1[15:0]  + val2[31:16]) >> 1
1075    res[31:16] = (val1[31:16] - val2[15:0] ) >> 1
1076         \endcode
1077 */
1078 uint32_t __SHSAX(uint32_t val1, uint32_t val2);
1079
1080
1081 /**************************************************************************************************/
1082 /**
1083     \brief      GE setting dual 16-bit unsigned subtract and add with exchange
1084
1085     \details    This function enables you to exchange the halfwords of the second operand, subtract the
1086           high halfwords and add the low halfwords.<br>
1087           The GE bits in the APSR are set according to the results.
1088
1089     \param      val1    first operand for the addition in the low halfword, and the first
1090               operand for the subtraction in the high halfword.
1091     \param      val2    second operand for the addition in the high halfword, and the
1092               second operand for the subtraction in the low halfword.
1093
1094     \returns
1095             \li the addition of the low halfword in the first operand and the high halfword in the
1096                 second operand, in the low halfword of the return value.
1097             \li the subtraction of the low halfword in the second operand from the high halfword
1098                 in the first operand, in the high halfword of the return value.
1099     \par
1100         Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
1101              the results of the operation.
1102     \par
1103         If \em res is the return value, then:
1104             \li if res[15:0] \>= 0x10000 then APSR.GE[1:0] = 11 else 00
1105             \li if res[31:16] \>= 0 then APSR.GE[3:2] = 11 else 00
1106
1107     \par Operation:
1108         \code
1109    res[15:0]  = val1[15:0]  + val2[31:16]
1110    res[31:16] = val1[31:16] - val2[15:0]
1111         \endcode
1112 */
1113 uint32_t __USAX(uint32_t val1, uint32_t val2);
1114
1115
1116 /**************************************************************************************************/
1117 /**
1118     \brief      Dual 16-bit unsigned saturating subtraction and addition with exchange
1119
1120     \details    This function enables you to exchange the halfwords of the second operand and perform
1121           one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, saturating the
1122           results to the 16-bit unsigned integer range 0 \<= x \<= 2<sup>16</sup> - 1.
1123
1124     \param      val1    first 16-bit operand for the addition in the low halfword, and the
1125               first 16-bit operand for the subtraction in the high halfword.
1126     \param      val2    second 16-bit halfword for the addition in the high halfword,
1127               and the second 16-bit halfword for the subtraction in the low halfword.
1128
1129     \returns
1130             \li the addition of the low halfword in the first operand and the high halfword in the
1131                 second operand, in the low halfword of the return value.
1132             \li the subtraction of the low halfword in the second operand from the high halfword
1133                 in the first operand, in the high halfword of the return value.
1134     \par
1135         The results are saturated to the 16-bit unsigned integer
1136              range 0 \<= x \<= 2<sup>16</sup> - 1.
1137
1138     \par Operation:
1139         \code
1140    res[15:0]  = val1[15:0]  + val2[31:16]
1141    res[31:16] = val1[31:16] - val2[15:0]
1142         \endcode
1143 */
1144 uint32_t __UQSAX(uint32_t val1, uint32_t val2);
1145
1146
1147 /**************************************************************************************************/
1148 /**
1149     \brief      Dual 16-bit unsigned subtraction and addition with halved results and exchange
1150
1151     \details    This function enables you to exchange the halfwords of the second operand, subtract the
1152           high halfwords and add the low halfwords, halving the results.
1153
1154     \param      val1    first operand for the addition in the low halfword, and the first
1155               operand for the subtraction in the high halfword.
1156     \param      val2    second operand for the addition in the high halfword, and the
1157               second operand for the subtraction in the low halfword.
1158
1159     \returns
1160             \li the halved addition of the high halfword in the second operand and the low
1161                 halfword in the first operand, in the low halfword of the return value.
1162             \li the halved subtraction of the low halfword in the second operand from the high
1163                 halfword in the first operand, in the high halfword of the return value.
1164
1165     \par Operation:
1166         \code
1167    res[15:0]  = (val1[15:0]  + val2[31:16]) >> 1
1168    res[31:16] = (val1[31:16] - val2[15:0] ) >> 1
1169         \endcode
1170 */
1171 uint32_t __UHSAX(uint32_t val1, uint32_t val2);
1172
1173
1174 /**************************************************************************************************/
1175 /**
1176     \brief      Unsigned sum of quad 8-bit unsigned absolute difference
1177
1178     \details    This function enables you to perform four unsigned 8-bit subtractions, and add the
1179           absolute values of the differences together, returning the result as a single unsigned
1180           integer.
1181
1182     \param      val1    first four 8-bit operands for the subtractions.
1183     \param      val2    second four 8-bit operands for the subtractions.
1184
1185     \returns
1186             \li the subtraction of the first byte in the second operand from the first byte in the
1187                 first operand.
1188             \li the subtraction of the second byte in the second operand from the second byte in
1189                 the first operand.
1190             \li the subtraction of the third byte in the second operand from the third byte in the
1191                 first operand.
1192             \li the subtraction of the fourth byte in the second operand from the fourth byte in
1193                 the first operand.
1194     \par
1195         The sum is returned as a single unsigned integer.
1196
1197
1198     \par Operation:
1199         \code
1200    absdiff1  = val1[7:0]   - val2[7:0]
1201    absdiff2  = val1[15:8]  - val2[15:8]
1202    absdiff3  = val1[23:16] - val2[23:16]
1203    absdiff4  = val1[31:24] - val2[31:24]
1204    res[31:0] = absdiff1 + absdiff2 + absdiff3 + absdiff4
1205         \endcode
1206 */
1207 uint32_t __USAD8(uint32_t val1, uint32_t val2);
1208
1209
1210 /**************************************************************************************************/
1211 /**
1212     \brief      Unsigned sum of quad 8-bit unsigned absolute difference with 32-bit accumulate
1213
1214     \details    This function enables you to perform four unsigned 8-bit subtractions, and add the
1215           absolute values of the differences to a 32-bit accumulate operand.
1216
1217     \param      val1    first four 8-bit operands for the subtractions.
1218     \param      val2    second four 8-bit operands for the subtractions.
1219     \param      val3    accumulation value.
1220
1221     \returns
1222         the sum of the absolute differences of the following
1223             bytes, added to the accumulation value:
1224             \li the subtraction of the first byte in the second operand from the first byte in the
1225                 first operand.
1226             \li the subtraction of the second byte in the second operand from the second byte in
1227                 the first operand.
1228             \li the subtraction of the third byte in the second operand from the third byte in the
1229                 first operand.
1230             \li the subtraction of the fourth byte in the second operand from the fourth byte in
1231                 the first operand.
1232
1233
1234     \par Operation:
1235         \code
1236    absdiff1  = val1[7:0]   - val2[7:0]
1237    absdiff2  = val1[15:8]  - val2[15:8]
1238    absdiff3  = val1[23:16] - val2[23:16]
1239    absdiff4  = val1[31:24] - val2[31:24]
1240    sum       = absdiff1 + absdiff2 + absdiff3 + absdiff4
1241    res[31:0] = sum[31:0] + val3[31:0]
1242         \endcode
1243 */
1244 uint32_t __USADA8(uint32_t val1, uint32_t val2, uint32_t val3);
1245
1246
1247 /**************************************************************************************************/
1248 /**
1249     \brief      Q setting dual 16-bit saturate
1250
1251     \details    This function enables you to saturate two signed 16-bit values to a selected signed range.<br>
1252           The Q bit is set if either operation saturates.
1253
1254     \param      val1    two signed 16-bit values to be saturated.
1255     \param      val2    bit position for saturation, an integral constant expression in the
1256               range 1 to 16.
1257
1258
1259     \returns
1260         the sum of the absolute differences of the following
1261             bytes, added to the accumulation value:
1262             \li the signed saturation of the low halfword in \em val1, saturated to the bit position
1263                 specified in \em val2 and returned in the low halfword of the return value.
1264             \li the signed saturation of the high halfword in <i>val1</i>, saturated to the bit position
1265                 specified in <i>val2</i> and returned in the high halfword of the return value.
1266
1267
1268     \par Operation:
1269         \code
1270    Saturate halfwords in val1 to the signed range specified by the bit position in val2
1271         \endcode
1272 */
1273 uint32_t __SSAT16(uint32_t val1, const uint32_t val2);
1274
1275
1276 /**************************************************************************************************/
1277 /**
1278     \brief      Q setting dual 16-bit unsigned saturate
1279
1280     \details    This function enables you to saturate two signed 16-bit values to a selected unsigned
1281          range.<br>
1282          The Q bit is set if either operation saturates.
1283
1284     \param      val1    two 16-bit values that are to be saturated.
1285     \param      val2    bit position for saturation, and must be an integral constant
1286            expression in the range 0 to 15.
1287
1288
1289     \returns
1290         the saturation of the two signed 16-bit values, as non-negative values.
1291             \li the saturation of the low halfword in \em val1, saturated to the bit position
1292                 specified in \em val2 and returned in the low halfword of the return value.
1293             \li the saturation of the high halfword in \em val1, saturated to the bit position
1294                 specified in \em val2 and returned in the high halfword of the return value.
1295
1296
1297     \par Operation:
1298         \code
1299    Saturate halfwords in val1 to the unsigned range specified by the bit position in val2
1300         \endcode
1301 */
1302 uint32_t __USAT16(uint32_t val1, const uint32_t val2);
1303
1304
1305 /**************************************************************************************************/
1306 /**
1307     \brief      Dual extract 8-bits and zero-extend to 16-bits
1308
1309     \details    This function enables you to extract two 8-bit values from an operand and zero-extend
1310           them to 16 bits each.
1311
1312     \param      val     two 8-bit values in val[7:0] and val[23:16] to be sign-extended.
1313
1314
1315     \returns
1316         the 8-bit values zero-extended to 16-bit values.
1317             \li zero-extended value of val[7:0] in the low halfword of the return value.
1318             \li zero-extended value of val[23:16] in the high halfword of the return value.
1319
1320
1321     \par Operation:
1322         \code
1323    res[15:0]  = ZeroExtended(val[7:0]  )
1324    res[31:16] = ZeroExtended(val[23:16])
1325         \endcode
1326 */
1327 uint32_t __UXTB16(uint32_t val);
1328
1329
1330 /**************************************************************************************************/
1331 /**
1332     \brief      Extracted 16-bit to 32-bit unsigned addition
1333
1334     \details    This function enables you to extract two 8-bit values from one operand, zero-extend them
1335           to 16 bits each, and add the results to two 16-bit values from another operand.
1336
1337     \param      val1    value added to the zero-extended to 16-bit values.
1338     \param      val2    two 8-bit values to be extracted and zero-extended.
1339
1340
1341     \returns
1342         the 8-bit values in \em val2, zero-extended to 16-bit values
1343             and added to \em val1.
1344
1345
1346     \par Operation:
1347         \code
1348    res[15:0]  = ZeroExt(val2[7:0]   to 16 bits) + val1[15:0]
1349    res[31:16] = ZeroExt(val2[31:16] to 16 bits) + val1[31:16]
1350         \endcode
1351 */
1352 uint32_t __UXTAB16(uint32_t val1, uint32_t val2);
1353
1354
1355 /**************************************************************************************************/
1356 /**
1357     \brief      Dual extract 8-bits and sign extend each to 16-bits
1358
1359     \details    This function enables you to extract two 8-bit values from an operand and sign-extend
1360           them to 16 bits each.
1361
1362     \param      val     two 8-bit values in val[7:0] and val[23:16] to be sign-extended.
1363
1364
1365
1366     \returns
1367         the 8-bit values sign-extended to 16-bit values.
1368             \li     sign-extended value of val[7:0] in the low halfword of the return value.
1369             \li     sign-extended value of val[23:16] in the high halfword of the return value.
1370
1371
1372     \par Operation:
1373         \code
1374    res[15:0]  = SignExtended(val[7:0]
1375    res[31:16] = SignExtended(val[23:16]
1376         \endcode
1377 */
1378 uint32_t __SXTB16(uint32_t val);
1379
1380
1381 /**************************************************************************************************/
1382 /**
1383     \brief      Rotate right, dual extract 8-bits and sign extend each to 16-bits
1384
1385     \details    This function enables you to rotate an operand by 8/16/24 bit, extract two 8-bit values and sign-extend
1386           them to 16 bits each.
1387
1388     \param      val     two 8-bit values in val[7:0] and val[23:16] to be sign-extended.
1389     \param      rotate  number of bits to rotate val. Constant rotate value of 8, 16 and 24 can be
1390                         optimally used with a single __SXTB16 instruction. Any other valid constant rotate
1391                         value will result in use of two instructions, __ROR and __SXTB16
1392
1393
1394     \returns
1395         the 8-bit values sign-extended to 16-bit values.
1396             \li     sign-extended value of val[7:0] in the low halfword of the return value.
1397             \li     sign-extended value of val[23:16] in the high halfword of the return value.
1398
1399
1400     \par Operation:
1401         \code
1402    val        = Rotate(val, rotate)
1403    res[15:0]  = SignExtended(val[7:0])
1404    res[31:16] = SignExtended(val[23:16])
1405         \endcode
1406 */
1407 uint32_t __SXTB16_RORn(uint32_t val, uint32_r rotate);
1408
1409
1410 /**************************************************************************************************/
1411 /**
1412     \brief      Dual extracted 8-bit to 16-bit signed addition
1413
1414     \details    This function enables you to extract two 8-bit values from the second operand (at bit
1415           positions [7:0] and [23:16]), sign-extend them to 16-bits each, and add the results to the
1416           first operand.
1417
1418     \param      val1    values added to the zero-extended to 16-bit values.
1419     \param      val2    two 8-bit values to be extracted and zero-extended.
1420
1421
1422
1423     \returns
1424         the addition of \em val1 and \em val2, where the 8-bit values in
1425             val2[7:0] and val2[23:16] have been extracted and sign-extended prior to the addition.
1426
1427
1428     \par Operation:
1429         \code
1430    res[15:0]  = val1[15:0]  + SignExtended(val2[7:0])
1431    res[31:16] = val1[31:16] + SignExtended(val2[23:16])
1432     \endcode
1433 */
1434 uint32_t __SXTAB16(uint32_t val1, uint32_t val2);
1435
1436
1437 /**************************************************************************************************/
1438 /**
1439     \brief      Rotate right, followed by sign extension of two 8-bits with add to 16-bits
1440
1441     \details    This function enables you to rotate the second operand by 8/16/24 bit as specified by the third
1442           operand, extract two 8-bit values from the rotated result (at bit positions [7:0] and [23:16]),
1443           sign-extend them to 16-bits each, and add the results to the first operand.
1444
1445     \param      val1    two 16-bit values in val1[15:0] and val1[31:16]
1446     \param      val2    two 8-bit values in val[7:0] and val[23:16] to be sign-extended post rotation
1447     \param      rotate  number of bits to rotate val2. Constant rotate value of 8, 16 and 24 can be
1448                         optimally used with a single __SXTAB16 instruction. Any other valid constant rotate
1449                         value will result in use of two instructions, __ROR and __SXTAB16
1450
1451
1452     \returns
1453         the addition of \em val1 and \em val2, where the rotated 8-bit values in
1454             val2[7:0] and val2[23:16] have been extracted and sign-extended prior to the addition.
1455
1456
1457     \par Operation:
1458         \code
1459    val2       = Rotate(val2, rotate)
1460    res[15:0]  = val1[15:0]  + SignExtended(val2[7:0])
1461    res[31:16] = val1[31:16] + SignExtended(val2[23:16])
1462         \endcode
1463 */
1464 uint32_t __SXTAB16_RORn(uint32_t val1, uint32_t val2, uint32_r rotate);
1465
1466
1467 /**************************************************************************************************/
1468 /**
1469     \brief      Q setting sum of dual 16-bit signed multiply
1470
1471     \details    This function enables you to perform two 16-bit signed multiplications, adding the
1472           products together.<br>
1473           The Q bit is set if the addition overflows.
1474
1475     \param      val1    first 16-bit operands for each multiplication.
1476     \param      val2    second 16-bit operands for each multiplication.
1477
1478
1479
1480     \returns
1481         the sum of the products of the two 16-bit signed multiplications.
1482
1483
1484     \par Operation:
1485         \code
1486    p1 = val1[15:0]  * val2[15:0]
1487    p2 = val1[31:16] * val2[31:16]
1488    res[31:0] = p1 + p2
1489     \endcode
1490 */
1491 uint32_t __SMUAD(uint32_t val1, uint32_t val2);
1492
1493
1494 /**************************************************************************************************/
1495 /**
1496     \brief      Q setting sum of dual 16-bit signed multiply with exchange
1497
1498     \details    This function enables you to perform two 16-bit signed multiplications with exchanged
1499           halfwords of the second operand, adding the products together.<br>
1500           The Q bit is set if the addition overflows.
1501
1502     \param      val1    first 16-bit operands for each multiplication.
1503     \param      val2    second 16-bit operands for each multiplication.
1504
1505
1506
1507     \returns
1508         the sum of the products of the two 16-bit signed multiplications with exchanged
1509             halfwords of the second operand.
1510
1511
1512     \par Operation:
1513         \code
1514    p1 = val1[15:0]  * val2[31:16]
1515    p2 = val1[31:16] * val2[15:0]
1516    res[31:0] = p1 + p2
1517     \endcode
1518 */
1519 uint32_t __SMUADX(uint32_t val1, uint32_t val2);
1520
1521
1522 /**************************************************************************************************/
1523 /**
1524     \brief      32-bit signed multiply with 32-bit truncated accumulator.
1525
1526     \details    This function enables you to perform a signed 32-bit multiplications, adding the most significant 32 bits
1527                     of the 64-bit result to a 32-bit accumulate operand.<br>
1528
1529     \param      val1    first operand for multiplication.
1530     \param      val2    second operand for multiplication.
1531     \param      val3    accumulate value.
1532
1533
1534     \returns    the product of multiplication (most significant 32 bits) is added to the accumulate
1535             value, as a 32-bit integer.
1536
1537      \par Operation:
1538         \code
1539    p = val1 * val2
1540    res[31:0] = p[61:32] + val3[31:0]
1541     \endcode
1542 */
1543 uint32_t __SMMLA (int32_t val1, int32_t val2, int32_t val3);
1544
1545
1546 /**************************************************************************************************/
1547 /**
1548     \brief      Q setting dual 16-bit signed multiply with single 32-bit accumulator
1549
1550     \details    This function enables you to perform two signed 16-bit multiplications, adding both
1551           results to a 32-bit accumulate operand.<br>
1552           The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications.
1553
1554     \param      val1    first 16-bit operands for each multiplication.
1555     \param      val2    second 16-bit operands for each multiplication.
1556     \param      val3    accumulate value.
1557
1558
1559     \returns
1560         the product of each multiplication added to the accumulate
1561             value, as a 32-bit integer.
1562
1563
1564     \par Operation:
1565         \code
1566    p1 = val1[15:0]  * val2[15:0]
1567    p2 = val1[31:16] * val2[31:16]
1568    res[31:0] = p1 + p2 + val3[31:0]
1569     \endcode
1570 */
1571 uint32_t __SMLAD(uint32_t val1, uint32_t val2, uint32_t val3);
1572
1573
1574 /**************************************************************************************************/
1575 /**
1576     \brief      Q setting pre-exchanged dual 16-bit signed multiply with single 32-bit accumulator
1577
1578     \details    This function enables you to perform two signed 16-bit multiplications with exchanged
1579           halfwords of the second operand, adding both results to a 32-bit accumulate operand.<br>
1580           The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications.
1581
1582     \param      val1    first 16-bit operands for each multiplication.
1583     \param      val2    second 16-bit operands for each multiplication.
1584     \param      val3    accumulate value.
1585
1586
1587     \returns
1588         the product of each multiplication with exchanged
1589             halfwords of the second operand added to the accumulate value, as a 32-bit integer.
1590
1591
1592     \par Operation:
1593         \code
1594    p1 = val1[15:0]  * val2[31:16]
1595    p2 = val1[31:16] * val2[15:0]
1596    res[31:0] = p1 + p2 + val3[31:0]
1597     \endcode
1598 */
1599 uint32_t __SMLADX(uint32_t val1, uint32_t val2, uint32_t val3);
1600
1601
1602 /**************************************************************************************************/
1603 /**
1604     \brief      Dual 16-bit signed multiply with single 64-bit accumulator
1605
1606     \details    This function enables you to perform two signed 16-bit multiplications, adding both
1607           results to a 64-bit accumulate operand. Overflow is only possible as a result of the 64-bit
1608           addition. This overflow is not detected if it occurs. Instead, the result wraps around
1609           modulo2<sup>64</sup>.
1610
1611     \param      val1    first 16-bit operands for each multiplication.
1612     \param      val2    second 16-bit operands for each multiplication.
1613     \param      val3    accumulate value.
1614
1615
1616     \returns
1617         the product of each multiplication added to the accumulate value.
1618
1619
1620     \par Operation:
1621         \code
1622    p1 = val1[15:0]  * val2[15:0]
1623    p2 = val1[31:16] * val2[31:16]
1624    sum = p1 + p2 + val3[63:32][31:0]
1625    res[63:32] = sum[63:32]
1626    res[31:0]  = sum[31:0]
1627     \endcode
1628 */
1629 uint64_t __SMLALD(uint32_t val1, uint32_t val2, uint64_t val3);
1630
1631
1632 /**************************************************************************************************/
1633 /**
1634     \brief      Dual 16-bit signed multiply with exchange with single 64-bit accumulator
1635
1636     \details    This function enables you to exchange the halfwords of the second operand, and perform
1637           two signed 16-bit multiplications, adding both results to a 64-bit accumulate operand.
1638           Overflow is only possible as a result of the 64-bit addition. This overflow is not detected
1639           if it occurs. Instead, the result wraps around modulo2<sup>64</sup>.
1640
1641     \param      val1    first 16-bit operands for each multiplication.
1642     \param      val2    second 16-bit operands for each multiplication.
1643     \param      val3    accumulate value.
1644
1645
1646     \returns
1647         the product of each multiplication added to the accumulate value.
1648
1649
1650     \par Operation:
1651         \code
1652    p1 = val1[15:0]  * val2[31:16]
1653    p2 = val1[31:16] * val2[15:0]
1654    sum = p1 + p2 + val3[63:32][31:0]
1655    res[63:32] = sum[63:32]
1656    res[31:0] = sum[31:0]
1657     \endcode
1658 */
1659 unsigned long long __SMLALDX(uint32_t val1, uint32_t val2, unsigned long long val3);
1660
1661
1662 /**************************************************************************************************/
1663 /**
1664     \brief      Dual 16-bit signed multiply returning difference
1665
1666     \details    This function enables you to perform two 16-bit signed multiplications, taking the
1667           difference of the products by subtracting the high halfword product from the low
1668           halfword product.
1669
1670     \param      val1    first 16-bit operands for each multiplication.
1671     \param      val2    second 16-bit operands for each multiplication.
1672
1673
1674     \returns
1675         the difference of the products of the two 16-bit signed multiplications.
1676
1677
1678     \par Operation:
1679         \code
1680    p1 = val1[15:0]  * val2[15:0]
1681    p2 = val1[31:16] * val2[31:16]
1682    res[31:0] = p1 - p2
1683     \endcode
1684 */
1685 uint32_t __SMUSD(uint32_t val1, uint32_t val2);
1686
1687
1688 /**************************************************************************************************/
1689 /**
1690     \brief      Dual 16-bit signed multiply with exchange returning difference
1691
1692     \details    This function enables you to perform two 16-bit signed multiplications, subtracting one
1693           of the products from the other. The halfwords of the second operand are exchanged
1694           before performing the arithmetic. This produces top * bottom and bottom * top
1695           multiplication.
1696
1697     \param      val1    first 16-bit operands for each multiplication.
1698     \param      val2    second 16-bit operands for each multiplication.
1699
1700
1701     \returns
1702         the difference of the products of the two 16-bit signed multiplications.
1703
1704
1705     \par Operation:
1706         \code
1707    p1 = val1[15:0]  * val2[31:16]
1708    p2 = val1[31:16] * val2[15:0]
1709    res[31:0] = p1 - p2
1710     \endcode
1711 */
1712 uint32_t __SMUSDX(uint32_t val1, uint32_t val2);
1713
1714
1715 /**************************************************************************************************/
1716 /**
1717     \brief      Q setting dual 16-bit signed multiply subtract with 32-bit accumulate
1718
1719     \details    This function enables you to perform two 16-bit signed multiplications, take the
1720           difference of the products, subtracting the high halfword product from the low halfword
1721           product, and add the difference to a 32-bit accumulate operand.<br>
1722           The Q bit is set if the accumulation overflows. Overflow cannot occur during the multiplications or the
1723           subtraction.
1724
1725     \param      val1    first 16-bit operands for each multiplication.
1726     \param      val2    second 16-bit operands for each multiplication.
1727     \param      val3    accumulate value.
1728
1729
1730     \returns
1731         the difference of the product of each multiplication, added
1732             to the accumulate value.
1733
1734
1735     \par Operation:
1736         \code
1737    p1 = val1[15:0]  * val2[15:0]
1738    p2 = val1[31:16] * val2[31:16]
1739    res[31:0] = p1 - p2 + val3[31:0]
1740     \endcode
1741 */
1742 uint32_t __SMLSD(uint32_t val1, uint32_t val2, uint32_t val3);
1743
1744
1745 /**************************************************************************************************/
1746 /**
1747     \brief      Q setting dual 16-bit signed multiply with exchange subtract with 32-bit accumulate
1748
1749     \details    This function enables you to exchange the halfwords in the second operand, then perform
1750           two 16-bit signed multiplications. The difference of the products is added to a 32-bit
1751           accumulate operand.<br>
1752           The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications or the subtraction.
1753
1754     \param      val1    first 16-bit operands for each multiplication.
1755     \param      val2    second 16-bit operands for each multiplication.
1756     \param      val3    accumulate value.
1757
1758
1759     \returns
1760         the difference of the product of each multiplication, added
1761             to the accumulate value.
1762
1763
1764     \par Operation:
1765         \code
1766    p1 = val1[15:0]  * val2[31:16]
1767    p2 = val1[31:16] * val2[15:0]
1768    res[31:0] = p1 - p2 + val3[31:0]
1769     \endcode
1770 */
1771 uint32_t __SMLSDX(uint32_t val1, uint32_t val2, uint32_t val3);
1772
1773
1774 /**************************************************************************************************/
1775 /**
1776     \brief      Q setting dual 16-bit signed multiply subtract with 64-bit accumulate
1777
1778     \details    This function It enables you to perform two 16-bit signed multiplications, take the
1779           difference of the products, subtracting the high halfword product from the low halfword
1780           product, and add the difference to a 64-bit accumulate operand. Overflow cannot occur
1781           during the multiplications or the subtraction. Overflow can occur as a result of the 64-bit
1782           addition, and this overflow is not detected. Instead, the result wraps round to
1783           modulo2<sup>64</sup>.
1784
1785     \param      val1    first 16-bit operands for each multiplication.
1786     \param      val2    second 16-bit operands for each multiplication.
1787     \param      val3    accumulate value.
1788
1789
1790     \returns
1791         the difference of the product of each multiplication,
1792             added to the accumulate value.
1793
1794
1795     \par Operation:
1796         \code
1797    p1 = val1[15:0]  * val2[15:0]
1798    p2 = val1[31:16] * val2[31:16]
1799    res[63:0] = p1 - p2 + val3[63:0]
1800     \endcode
1801 */
1802 uint64_t __SMLSLD(uint32_t val1, uint32_t val2, uint64_t val3);
1803
1804
1805 /**************************************************************************************************/
1806 /**
1807     \brief      Q setting dual 16-bit signed multiply with exchange subtract with 64-bit accumulate
1808
1809     \details    This function enables you to exchange the halfwords of the second operand, perform two
1810           16-bit multiplications, adding the difference of the products to a 64-bit accumulate
1811           operand. Overflow cannot occur during the multiplications or the subtraction. Overflow
1812           can occur as a result of the 64-bit addition, and this overflow is not detected. Instead,
1813           the result wraps round to modulo2<sup>64</sup>.
1814
1815     \param      val1    first 16-bit operands for each multiplication.
1816     \param      val2    second 16-bit operands for each multiplication.
1817     \param      val3    accumulate value.
1818
1819
1820     \returns
1821         the difference of the product of each multiplication,
1822             added to the accumulate value.
1823
1824
1825     \par Operation:
1826         \code
1827    p1 = val1[15:0]  * val2[31:16]
1828    p2 = val1[31:16] * val2[15:0]
1829    res[63:0] = p1 - p2 + val3[63:0]
1830     \endcode
1831 */
1832 unsigned long long __SMLSLDX(uint32_t val1, uint32_t val2, unsigned long long val3);
1833
1834
1835 /**************************************************************************************************/
1836 /**
1837     \brief      Select bytes based on GE bits
1838
1839     \details    This function inserts a SEL instruction into the instruction stream generated by the
1840           compiler. It enables you to select bytes from the input parameters, whereby the bytes
1841           that are selected depend upon the results of previous SIMD instruction function. The
1842           results of previous SIMD instruction function are represented by the Greater than or
1843           Equal flags in the Application Program Status Register (APSR).
1844           The __SEL function works equally well on both halfword and byte operand function
1845           results. This is because halfword operand operations set two (duplicate) GE bits per
1846           value.
1847
1848     \param      val1    four selectable 8-bit values.
1849     \param      val2    four selectable 8-bit values.
1850
1851
1852     \returns
1853         The function selects bytes from the input parameters and returns them in the
1854             return value, res, according to the following criteria:
1855             \li if APSR.GE[0] == 1 then res[7:0] = val1[7:0] else res[7:0] = val2[7:0]
1856             \li if APSR.GE[1] == 1 then res[15:8] = val1[15:8] else res[15:8] = val2[15:8]
1857             \li if APSR.GE[2] == 1 then res[23:16] = val1[23:16] else res[23:16] = val2[23:16]
1858             \li if APSR.GE[3] == 1 then res[31;24] = val1[31:24] else res = val2[31:24]
1859
1860 */
1861 uint32_t __SEL(uint32_t val1, uint32_t val2);
1862
1863
1864 /**************************************************************************************************/
1865 /**
1866     \brief      Q setting saturating add
1867
1868     \details    This function enables you to obtain the saturating add of two integers.<br>
1869          The Q bit is set if the operation saturates.
1870
1871     \param      val1    first summand of the saturating add operation.
1872     \param      val2    second summand of the saturating add operation.
1873
1874
1875     \returns
1876         the saturating addition of val1 and val2.
1877
1878     \par Operation:
1879         \code
1880    res[31:0] = SAT(val1 + SAT(val2))
1881         \endcode
1882 */
1883 uint32_t __QADD(uint32_t val1, uint32_t val2);
1884
1885
1886 /**************************************************************************************************/
1887 /**
1888     \brief      Q setting saturating subtract
1889
1890     \details    This function enables you to obtain the saturating subtraction of two integers.<br>
1891          The Q bit is set if the operation saturates.
1892
1893     \param      val1    minuend of the saturating subtraction operation.
1894     \param      val2    subtrahend of the saturating subtraction operation.
1895
1896
1897     \returns
1898         the saturating subtraction of val1 and val2.
1899
1900     \par Operation:
1901         \code
1902    res[31:0] = SAT(val1 - SAT(val2))
1903         \endcode
1904 */
1905 uint32_t __QSUB(uint32_t val1, uint32_t val2);
1906
1907
1908 /**************************************************************************************************/
1909 /**
1910     \brief      Halfword packing instruction. Combines bits[15:0] of <i>val1</i>
1911                 with bits[31:16] of <i>val2</i> levitated with the <i>val3</i>.
1912
1913     \details    Combine a halfword from one register with a halfword from another register.
1914                 The second argument can be left-shifted before extraction of the halfword. The registers
1915                 PC and SP are not allowed as arguments. This instruction does not change the flags.
1916
1917     \param      val1    first 16-bit operands
1918     \param      val2    second 16-bit operands
1919     \param      val3    value for left-shifting <i>val2</i>. Value range [0..31].
1920
1921
1922     \returns
1923         the combination of halfwords.
1924
1925     \par Operation:
1926         \code
1927    res[15:0]  = val1[15:0]
1928    res[31:16] = val2[31:16]<<val3
1929         \endcode
1930 */
1931 uint32_t __PKHBT(uint32_t val1, uint32_t val2, uint32_t val3);
1932
1933
1934 /**************************************************************************************************/
1935 /**
1936     \brief      Halfword packing instruction. Combines bits[31:16] of <i>val1</i>
1937                 with bits[15:0] of <i>val2</i> right-shifted with the <i>val3</i>.
1938
1939     \details    Combines a halfword from one register with a halfword from another register.
1940                 The second argument can be right-shifted before extraction of the halfword. The registers
1941                 PC and SP are not allowed as arguments. This instruction does not change the flags.
1942
1943     \param      val1    second 16-bit operands
1944     \param      val2    first 16-bit operands
1945     \param      val3    value for right-shifting <i>val2</i>. Value range [1..32].
1946
1947
1948     \returns
1949         the combination of halfwords.
1950
1951     \par Operation:
1952         \code
1953    res[15:0]  = val2[15:0]>>val3
1954    res[31:16] = val1[31:16]
1955         \endcode
1956 */
1957 uint32_t __PKHTB(uint32_t val1, uint32_t val2, uint32_t val3);
1958
1959 /** @} */  /* end group intrinsic_SIMD_gr */