CMSIS_CM4_SIMD.htm 121 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head>
  3. <title>CMSIS: Cortex-M4 SIMD Instructions</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  4. <meta name="ProgId" content="FrontPage.Editor.Document">
  5. <style>
  6. <!--
  7. /*-----------------------------------------------------------Keil Software CHM Style Sheet
  8. -----------------------------------------------------------*/
  9. body { color: #000000; background-color: #FFFFFF; font-size: 75%; font-family: Verdana, Arial, 'Sans Serif' }
  10. a:link { color: #0000FF; text-decoration: underline }
  11. a:visited { color: #0000FF; text-decoration: underline }
  12. a:active { color: #FF0000; text-decoration: underline }
  13. a:hover { color: #FF0000; text-decoration: underline }
  14. h1 { font-family: Verdana; font-size: 18pt; color: #000080; font-weight: bold; text-align: Center; margin-right: 3 }
  15. h2 { font-family: Verdana; font-size: 14pt; color: #000080; font-weight: bold; background-color: #CCCCCC; margin-top: 24; margin-bottom: 3; padding: 6 }
  16. h3 { font-family: Verdana; font-size: 10pt; font-weight: bold; background-color: #CCCCCC; margin-top: 24; margin-bottom: 3; padding: 6 }
  17. pre { font-family: Courier New; font-size: 10pt; background-color: #CCFFCC; margin-left: 24; margin-right: 24 }
  18. ul { list-style-type: square; margin-top: 6pt; margin-bottom: 0 }
  19. ol { margin-top: 6pt; margin-bottom: 0 }
  20. li { clear: both; margin-bottom: 6pt }
  21. table { font-size: 100%; border-width: 0; padding: 0 }
  22. th { color: #FFFFFF; background-color: #000080; text-align: left; vertical-align: bottom; padding-right: 6pt }
  23. tr { text-align: left; vertical-align: top }
  24. td { text-align: left; vertical-align: top; padding-right: 6pt }
  25. .ToolT { font-size: 8pt; color: #808080 }
  26. .TinyT { font-size: 8pt; text-align: Center }
  27. code { color: #000000; background-color: #E0E0E0; font-family: 'Courier New', Courier; line-height: 120%; font-style: normal }
  28. /*-----------------------------------------------------------Notes
  29. -----------------------------------------------------------*/
  30. p.note { font-weight: bold; clear: both; margin-bottom: 3pt; padding-top: 6pt }
  31. /*-----------------------------------------------------------Expanding/Contracting Divisions
  32. -----------------------------------------------------------*/
  33. #expand { text-decoration: none; margin-bottom: 3pt }
  34. img.expand { border-style: none; border-width: medium }
  35. div.expand { display: none; margin-left: 9pt; margin-top: 0 }
  36. /*-----------------------------------------------------------Where List Tags
  37. -----------------------------------------------------------*/
  38. p.wh { font-weight: bold; clear: both; margin-top: 6pt; margin-bottom: 3pt }
  39. table.wh { width: 100% }
  40. td.whItem { white-space: nowrap; font-style: italic; padding-right: 6pt; padding-bottom: 6pt }
  41. td.whDesc { padding-bottom: 6pt }
  42. /*-----------------------------------------------------------Keil Table Tags
  43. -----------------------------------------------------------*/
  44. table.kt { width: 100%; border: 1pt solid #000000 }
  45. th.kt { white-space: nowrap; border-bottom: 1pt solid #000000; padding-left: 6pt; padding-right: 6pt; padding-top: 4pt; padding-bottom: 4pt }
  46. tr.kt { }
  47. td.kt { color: #000000; background-color: #E0E0E0; border-top: 1pt solid #A0A0A0; padding-left: 6pt; padding-right: 6pt; padding-top: 2pt; padding-bottom: 2pt }
  48. /*----------------------------------------------------------------------------------------------------------------------*/
  49. .style1 {
  50. background-color: #E0E0E0;
  51. }
  52. .O
  53. {color:#1D315B;
  54. font-size:149%;}
  55. -->
  56. </style>
  57. </head>
  58. <body>
  59. <h1>CMSIS Support for Cortex-M4 SIMD Instructions</h1>
  60. <p align="center">This file describes the Cortex-M4 SIMD instructions supported by CMSIS.</p>
  61. <p align="center">Version: 1.00 - 25. November 2010</p>
  62. <p class="TinyT">Information in this file, the accompany manuals, and software is<br>
  63. Copyright © ARM Ltd.<br>All rights reserved.
  64. </p>
  65. <hr>
  66. <h2>Revision History</h2>
  67. <ul>
  68. <li>Revision 0.01 - January 2010: Initial version</li>
  69. <li>Revision 0.02 - June 2010: added __QADD, __QSUB</li>
  70. <li>Revision 1.00 - November 2010: </li>
  71. </ul>
  72. <hr>
  73. <h2>Contents</h2>
  74. <ol>
  75. <li class="LI2"><a href="#About">About</a></li>
  76. <li class="LI2"><a href="#CM4-SIMD-Instructions">Cortex-M4 SIMD instruction support</a></li>
  77. <li class="LI2"><a href="#Examples">Examples</a></li>
  78. </ol>
  79. <p>&nbsp;</p>
  80. <h2><a name="About"></a>About</h2>
  81. <p>
  82. CMSIS provides for the Cortex-M4 a set of functions supporting Cortex-M4 SIMD instructions.
  83. </p>
  84. <p>&nbsp;</p>
  85. <h2><a name="CM4-SIMD-Instructions"></a>Cortex-M4 SIMD instruction support</h2>
  86. <p>CMSIS supports the following functions for Cortex-M4 instructions:
  87. </p>
  88. <table class="kt" border="0" cellpadding="0" cellspacing="0">
  89. <tbody>
  90. <tr>
  91. <th class="kt">Name</th>
  92. <th class="kt">Mnemonic</th>
  93. <th class="kt">Description</th>
  94. </tr>
  95. <tr>
  96. <td class="kt"><b><a href="#__SADD8">__SADD8</a></b></td>
  97. <td class="kt">SADD8</td>
  98. <td class="kt">GE setting quad 8-bit signed addition</td>
  99. </tr>
  100. <tr>
  101. <td class="kt"><b><a href="#__QADD8">__QADD8</a></b></td>
  102. <td class="kt">QADD8</td>
  103. <td class="kt">Q setting quad 8-bit saturating addition</td>
  104. </tr>
  105. <tr>
  106. <td class="kt"><b><a href="#__SHADD8">__SHADD8</a></b></td>
  107. <td class="kt">SHADD8</td>
  108. <td class="kt">Quad 8-bit signed addition with halved results</td>
  109. </tr>
  110. <tr>
  111. <td class="kt"><b><a href="#__UADD8">__UADD8</a></b></td>
  112. <td class="kt">UADD8</td>
  113. <td class="kt">GE setting quad 8-bit unsigned addition</td>
  114. </tr>
  115. <tr>
  116. <td class="kt"><b><a href="#__UQADD8">__UQADD8</a></b></td>
  117. <td class="kt">UQADD8</td>
  118. <td class="kt">Quad 8-bit unsigned saturating addition</td>
  119. </tr>
  120. <tr>
  121. <td class="kt"><b><a href="#__UHADD8">__UHADD8</a></b></td>
  122. <td class="kt">UHADD8</td>
  123. <td class="kt">Quad 8-bit unsigned addition with halved results</td>
  124. </tr>
  125. <tr>
  126. <td class="kt"><b><a href="#__SSUB8">__SSUB8</a></b></td>
  127. <td class="kt">SSUB8</td>
  128. <td class="kt">GE setting quad 8-bit signed subtraction</td>
  129. </tr>
  130. <tr>
  131. <td class="kt"><b><a href="#__QSUB8">__QSUB8</a></b></td>
  132. <td class="kt">QSUB8</td>
  133. <td class="kt">Q setting quad 8-bit saturating subtract</td>
  134. </tr>
  135. <tr>
  136. <td class="kt"><b><a href="#__SHSUB8">__SHSUB8</a></b></td>
  137. <td class="kt">SHSUB8</td>
  138. <td class="kt">Quad 8-bit signed subtraction with halved results</td>
  139. </tr>
  140. <tr>
  141. <td class="kt"><b><a href="#__USUB8">__USUB8</a></b></td>
  142. <td class="kt">USUB8</td>
  143. <td class="kt">GE setting quad 8-bit unsigned subtract</td>
  144. </tr>
  145. <tr>
  146. <td class="kt"><b><a href="#__UQSUB8">__UQSUB8</a></b></td>
  147. <td class="kt">UQSUB8</td>
  148. <td class="kt">Quad 8-bit unsigned saturating subtraction</td>
  149. </tr>
  150. <tr>
  151. <td class="kt"><b><a href="#__UHSUB8">__UHSUB8</a></b></td>
  152. <td class="kt">UHSUB8</td>
  153. <td class="kt">Quad 8-bit unsigned subtraction with halved results</td>
  154. </tr>
  155. <tr>
  156. <td class="kt"><b><a href="#__SADD16">__SADD16</a></b></td>
  157. <td class="kt">SADD16</td>
  158. <td class="kt">GE setting dual 16-bit signed addition</td>
  159. </tr>
  160. <tr>
  161. <td class="kt"><b><a href="#__QADD16">__QADD16</a></b></td>
  162. <td class="kt">QADD16</td>
  163. <td class="kt">Q setting dual 16-bit saturating addition</td>
  164. </tr>
  165. <tr>
  166. <td class="kt"><b><a href="#__SHADD16">__SHADD16</a></b></td>
  167. <td class="kt">SHADD16</td>
  168. <td class="kt">Dual 16-bit signed addition with halved results</td>
  169. </tr>
  170. <tr>
  171. <td class="kt"><b><a href="#__UADD16">__UADD16</a></b></td>
  172. <td class="kt">UADD16</td>
  173. <td class="kt">GE setting dual 16-bit unsigned addition</td>
  174. </tr>
  175. <tr>
  176. <td class="kt"><b><a href="#__UQADD16">__UQADD16</a></b></td>
  177. <td class="kt">UQADD16</td>
  178. <td class="kt">Dual 16-bit unsigned saturating addition</td>
  179. </tr>
  180. <tr>
  181. <td class="kt"><b><a href="#__UHADD16">__UHADD16</a></b></td>
  182. <td class="kt">UHADD16</td>
  183. <td class="kt">Dual 16-bit unsigned addition with halved results</td>
  184. </tr>
  185. <tr>
  186. <td class="kt"><b><a href="#__SSUB16">__SSUB16</a></b></td>
  187. <td class="kt">SSUB16</td>
  188. <td class="kt">GE setting dual 16-bit signed subtraction</td>
  189. </tr>
  190. <tr>
  191. <td class="kt"><b><a href="#__QSUB16">__QSUB16</a></b></td>
  192. <td class="kt">QSUB16</td>
  193. <td class="kt">Q setting dual 16-bit saturating subtract</td>
  194. </tr>
  195. <tr>
  196. <td class="kt"><b><a href="#__SHSUB16">__SHSUB16</a></b></td>
  197. <td class="kt">SHSUB16</td>
  198. <td class="kt">Dual 16-bit signed subtraction with halved results</td>
  199. </tr>
  200. <tr>
  201. <td class="kt"><b><a href="#__USUB16">__USUB16</a></b></td>
  202. <td class="kt">USUB16</td>
  203. <td class="kt">GE setting dual 16-bit unsigned subtract</td>
  204. </tr>
  205. <tr>
  206. <td class="kt"><b><a href="#__UQSUB16">__UQSUB16</a></b></td>
  207. <td class="kt">UQSUB16</td>
  208. <td class="kt">Dual 16-bit unsigned saturating subtraction</td>
  209. </tr>
  210. <tr>
  211. <td class="kt"><b><a href="#__UHSUB16">__UHSUB16</a></b></td>
  212. <td class="kt">UHSUB16</td>
  213. <td class="kt">Dual 16-bit unsigned subtraction with halved results</td>
  214. </tr>
  215. <tr>
  216. <td class="kt"><b><a href="#__SASX">__SASX</a></b></td>
  217. <td class="kt">SASX</td>
  218. <td class="kt">GE setting dual 16-bit addition and subtraction with exchange</td>
  219. </tr>
  220. <tr>
  221. <td class="kt"><b><a href="#__QASX">__QASX</a></b></td>
  222. <td class="kt">QASX</td>
  223. <td class="kt">Q setting dual 16-bit add and subtract with exchange</td>
  224. </tr>
  225. <tr>
  226. <td class="kt"><b><a href="#__SHASX">__SHASX</a></b></td>
  227. <td class="kt">SHASX</td>
  228. <td class="kt">Dual 16-bit signed addition and subtraction with halved results</td>
  229. </tr>
  230. <tr>
  231. <td class="kt"><b><a href="#__UASX">__UASX</a></b></td>
  232. <td class="kt">UASX</td>
  233. <td class="kt">GE setting dual 16-bit unsigned addition and subtraction with exchange</td>
  234. </tr>
  235. <tr>
  236. <td class="kt"><b><a href="#__UQASX">__UQASX</a></b></td>
  237. <td class="kt">UQASX</td>
  238. <td class="kt">Dual 16-bit unsigned saturating addition and subtraction with exchange</td>
  239. </tr>
  240. <tr>
  241. <td class="kt"><b><a href="#__UHASX">__UHASX</a></b></td>
  242. <td class="kt">UHASX</td>
  243. <td class="kt">Dual 16-bit unsigned addition and subtraction with halved results and exchange</td>
  244. </tr>
  245. <tr>
  246. <td class="kt"><b><a href="#__SSAX">__SSAX</a></b></td>
  247. <td class="kt">SSAX</td>
  248. <td class="kt">GE setting dual 16-bit signed subtraction and addition with exchange</td>
  249. </tr>
  250. <tr>
  251. <td class="kt"><b><a href="#__QSAX">__QSAX</a></b></td>
  252. <td class="kt">QSAX</td>
  253. <td class="kt">Q setting dual 16-bit subtract and add with exchange</td>
  254. </tr>
  255. <tr>
  256. <td class="kt"><b><a href="#__SHSAX">__SHSAX</a></b></td>
  257. <td class="kt">SHSAX</td>
  258. <td class="kt">Dual 16-bit signed subtraction and addition with halved results</td>
  259. </tr>
  260. <tr>
  261. <td class="kt"><b><a href="#__USAX">__USAX</a></b></td>
  262. <td class="kt">USAX</td>
  263. <td class="kt">GE setting dual 16-bit unsigned subtract and add with exchange</td>
  264. </tr>
  265. <tr>
  266. <td class="kt"><b><a href="#__UQSAX">__UQSAX</a></b></td>
  267. <td class="kt">UQSAX</td>
  268. <td class="kt">Dual 16-bit unsigned saturating subtraction and addition with exchange</td>
  269. </tr>
  270. <tr>
  271. <td class="kt"><b><a href="#__UHSAX">__UHSAX</a></b></td>
  272. <td class="kt">UHSAX</td>
  273. <td class="kt">Dual 16-bit unsigned subtraction and addition with halved results and exchange</td>
  274. </tr>
  275. <tr>
  276. <td class="kt"><b><a href="#__USAD8">__USAD8</a></b></td>
  277. <td class="kt">USAD8</td>
  278. <td class="kt">Unsigned sum of quad 8-bit unsigned absolute difference</td>
  279. </tr>
  280. <tr>
  281. <td class="kt"><b><a href="#__USADA8">__USADA8</a></b></td>
  282. <td class="kt">USADA8</td>
  283. <td class="kt">Unsigned sum of quad 8-bit unsigned absolute difference with 32-bit accumulate</td>
  284. </tr>
  285. <tr>
  286. <td class="kt"><b><a href="#__SSAT16">__SSAT16</a></b></td>
  287. <td class="kt">SSAT16</td>
  288. <td class="kt">Q setting dual 16-bit saturate</td>
  289. </tr>
  290. <tr>
  291. <td class="kt"><b><a href="#__USAT16">__USAT16</a></b></td>
  292. <td class="kt">USAT16</td>
  293. <td class="kt">Q setting dual 16-bit unsigned saturate</td>
  294. </tr>
  295. <tr>
  296. <td class="kt"><b><a href="#__UXTB16">__UXTB16</a></b></td>
  297. <td class="kt">UXTB16</td>
  298. <td class="kt">Dual extract 8-bits and zero-extend to 16-bits</td>
  299. </tr>
  300. <tr>
  301. <td class="kt"><b><a href="#__UXTAB16">__UXTAB16</a></b></td>
  302. <td class="kt">UXTAB16</td>
  303. <td class="kt">Extracted 16-bit to 32-bit unsigned addition</td>
  304. </tr>
  305. <tr>
  306. <td class="kt"><b><a href="#__SXTB16">__SXTB16</a></b></td>
  307. <td class="kt">SXTB16</td>
  308. <td class="kt">Dual extract 8-bits and sign extend each to 16-bits</td>
  309. </tr>
  310. <tr>
  311. <td class="kt"><b><a href="#__SXTAB16">__SXTAB16</a></b></td>
  312. <td class="kt">SXTAB16</td>
  313. <td class="kt">Dual extracted 8-bit to 16-bit signed addition</td>
  314. </tr>
  315. <tr>
  316. <td class="kt"><b><a href="#__SMUAD">__SMUAD</a></b></td>
  317. <td class="kt">SMUAD</td>
  318. <td class="kt">Q setting sum of dual 16-bit signed multiply</td>
  319. </tr>
  320. <tr>
  321. <td class="kt"><b><a href="#__SMUADX">__SMUADX</a></b></td>
  322. <td class="kt">SMUADX</td>
  323. <td class="kt">Q setting sum of dual 16-bit signed multiply with exchange</td>
  324. </tr>
  325. <tr>
  326. <td class="kt"><b><a href="#__SMLAD">__SMLAD</a></b></td>
  327. <td class="kt">SMLAD</td>
  328. <td class="kt">Q setting dual 16-bit signed multiply with single 32-bit accumulator</td>
  329. </tr>
  330. <tr>
  331. <td class="kt"><b><a href="#__SMLADX">__SMLADX</a></b></td>
  332. <td class="kt">SMLADX</td>
  333. <td class="kt">Q setting pre-exchanged dual 16-bit signed multiply with single 32-bit accumulator</td>
  334. </tr>
  335. <tr>
  336. <td class="kt"><b><a href="#__SMLALD">__SMLALD</a></b></td>
  337. <td class="kt">SMLALD</td>
  338. <td class="kt">Dual 16-bit signed multiply with single 64-bit accumulator</td>
  339. </tr>
  340. <tr>
  341. <td class="kt"><b><a href="#__SMLALDX">__SMLALDX</a></b></td>
  342. <td class="kt">SMLALDX</td>
  343. <td class="kt">Dual 16-bit signed multiply with exchange with single 64-bit accumulator</td>
  344. </tr>
  345. <tr>
  346. <td class="kt"><b><a href="#__SMUSD">__SMUSD</a></b></td>
  347. <td class="kt">SMUSD</td>
  348. <td class="kt">Dual 16-bit signed multiply returning difference</td>
  349. </tr>
  350. <tr>
  351. <td class="kt"><b><a href="#__SMUSDX">__SMUSDX</a></b></td>
  352. <td class="kt">SMUSDX</td>
  353. <td class="kt">Dual 16-bit signed multiply with exchange returning difference</td>
  354. </tr>
  355. <tr>
  356. <td class="kt"><b><a href="#__SMLSD">__SMLSD</a></b></td>
  357. <td class="kt">SMLSD</td>
  358. <td class="kt">Q setting dual 16-bit signed multiply subtract with 32-bit accumulate</td>
  359. </tr>
  360. <tr>
  361. <td class="kt"><b><a href="#__SMLSDX">__SMLSDX</a></b></td>
  362. <td class="kt">SMLSDX</td>
  363. <td class="kt">Q setting dual 16-bit signed multiply with exchange subtract with 32-bit accumulate</td>
  364. </tr>
  365. <tr>
  366. <td class="kt"><b><a href="#__SMLSLD">__SMLSLD</a></b></td>
  367. <td class="kt">SMLSLD</td>
  368. <td class="kt">Q setting dual 16-bit signed multiply subtract with 64-bit accumulate</td>
  369. </tr>
  370. <tr>
  371. <td class="kt"><b><a href="#__SMLSLDX">__SMLSLDX</a></b></td>
  372. <td class="kt">SMLSLDX</td>
  373. <td class="kt">Q setting dual 16-bit signed multiply with exchange subtract with 64-bit accumulate</td>
  374. </tr>
  375. <tr>
  376. <td class="kt"><b><a href="#__SEL">__SEL</a></b></td>
  377. <td class="kt">SEL</td>
  378. <td class="kt">Select bytes based on GE bits</td>
  379. </tr>
  380. <tr>
  381. <td class="kt"><b><a href="#__QADD">__QADD</a></b></td>
  382. <td class="kt">QADD</td>
  383. <td class="kt">Q setting saturating add</td>
  384. </tr>
  385. <tr>
  386. <td class="kt"><b><a href="#__QSUB">__QSUB</a></b></td>
  387. <td class="kt">QSUB/td>
  388. <td class="kt">Q setting saturating subtract</td>
  389. </tr>
  390. </tbody>
  391. </table>
  392. <!-- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  393. <!-- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  394. <h3><a name="__SADD8"></a>Function __SADD8</h3>
  395. <table border="0" cellpadding="5" cellspacing="5">
  396. <tbody>
  397. <tr>
  398. <td><b>Summary</b></td>
  399. <td>
  400. <pre style="margin-left:0px">
  401. uint32_t __SADD8(uint32_t val1, uint32_t val2);</pre>
  402. </td>
  403. </tr>
  404. <tr>
  405. <td><b>Description</b></td>
  406. <td>This function enables you to perform four 8-bit signed integer additions.<br>
  407. The GE bits in the APSR are set according to the results of the additions.
  408. </td>
  409. </tr>
  410. <tr>
  411. <td><b>Parameter</b></td>
  412. <td>
  413. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  414. <li><b>val1</b>: first four 8-bit summands.</li>
  415. <li><b>val2</b>: second four 8-bit summands.</li>
  416. </ul>
  417. </td>
  418. </tr>
  419. <tr>
  420. <td><b>Return Value</b></td>
  421. <td>
  422. <p>The function returns:</p>
  423. <ul style="margin-top:0px">
  424. <li>the addition of the first bytes from each operand, in the first byte of the return value.</li>
  425. <li>the addition of the second bytes of each operand, in the second byte of the return value.</li>
  426. <li>the addition of the third bytes of each operand, in the third byte of the return value.</li>
  427. <li>the addition of the fourth bytes of each operand, in the fourth byte of the return value.</li>
  428. </ul>
  429. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  430. the results of the operation.<br>
  431. If <i>res</i> is the return value, then:
  432. </p>
  433. <ul style="margin-top:0px">
  434. <li>if res[7:0] &ge; 0 then APSR.GE[0] = 1 else 0</li>
  435. <li>if res[15:8] &ge; 0 then APSR.GE[1] = 1 else 0</li>
  436. <li>if res[23:16] &ge; 0 then APSR.GE[2] = 1 else 0</li>
  437. <li>if res[31:24] &ge; 0 then APSR.GE[3] = 1 else 0</li>
  438. </ul>
  439. </td>
  440. </tr>
  441. <tr>
  442. <td><b>Operation</b></td>
  443. <td>
  444. <pre style="margin-left:0px">
  445. res[7:0] = val1[7:0] + val2[7:0]
  446. res[15:8] = val1[15:8] + val2[15:8]
  447. res[23:16] = val1[23:16] + val2[23:16]
  448. res[31:24] = val1[31:24] + val2[31:24]</pre>
  449. </td>
  450. </tr>
  451. </tbody>
  452. </table>
  453. <h3><a name="__QADD8"></a>Function __QADD8</h3>
  454. <table border="0" cellpadding="5" cellspacing="5">
  455. <tbody>
  456. <tr>
  457. <td><b>Summary</b></td>
  458. <td>
  459. <pre style="margin-left:0px">
  460. uint32_t __QADD8(uint32_t val1, uint32_t val2);</pre>
  461. </td>
  462. </tr>
  463. <tr>
  464. <td><b>Description</b></td>
  465. <td>This function enables you to perform four 8-bit integer additions, saturating the results to
  466. the 8-bit signed integer range -2<sup>7</sup> &le; x &le; 2<sup>7</sup> - 1.
  467. </td>
  468. </tr>
  469. <tr>
  470. <td><b>Parameter</b></td>
  471. <td>
  472. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  473. <li><b>val1</b>: first four 8-bit summands.</li>
  474. <li><b>val2</b>: second four 8-bit summands.</li>
  475. </ul>
  476. </td>
  477. </tr>
  478. <tr>
  479. <td><b>Return Value</b></td>
  480. <td>
  481. <p>The function returns:</p>
  482. <ul style="margin-top:0px">
  483. <li>the saturated addition of the first byte of each operand in the first byte of the return value.</li>
  484. <li>the saturated addition of the second byte of each operand in the second byte of the return value.</li>
  485. <li>the saturated addition of the third byte of each operand in the third byte of the return value.</li>
  486. <li>the saturated addition of the fourth byte of each operand in the fourth byte of the return value.</li>
  487. </ul>
  488. <p>The returned results are saturated to the 16-bit signed integer range -2<sup>7</sup> &le; x &le; 2<sup>7</sup> - 1.
  489. </p>
  490. </td>
  491. </tr>
  492. <tr>
  493. <td><b>Operation</b></td>
  494. <td>
  495. <pre style="margin-left:0px">
  496. res[7:0] = val1[7:0] + val2[7:0]
  497. res[15:8] = val1[15:8] + val2[15:8]
  498. res[23:16] = val1[23:16] + val2[23:16]
  499. res[31:24] = val1[31:24] + val2[31:24]</pre>
  500. </td>
  501. </tr>
  502. </tbody>
  503. </table>
  504. <h3><a name="__SHADD8"></a>Function __SHADD8</h3>
  505. <table border="0" cellpadding="5" cellspacing="5">
  506. <tbody>
  507. <tr>
  508. <td><b>Summary</b></td>
  509. <td>
  510. <pre style="margin-left:0px">
  511. uint32_t __SHADD8(uint32_t val1, uint32_t val2);</pre>
  512. </td>
  513. </tr>
  514. <tr>
  515. <td><b>Description</b></td>
  516. <td>This function enables you to perform four signed 8-bit integer additions, halving the results.
  517. </td>
  518. </tr>
  519. <tr>
  520. <td><b>Parameter</b></td>
  521. <td>
  522. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  523. <li><b>val1</b>: first four 8-bit summands.</li>
  524. <li><b>val2</b>: second four 8-bit summands.</li>
  525. </ul>
  526. </td>
  527. </tr>
  528. <tr>
  529. <td><b>Return Value</b></td>
  530. <td>
  531. <p>The function returns:</p>
  532. <ul style="margin-top:0px">
  533. <li>the halved addition of the first bytes from each operand, in the first byte of the return value.</li>
  534. <li>the halved addition of the second bytes from each operand, in the second byte of the return value.</li>
  535. <li>the halved addition fo the third bytes from each operand, in the third byte of the return value.</li>
  536. <li>the halved addition of the fourth bytes from each operand, in the fourth byte of the return value.</li>
  537. </ul>
  538. </td>
  539. </tr>
  540. <tr>
  541. <td><b>Operation</b></td>
  542. <td>
  543. <pre style="margin-left:0px">
  544. res[7:0] = (val1[7:0] + val2[7:0]) &gt;&gt; 1
  545. res[15:8] = (val1[15:8] + val2[15:8]) &gt;&gt; 1
  546. res[23:16] = (val1[23:16] + val2[23:16]) &gt;&gt; 1
  547. res[31:24] = (val1[31:24] + val2[31:24]) &gt;&gt; 1</pre>
  548. </td>
  549. </tr>
  550. </tbody>
  551. </table>
  552. <h3><a name="__UADD8"></a>Function __UADD8</h3>
  553. <table border="0" cellpadding="5" cellspacing="5">
  554. <tbody>
  555. <tr>
  556. <td><b>Summary</b></td>
  557. <td>
  558. <pre style="margin-left:0px">
  559. uint32_t __UADD8(uint32_t val1, uint32_t val2);</pre>
  560. </td>
  561. </tr>
  562. <tr>
  563. <td><b>Description</b></td>
  564. <td>This function enables you to perform four unsigned 8-bit integer additions.<br>
  565. The GE bits in the APSR are set according to the results.
  566. </td>
  567. </tr>
  568. <tr>
  569. <td><b>Parameter</b></td>
  570. <td>
  571. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  572. <li><b>val1</b>: first four 8-bit summands for each addition.</li>
  573. <li><b>val2</b>: second four 8-bit summands for each addition.</li>
  574. </ul>
  575. </td>
  576. </tr>
  577. <tr>
  578. <td><b>Return Value</b></td>
  579. <td>
  580. <p>The function returns:</p>
  581. <ul style="margin-top:0px">
  582. <li>the addition of the first bytes in each operand, in the first byte of the return value.</li>
  583. <li>the addition of the second bytes in each operand, in the second byte of the return value.</li>
  584. <li>the addition of the third bytes in each operand, in the third byte of the return value.</li>
  585. <li>the addition of the fourth bytes in each operand, in the fourth byte of the return value.</li>
  586. </ul>
  587. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  588. the results of the operation.<br>
  589. If <i>res</i> is the return value, then:
  590. </p>
  591. <ul style="margin-top:0px">
  592. <li>if res[7:0] &ge; 0x100 then APSR.GE[0] = 1 else 0</li>
  593. <li>if res[15:8] &ge; 0x100 then APSR.GE[1] = 1 else 0</li>
  594. <li>if res[23:16] &ge; 0x100 then APSR.GE[2] = 1 else 0</li>
  595. <li>if res[31:24] &ge; 0x100 then APSR.GE[3] = 1 else 0</li>
  596. </ul>
  597. </td>
  598. </tr>
  599. <tr>
  600. <td><b>Operation</b></td>
  601. <td>
  602. <pre style="margin-left:0px">
  603. res[7:0] = val1[7:0] + val2[7:0]
  604. res[15:8] = val1[15:8] + val2[15:8]
  605. res[23:16] = val1[23:16] + val2[23:16]
  606. res[31:24] = val1[31:24] + val2[31:24]</pre>
  607. </td>
  608. </tr>
  609. </tbody>
  610. </table>
  611. <h3><a name="__UQADD8"></a>Function __UQADD8</h3>
  612. <table border="0" cellpadding="5" cellspacing="5">
  613. <tbody>
  614. <tr>
  615. <td><b>Summary</b></td>
  616. <td>
  617. <pre style="margin-left:0px">
  618. uint32_t __UQADD8(uint32_t val1, uint32_t val2);</pre>
  619. </td>
  620. </tr>
  621. <tr>
  622. <td><b>Description</b></td>
  623. <td>This function enables you to perform four unsigned 8-bit integer additions, saturating the
  624. results to the 8-bit unsigned integer range 0 &le; x &le; 2<sup>8</sup> - 1.
  625. </td>
  626. </tr>
  627. <tr>
  628. <td><b>Parameter</b></td>
  629. <td>
  630. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  631. <li><b>val1</b>: first four 8-bit summands.</li>
  632. <li><b>val2</b>: second four 8-bit summands.</li>
  633. </ul>
  634. </td>
  635. </tr>
  636. <tr>
  637. <td><b>Return Value</b></td>
  638. <td>
  639. <p>The function returns:</p>
  640. <ul style="margin-top:0px">
  641. <li>the addition of the first bytes in each operand, in the first byte of the return value.</li>
  642. <li>the addition of the second bytes in each operand, in the second byte of the return value.</li>
  643. <li>the addition of the third bytes in each operand, in the third byte of the return value.</li>
  644. <li>the addition of the fourth bytes in each operand, in the fourth byte of the return value.</li>
  645. </ul>
  646. <p>The results are saturated to the 8-bit unsigned integer range 0 &le; x &le; 2<sup>8</sup> - 1.
  647. </p>
  648. </td>
  649. </tr>
  650. <tr>
  651. <td><b>Operation</b></td>
  652. <td>
  653. <pre style="margin-left:0px">
  654. res[7:0] = val1[7:0] + val2[7:0]
  655. res[15:8] = val1[15:8] + val2[15:8]
  656. res[23:16] = val1[23:16] + val2[23:16]
  657. res[31:24] = val1[31:24] + val2[31:24]</pre>
  658. </td>
  659. </tr>
  660. </tbody>
  661. </table>
  662. <h3><a name="__UHADD8"></a>Function __UHADD8</h3>
  663. <table border="0" cellpadding="5" cellspacing="5">
  664. <tbody>
  665. <tr>
  666. <td><b>Summary</b></td>
  667. <td>
  668. <pre style="margin-left:0px">
  669. uint32_t __UHADD8(uint32_t val1, uint32_t val2);</pre>
  670. </td>
  671. </tr>
  672. <tr>
  673. <td><b>Description</b></td>
  674. <td>This function enables you to perform four unsigned 8-bit integer additions, halving the results.
  675. </td>
  676. </tr>
  677. <tr>
  678. <td><b>Parameter</b></td>
  679. <td>
  680. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  681. <li><b>val1</b>: first four 8-bit summands.</li>
  682. <li><b>val2</b>: second four 8-bit summands.</li>
  683. </ul>
  684. </td>
  685. </tr>
  686. <tr>
  687. <td><b>Return Value</b></td>
  688. <td>
  689. <p>The function returns:</p>
  690. <ul style="margin-top:0px">
  691. <li>the halved addition of the first bytes in each operand, in the first byte of the return value.</li>
  692. <li>the halved addition of the second bytes in each operand, in the second byte of the return value.</li>
  693. <li>the halved addition of the third bytes in each operand, in the third byte of the return value.</li>
  694. <li>the halved addition of the fourth bytes in each operand, in the fourth byte of the return value.</li>
  695. </ul>
  696. </td>
  697. </tr>
  698. <tr>
  699. <td><b>Operation</b></td>
  700. <td>
  701. <pre style="margin-left:0px">
  702. res[7:0] = (val1[7:0] + val2[7:0]) &gt;&gt; 1
  703. res[15:8] = (val1[15:8] + val2[15:8]) &gt;&gt; 1
  704. res[23:16] = (val1[23:16] + val2[23:16]) &gt;&gt; 1
  705. res[31:24] = (val1[31:24] + val2[31:24]) &gt;&gt; 1</pre>
  706. </td>
  707. </tr>
  708. </tbody>
  709. </table>
  710. <h3><a name="__SSUB8"></a>Function __SSUB8</h3>
  711. <table border="0" cellpadding="5" cellspacing="5">
  712. <tbody>
  713. <tr>
  714. <td><b>Summary</b></td>
  715. <td>
  716. <pre style="margin-left:0px">
  717. uint32_t __SSUB8(uint32_t val1, uint32_t val2);</pre>
  718. </td>
  719. </tr>
  720. <tr>
  721. <td><b>Description</b></td>
  722. <td>This function enables you to perform four 8-bit signed integer subtractions.<br>
  723. The GE bits in the APSR are set according to the results.
  724. </td>
  725. </tr>
  726. <tr>
  727. <td><b>Parameter</b></td>
  728. <td>
  729. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  730. <li><b>val1</b>: first four 8-bit operands of each subtraction.</li>
  731. <li><b>val2</b>: second four 8-bit operands of each subtraction.</li>
  732. </ul>
  733. </td>
  734. </tr>
  735. <tr>
  736. <td><b>Return Value</b></td>
  737. <td>
  738. <p>The function returns:</p>
  739. <ul style="margin-top:0px">
  740. <li>the subtraction of the first byte in the second operand from the first byte in the
  741. first operand, in the first bytes of the return value.</li>
  742. <li>the subtraction of the second byte in the second operand from the second byte in
  743. the first operand, in the second byte of the return value.</li>
  744. <li>the subtraction of the third byte in the second operand from the third byte in the
  745. first operand, in the third byte of the return value.</li>
  746. <li>the subtraction of the fourth byte in the second operand from the fourth byte in
  747. the first operand, in the fourth byte of the return value.</li>
  748. </ul>
  749. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  750. the results of the operation. If <i>res</i> is the return value, then:
  751. </p>
  752. <ul style="margin-top:0px">
  753. <li>if res[8:0] &ge; 0 then APSR.GE[0] = 1 else 0</li>
  754. <li>if res[15:8] &ge; 0 then APSR.GE[1] = 1 else 0</li>
  755. <li>if res[23:16] &ge; 0 then APSR.GE[2] = 1 else 0</li>
  756. <li>if res[31:24] &ge; 0 then APSR.GE[3] = 1 else 0</li>
  757. </ul>
  758. </td>
  759. </tr>
  760. <tr>
  761. <td><b>Operation</b></td>
  762. <td>
  763. <pre style="margin-left:0px">
  764. res[7:0] = val1[7:0] - val2[7:0]
  765. res[15:8] = val1[15:8] - val2[15:8]
  766. res[23:16] = val1[23:16] - val2[23:16]
  767. res[31:24] = val1[31:24] - val2[31:24]</pre>
  768. </td>
  769. </tr>
  770. </tbody>
  771. </table>
  772. <h3><a name="__QSUB8"></a>Function __QSUB8</h3>
  773. <table border="0" cellpadding="5" cellspacing="5">
  774. <tbody>
  775. <tr>
  776. <td><b>Summary</b></td>
  777. <td>
  778. <pre style="margin-left:0px">
  779. uint32_t __QADD8(uint32_t val1, uint32_t val2);</pre>
  780. </td>
  781. </tr>
  782. <tr>
  783. <td><b>Description</b></td>
  784. <td>This function enables you to perform four 8-bit integer subtractions, saturating the results
  785. to the 8-bit signed integer range -2<sup>7</sup> &le; x &le; 2<sup>7</sup> - 1.
  786. </td>
  787. </tr>
  788. <tr>
  789. <td><b>Parameter</b></td>
  790. <td>
  791. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  792. <li><b>val1</b>: first four 8-bit operands.</li>
  793. <li><b>val2</b>: second four 8-bit operands.</li>
  794. </ul>
  795. </td>
  796. </tr>
  797. <tr>
  798. <td><b>Return Value</b></td>
  799. <td>
  800. <p>The function returns:</p>
  801. <ul style="margin-top:0px">
  802. <li>the subtraction of the first byte in the second operand from the first byte in the
  803. first operand, in the first byte of the return value.</li>
  804. <li>the subtraction of the second byte in the second operand from the second byte in
  805. the first operand, in the second byte of the return value.</li>
  806. <li>the subtraction of the third byte in the second operand from the third byte in the
  807. first operand, in the third byte of the return value.</li>
  808. <li>the subtraction of the fourth byte in the second operand from the fourth byte in
  809. the first operand, in the fourth byte of the return value.</li>
  810. </ul>
  811. <p>The returned results are saturated to the 8-bit signed integer range -2<sup>7</sup> &le; x &le; 2<sup>7</sup> - 1.
  812. </p>
  813. </td>
  814. </tr>
  815. <tr>
  816. <td><b>Operation</b></td>
  817. <td>
  818. <pre style="margin-left:0px">
  819. res[7:0] = val1[7:0] - val2[7:0]
  820. res[15:8] = val1[15:8] - val2[15:8]
  821. res[23:16] = val1[23:16] - val2[23:16]
  822. res[31:24] = val1[31:24] - val2[31:24]</pre>
  823. </td>
  824. </tr>
  825. </tbody>
  826. </table>
  827. <h3><a name="__SHSUB8"></a>Function __SHSUB8</h3>
  828. <table border="0" cellpadding="5" cellspacing="5">
  829. <tbody>
  830. <tr>
  831. <td><b>Summary</b></td>
  832. <td>
  833. <pre style="margin-left:0px">
  834. uint32_t __SHSUB8(uint32_t val1, uint32_t val2);</pre>
  835. </td>
  836. </tr>
  837. <tr>
  838. <td><b>Description</b></td>
  839. <td>This function enables you to perform four signed 8-bit integer subtractions, halving the
  840. results.
  841. </td>
  842. </tr>
  843. <tr>
  844. <td><b>Parameter</b></td>
  845. <td>
  846. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  847. <li><b>val1</b>: first four 8-bit operands.</li>
  848. <li><b>val2</b>: second four 8-bit operands.</li>
  849. </ul>
  850. </td>
  851. </tr>
  852. <tr>
  853. <td><b>Return Value</b></td>
  854. <td>
  855. <p>The function returns:</p>
  856. <ul style="margin-top:0px">
  857. <li>the halved subtraction of the first byte in the second operand from the first byte
  858. in the first operand, in the first byte of the return value.</li>
  859. <li>the halved subtraction of the second byte in the second operand from the second
  860. byte in the first operand, in the second byte of the return value.</li>
  861. <li>the halved subtraction of the third byte in the second operand from the third byte
  862. in the first operand, in the third byte of the return value.</li>
  863. <li>the halved subtraction of the fourth byte in the second operand from the fourth
  864. byte in the first operand, in the fourth byte of the return value.</li>
  865. </ul>
  866. </td>
  867. </tr>
  868. <tr>
  869. <td><b>Operation</b></td>
  870. <td>
  871. <pre style="margin-left:0px">
  872. res[7:0] = (val1[7:0] - val2[7:0]) &gt;&gt; 1
  873. res[15:8] = (val1[15:8] - val2[15:8]) &gt;&gt; 1
  874. res[23:16] = (val1[23:16] - val2[23:16] &gt;&gt; 1
  875. res[31:24] = (val1[31:24] - val2[31:24] &gt;&gt; 1</pre>
  876. </td>
  877. </tr>
  878. </tbody>
  879. </table>
  880. <h3><a name="__USUB8"></a>Function __USUB8</h3>
  881. <table border="0" cellpadding="5" cellspacing="5">
  882. <tbody>
  883. <tr>
  884. <td><b>Summary</b></td>
  885. <td>
  886. <pre style="margin-left:0px">
  887. uint32_t __USUB8(uint32_t val1, uint32_t val2);</pre>
  888. </td>
  889. </tr>
  890. <tr>
  891. <td><b>Description</b></td>
  892. <td>This function It enables you to perform four 8-bit unsigned integer subtractions.<br>
  893. The GE bits in the APSR are set according to the results.
  894. </td>
  895. </tr>
  896. <tr>
  897. <td><b>Parameter</b></td>
  898. <td>
  899. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  900. <li><b>val1</b>: first four 8-bit operands.</li>
  901. <li><b>val2</b>: second four 8-bit operands.</li>
  902. </ul>
  903. </td>
  904. </tr>
  905. <tr>
  906. <td><b>Return Value</b></td>
  907. <td>
  908. <p>The function returns:</p>
  909. <ul style="margin-top:0px">
  910. <li>the subtraction of the first byte in the second operand from the first byte in the
  911. first operand, in the first byte of the return value.</li>
  912. <li>the subtraction of the second byte in the second operand from the second byte in
  913. the first operand, in the second byte of the return value.</li>
  914. <li>the subtraction of the third byte in the second operand from the third byte in the
  915. first operand, in the third byte of the return value.</li>
  916. <li>the subtraction of the fourth byte in the second operand from the fourth byte in
  917. the first operand, in the fourth byte of the return value.</li>
  918. </ul>
  919. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  920. the results of the operation.<br>
  921. If <i>res</i> is the return value, then:
  922. </p>
  923. <ul style="margin-top:0px">
  924. <li>if res[7:0] &ge; 0 then APSR.GE[0] = 1 else 0</li>
  925. <li>if res[15:8] &ge; 0 then APSR.GE[1] = 1 else 0</li>
  926. <li>if res[23:16] &ge; 0 then APSR.GE[2] = 1 else 0</li>
  927. <li>if res[31:24] &ge; 0 then APSR.GE[3] = 1 else 0</li>
  928. </ul>
  929. </td>
  930. </tr>
  931. <tr>
  932. <td><b>Operation</b></td>
  933. <td>
  934. <pre style="margin-left:0px">
  935. res[7:0] = val1[7:0] - val2[7:0]
  936. res[15:8] = val1[15:8] - val2[15:8]
  937. res[23:16] = val1[23:16] - val2[23:16]
  938. res[31:24] = val1[31:24] - val2[31:24]</pre>
  939. </td>
  940. </tr>
  941. </tbody>
  942. </table>
  943. <h3><a name="__UQSUB8"></a>Function __UQSUB8</h3>
  944. <table border="0" cellpadding="5" cellspacing="5">
  945. <tbody>
  946. <tr>
  947. <td><b>Summary</b></td>
  948. <td>
  949. <pre style="margin-left:0px">
  950. uint32_t __UQSUB8(uint32_t val1, uint32_t val2);</pre>
  951. </td>
  952. </tr>
  953. <tr>
  954. <td><b>Description</b></td>
  955. <td>This function enables you to perform four unsigned 8-bit integer subtractions, saturating
  956. the results to the 8-bit unsigned integer range 0 &le; x &le; 2<sup>8</sup> - 1.
  957. </td>
  958. </tr>
  959. <tr>
  960. <td><b>Parameter</b></td>
  961. <td>
  962. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  963. <li><b>val1</b>: first four 8-bit operands.</li>
  964. <li><b>val2</b>: second four 8-bit operands.</li>
  965. </ul>
  966. </td>
  967. </tr>
  968. <tr>
  969. <td><b>Return Value</b></td>
  970. <td>
  971. <p>The function returns:</p>
  972. <ul style="margin-top:0px">
  973. <li>the subtraction of the first byte in the second operand from the first byte in the
  974. first operand, in the first byte of the return value.</li>
  975. <li>the subtraction of the second byte in the second operand from the second byte in
  976. the first operand, in the second byte of the return value.</li>
  977. <li>the subtraction of the third byte in the second operand from the third byte in the
  978. first operand, in the third byte of the return value.</li>
  979. <li>the subtraction of the fourth byte in the second operand from the fourth byte in
  980. the first operand, in the fourth byte of the return value.</li>
  981. </ul>
  982. <p>The results are saturated to the 8-bit unsigned integer range 0 &le; x &le; 2<sup>8</sup> - 1.
  983. </p>
  984. </td>
  985. </tr>
  986. <tr>
  987. <td><b>Operation</b></td>
  988. <td>
  989. <pre style="margin-left:0px">
  990. res[7:0] = val1[7:0] - val2[7:0]
  991. res[15:8] = val1[15:8] - val2[15:8]
  992. res[23:16] = val1[23:16] - val2[23:16]
  993. res[31:24] = val1[31:24] - val2[31:24]</pre>
  994. </td>
  995. </tr>
  996. </tbody>
  997. </table>
  998. <h3><a name="__UHSUB8"></a>Function __UHSUB8</h3>
  999. <table border="0" cellpadding="5" cellspacing="5">
  1000. <tbody>
  1001. <tr>
  1002. <td><b>Summary</b></td>
  1003. <td>
  1004. <pre style="margin-left:0px">
  1005. uint32_t __UHSUB8(uint32_t val1, uint32_t val2);</pre>
  1006. </td>
  1007. </tr>
  1008. <tr>
  1009. <td><b>Description</b></td>
  1010. <td>This function enables you to perform four unsigned 8-bit integer subtractions, halving the
  1011. results.
  1012. </td>
  1013. </tr>
  1014. <tr>
  1015. <td><b>Parameter</b></td>
  1016. <td>
  1017. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1018. <li><b>val1</b>: first four 8-bit operands.</li>
  1019. <li><b>val2</b>: second four 8-bit operands.</li>
  1020. </ul>
  1021. </td>
  1022. </tr>
  1023. <tr>
  1024. <td><b>Return Value</b></td>
  1025. <td>
  1026. <p>The function returns:</p>
  1027. <ul style="margin-top:0px">
  1028. <li>the halved subtraction of the first byte in the second operand from the first byte
  1029. in the first operand, in the first byte of the return value.</li>
  1030. <li>the halved subtraction of the second byte in the second operand from the second
  1031. byte in the first operand, in the second byte of the return value.</li>
  1032. <li>the halved subtraction of the third byte in the second operand from the third byte
  1033. in the first operand, in the third byte of the return value.</li>
  1034. <li>the halved subtraction of the fourth byte in the second operand from the fourth
  1035. byte in the first operand, in the fourth byte of the return value.</li>
  1036. </ul>
  1037. </td>
  1038. </tr>
  1039. <tr>
  1040. <td><b>Operation</b></td>
  1041. <td>
  1042. <pre style="margin-left:0px">
  1043. res[7:0] = (val1[7:0] - val2[7:0]) &gt;&gt; 1
  1044. res[15:8] = (val1[15:8] - val2[15:8]) &gt;&gt; 1
  1045. res[23:16] = (val1[23:16] - val2[23:16]) &gt;&gt; 1
  1046. res[31:24] = (val1[31:24] - val2[31:24]) &gt;&gt; 1</pre>
  1047. </td>
  1048. </tr>
  1049. </tbody>
  1050. </table>
  1051. <h3><a name="__SADD16"></a>Function __SADD16</h3>
  1052. <table border="0" cellpadding="5" cellspacing="5">
  1053. <tbody>
  1054. <tr>
  1055. <td><b>Summary</b></td>
  1056. <td>
  1057. <pre style="margin-left:0px">
  1058. uint32_t __SADD16(uint32_t val1, uint32_t val2);</pre>
  1059. </td>
  1060. </tr>
  1061. <tr>
  1062. <td><b>Description</b></td>
  1063. <td>This function enables you to perform two 16-bit signed integer additions.<br>
  1064. The GE bits in the APSR are set according to the results of the additions.
  1065. </td>
  1066. </tr>
  1067. <tr>
  1068. <td><b>Parameter</b></td>
  1069. <td>
  1070. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1071. <li><b>val1</b>: first two 16-bit summands.</li>
  1072. <li><b>val2</b>: second two 16-bit summands.</li>
  1073. </ul>
  1074. </td>
  1075. </tr>
  1076. <tr>
  1077. <td><b>Return Value</b></td>
  1078. <td>
  1079. <p>The function returns:</p>
  1080. <ul style="margin-top:0px">
  1081. <li>the addition of the low halfwords in the low halfword of the return value.</li>
  1082. <li>the addition of the high halfwords in the high halfword of the return value.</li>
  1083. </ul>
  1084. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  1085. the results of the operation.<br>
  1086. If <i>res</i> is the return value, then:
  1087. </p>
  1088. <ul style="margin-top:0px">
  1089. <li>if res[15:0] &ge; 0 then APSR.GE[1:0] = 11 else 00</li>
  1090. <li>if res[31:16] &ge; 0 then APSR.GE[3:2] = 11 else 00</li>
  1091. </ul>
  1092. </td>
  1093. </tr>
  1094. <tr>
  1095. <td><b>Operation</b></td>
  1096. <td>
  1097. <pre style="margin-left:0px">
  1098. res[15:0] = val1[15:0] + val2[15:0]
  1099. res[31:16] = val1[31:16] + val2[31:16]</pre>
  1100. </td>
  1101. </tr>
  1102. </tbody>
  1103. </table>
  1104. <h3><a name="__QADD16"></a>Function __QADD16</h3>
  1105. <table border="0" cellpadding="5" cellspacing="5">
  1106. <tbody>
  1107. <tr>
  1108. <td><b>Summary</b></td>
  1109. <td>
  1110. <pre style="margin-left:0px">
  1111. uint32_t __QADD16(uint32_t val1, uint32_t val2);</pre>
  1112. </td>
  1113. </tr>
  1114. <tr>
  1115. <td><b>Description</b></td>
  1116. <td>This function enables you to perform two 16-bit integer arithmetic additions in parallel,
  1117. saturating the results to the 16-bit signed integer range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  1118. </td>
  1119. </tr>
  1120. <tr>
  1121. <td><b>Parameter</b></td>
  1122. <td>
  1123. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1124. <li><b>val1</b>: first two 16-bit summands.</li>
  1125. <li><b>val2</b>: second two 16-bit summands.</li>
  1126. </ul>
  1127. </td>
  1128. </tr>
  1129. <tr>
  1130. <td><b>Return Value</b></td>
  1131. <td>
  1132. <p>The function returns:</p>
  1133. <ul style="margin-top:0px">
  1134. <li>the saturated addition of the low halfwords in the low halfword of the return value.</li>
  1135. <li>the saturated addition of the high halfwords in the high halfword of the return value.</li>
  1136. </ul>
  1137. <p>The returned results are saturated to the 16-bit signed integer
  1138. range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1
  1139. </p>
  1140. </td>
  1141. </tr>
  1142. <tr>
  1143. <td><b>Operation</b></td>
  1144. <td>
  1145. <pre style="margin-left:0px">
  1146. res[15:0] = val1[15:0] + val2[15:0]
  1147. res[16:31] = val1[31:16] + val2[31:16]</pre>
  1148. </td>
  1149. </tr>
  1150. </tbody>
  1151. </table>
  1152. <h3><a name="__SHADD16"></a>Function __SHADD16</h3>
  1153. <table border="0" cellpadding="5" cellspacing="5">
  1154. <tbody>
  1155. <tr>
  1156. <td><b>Summary</b></td>
  1157. <td>
  1158. <pre style="margin-left:0px">
  1159. uint32_t __SHADD16(uint32_t val1, uint32_t val2);</pre>
  1160. </td>
  1161. </tr>
  1162. <tr>
  1163. <td><b>Description</b></td>
  1164. <td>This function enables you to perform two signed 16-bit integer additions, halving the
  1165. results.
  1166. </td>
  1167. </tr>
  1168. <tr>
  1169. <td><b>Parameter</b></td>
  1170. <td>
  1171. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1172. <li><b>val1</b>: first two 16-bit summands.</li>
  1173. <li><b>val2</b>: second two 16-bit summands.</li>
  1174. </ul>
  1175. </td>
  1176. </tr>
  1177. <tr>
  1178. <td><b>Return Value</b></td>
  1179. <td>
  1180. <p>The function returns:</p>
  1181. <ul style="margin-top:0px">
  1182. <li>the halved addition of the low halfwords from each operand, in the low halfword
  1183. of the return value.</li>
  1184. <li>the halved addition of the high halfwords from each operand, in the high halfword
  1185. of the return value.</li>
  1186. </ul>
  1187. </td>
  1188. </tr>
  1189. <tr>
  1190. <td><b>Operation</b></td>
  1191. <td>
  1192. <pre style="margin-left:0px">
  1193. res[15:0] = (val1[15:0] + val2[15:0]) &gt;&gt; 1
  1194. res[31:16] = (val1[31:16] + val2[31:16]) &gt;&gt; 1</pre>
  1195. </td>
  1196. </tr>
  1197. </tbody>
  1198. </table>
  1199. <h3><a name="__UADD16"></a>Function __UADD16</h3>
  1200. <table border="0" cellpadding="5" cellspacing="5">
  1201. <tbody>
  1202. <tr>
  1203. <td><b>Summary</b></td>
  1204. <td>
  1205. <pre style="margin-left:0px">
  1206. uint32_t __UADD16(uint32_t val1, uint32_t val2);</pre>
  1207. </td>
  1208. </tr>
  1209. <tr>
  1210. <td><b>Description</b></td>
  1211. <td>This function enables you to perform two 16-bit unsigned integer additions.<br>
  1212. The GE bits in the APSR are set according to the results.
  1213. </td>
  1214. </tr>
  1215. <tr>
  1216. <td><b>Parameter</b></td>
  1217. <td>
  1218. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1219. <li><b>val1</b>: first two 16-bit summands for each addition.</li>
  1220. <li><b>val2</b>: second two 16-bit summands for each addition.</li>
  1221. </ul>
  1222. </td>
  1223. </tr>
  1224. <tr>
  1225. <td><b>Return Value</b></td>
  1226. <td>
  1227. <p>The function returns:</p>
  1228. <ul style="margin-top:0px">
  1229. <li>the addition of the low halfwords in each operand, in the low halfword of the
  1230. return value.</li>
  1231. <li>the addition of the high halfwords in each operand, in the high halfword of the
  1232. return value.</li>
  1233. </ul>
  1234. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  1235. the results of the operation.<br>
  1236. If <i>res</i> is the return value, then:
  1237. </p>
  1238. <ul style="margin-top:0px">
  1239. <li>if res[15:0] &ge; 0x10000 then APSR.GE[0] = 11 else 00</li>
  1240. <li>if res[31:16] &ge; 0x10000 then APSR.GE[1] = 11 else 00</li>
  1241. </ul>
  1242. </td>
  1243. </tr>
  1244. <tr>
  1245. <td><b>Operation</b></td>
  1246. <td>
  1247. <pre style="margin-left:0px">
  1248. res[15:0] = val1[15:0] + val2[15:0]
  1249. res[31:16] = val1[31:16] + val2[31:16]</pre>
  1250. </td>
  1251. </tr>
  1252. </tbody>
  1253. </table>
  1254. <h3><a name="__UQADD16"></a>Function __UQADD16</h3>
  1255. <table border="0" cellpadding="5" cellspacing="5">
  1256. <tbody>
  1257. <tr>
  1258. <td><b>Summary</b></td>
  1259. <td>
  1260. <pre style="margin-left:0px">
  1261. uint32_t __UQADD16(uint32_t val1, uint32_t val2);</pre>
  1262. </td>
  1263. </tr>
  1264. <tr>
  1265. <td><b>Description</b></td>
  1266. <td>This function enables you to perform two unsigned 16-bit integer additions, saturating the
  1267. results to the 16-bit unsigned integer range 0 &le; x &le; 2<sup>16</sup> - 1.
  1268. </td>
  1269. </tr>
  1270. <tr>
  1271. <td><b>Parameter</b></td>
  1272. <td>
  1273. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1274. <li><b>val1</b>: first two 16-bit summands.</li>
  1275. <li><b>val2</b>: second two 16-bit summands.</li>
  1276. </ul>
  1277. </td>
  1278. </tr>
  1279. <tr>
  1280. <td><b>Return Value</b></td>
  1281. <td>
  1282. <p>The function returns:</p>
  1283. <ul style="margin-top:0px">
  1284. <li>the addition of the low halfword in the first operand and the low halfword in the
  1285. second operand, in the low halfword of the return value.</li>
  1286. <li>the addition of the high halfword in the first operand and the high halfword in the
  1287. second operand, in the high halfword of the return value.</li>
  1288. </ul>
  1289. <p>The results are saturated to the 16-bit unsigned integer
  1290. range 0 &le; x &le; 2<sup>16</sup> - 1.
  1291. </p>
  1292. </td>
  1293. </tr>
  1294. <tr>
  1295. <td><b>Operation</b></td>
  1296. <td>
  1297. <pre style="margin-left:0px">
  1298. res[15:0] = val1[15:0] + val2[15:0]
  1299. res[31:16] = val1[31:16] + val2[31:16]</pre>
  1300. </td>
  1301. </tr>
  1302. </tbody>
  1303. </table>
  1304. <h3><a name="__UHADD16"></a>Function __UHADD16</h3>
  1305. <table border="0" cellpadding="5" cellspacing="5">
  1306. <tbody>
  1307. <tr>
  1308. <td><b>Summary</b></td>
  1309. <td>
  1310. <pre style="margin-left:0px">
  1311. uint32_t __UHADD16(uint32_t val1, uint32_t val2);</pre>
  1312. </td>
  1313. </tr>
  1314. <tr>
  1315. <td><b>Description</b></td>
  1316. <td>This function enables you to perform two unsigned 16-bit integer additions, halving the
  1317. results.
  1318. </td>
  1319. </tr>
  1320. <tr>
  1321. <td><b>Parameter</b></td>
  1322. <td>
  1323. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1324. <li><b>val1</b>: first two 16-bit summands.</li>
  1325. <li><b>val2</b>: second two 16-bit summands.</li>
  1326. </ul>
  1327. </td>
  1328. </tr>
  1329. <tr>
  1330. <td><b>Return Value</b></td>
  1331. <td>
  1332. <p>The function returns:</p>
  1333. <ul style="margin-top:0px">
  1334. <li>the halved addition of the low halfwords in each operand, in the low halfword of
  1335. the return value.</li>
  1336. <li>the halved addition of the high halfwords in each operand, in the high halfword
  1337. of the return value.</li>
  1338. </ul>
  1339. </td>
  1340. </tr>
  1341. <tr>
  1342. <td><b>Operation</b></td>
  1343. <td>
  1344. <pre style="margin-left:0px">
  1345. res[15:0] = (val1[15:0] + val2[15:0]) &gt;&gt; 1
  1346. res[31:16] = (val1[31:16] + val2[31:16]) &gt;&gt; 1</pre>
  1347. </td>
  1348. </tr>
  1349. </tbody>
  1350. </table>
  1351. <h3><a name="__SSUB16"></a>Function __SSUB16</h3>
  1352. <table border="0" cellpadding="5" cellspacing="5">
  1353. <tbody>
  1354. <tr>
  1355. <td><b>Summary</b></td>
  1356. <td>
  1357. <pre style="margin-left:0px">
  1358. uint32_t __SSUB16(uint32_t val1, uint32_t val2);</pre>
  1359. </td>
  1360. </tr>
  1361. <tr>
  1362. <td><b>Description</b></td>
  1363. <td>This function enables you to perform two 16-bit signed integer subtractions.<br>
  1364. The GE bits in the APSR are set according to the results.
  1365. </td>
  1366. </tr>
  1367. <tr>
  1368. <td><b>Parameter</b></td>
  1369. <td>
  1370. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1371. <li><b>val1</b>: first two 16-bit operands of each subtraction.</li>
  1372. <li><b>val2</b>: second two 16-bit operands of each subtraction.</li>
  1373. </ul>
  1374. </td>
  1375. </tr>
  1376. <tr>
  1377. <td><b>Return Value</b></td>
  1378. <td>
  1379. <p>The function returns:</p>
  1380. <ul style="margin-top:0px">
  1381. <li>the subtraction of the low halfword in the second operand from the low halfword
  1382. in the first operand, in the low halfword of the return value.</li>
  1383. <li>the subtraction of the high halfword in the second operand from the high halfword
  1384. in the first operand, in the high halfword of the return value.</li>
  1385. </ul>
  1386. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  1387. the results of the operation.<br>
  1388. If <i>res</i> is the return value, then:
  1389. </p>
  1390. <ul style="margin-top:0px">
  1391. <li>if res[15:0] &ge; 0 then APSR.GE[1:0] = 11 else 00</li>
  1392. <li>if res[31:16] &ge; 0 then APSR.GE[3:2] = 11 else 00</li>
  1393. </ul>
  1394. </td>
  1395. </tr>
  1396. <tr>
  1397. <td><b>Operation</b></td>
  1398. <td>
  1399. <pre style="margin-left:0px">
  1400. res[15:0] = val1[15:0] - val2[15:0]
  1401. res[31:16] = val1[31:16] - val2[31:16]</pre>
  1402. </td>
  1403. </tr>
  1404. </tbody>
  1405. </table>
  1406. <h3><a name="__QSUB16"></a>Function __QSUB16</h3>
  1407. <table border="0" cellpadding="5" cellspacing="5">
  1408. <tbody>
  1409. <tr>
  1410. <td><b>Summary</b></td>
  1411. <td>
  1412. <pre style="margin-left:0px">
  1413. uint32_t __QSUB16(uint32_t val1, uint32_t val2);</pre>
  1414. </td>
  1415. </tr>
  1416. <tr>
  1417. <td><b>Description</b></td>
  1418. <td>This function enables you to perform two 16-bit integer subtractions, saturating the
  1419. results to the 16-bit signed integer range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  1420. </td>
  1421. </tr>
  1422. <tr>
  1423. <td><b>Parameter</b></td>
  1424. <td>
  1425. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1426. <li><b>val1</b>: first two 16-bit operands.</li>
  1427. <li><b>val2</b>: second two 16-bit operands.</li>
  1428. </ul>
  1429. </td>
  1430. </tr>
  1431. <tr>
  1432. <td><b>Return Value</b></td>
  1433. <td>
  1434. <p>The function returns:</p>
  1435. <ul style="margin-top:0px">
  1436. <li>the saturated subtraction of the low halfword in the second operand from the low
  1437. halfword in the first operand, in the low halfword of the returned result.</li>
  1438. <li>the saturated subtraction of the high halfword in the second operand from the high
  1439. halfword in the first operand, in the high halfword of the returned result.</li>
  1440. </ul>
  1441. <p>The returned results are saturated to the 16-bit signed integer
  1442. range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  1443. </p>
  1444. </td>
  1445. </tr>
  1446. <tr>
  1447. <td><b>Operation</b></td>
  1448. <td>
  1449. <pre style="margin-left:0px">
  1450. res[15:0] = val1[15:0] - val2[15:0]
  1451. res[31:16] = val1[31:16] - val2[31:16]</pre>
  1452. </td>
  1453. </tr>
  1454. </tbody>
  1455. </table>
  1456. <h3><a name="__SHSUB16"></a>Function __SHSUB16</h3>
  1457. <table border="0" cellpadding="5" cellspacing="5">
  1458. <tbody>
  1459. <tr>
  1460. <td><b>Summary</b></td>
  1461. <td>
  1462. <pre style="margin-left:0px">
  1463. uint32_t __SHSUB16(uint32_t val1, uint32_t val2);</pre>
  1464. </td>
  1465. </tr>
  1466. <tr>
  1467. <td><b>Description</b></td>
  1468. <td>This function enables you to perform two signed 16-bit integer subtractions, halving the
  1469. results.
  1470. </td>
  1471. </tr>
  1472. <tr>
  1473. <td><b>Parameter</b></td>
  1474. <td>
  1475. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1476. <li><b>val1</b>: first two 16-bit operands.</li>
  1477. <li><b>val2</b>: second two 16-bit operands.</li>
  1478. </ul>
  1479. </td>
  1480. </tr>
  1481. <tr>
  1482. <td><b>Return Value</b></td>
  1483. <td>
  1484. <p>The function returns:</p>
  1485. <ul style="margin-top:0px">
  1486. <li>the halved subtraction of the low halfword in the second operand from the low
  1487. halfword in the first operand, in the low halfword of the return value.</li>
  1488. <li>the halved subtraction of the high halfword in the second operand from the high
  1489. halfword in the first operand, in the high halfword of the return value.</li>
  1490. </ul>
  1491. </td>
  1492. </tr>
  1493. <tr>
  1494. <td><b>Operation</b></td>
  1495. <td>
  1496. <pre style="margin-left:0px">
  1497. res[15:0] = (val1[15:0] - val2[15:0]) &gt;&gt; 1
  1498. res[31:16] = (val1[31:16] - val2[31:16]) &gt;&gt; 1</pre>
  1499. </td>
  1500. </tr>
  1501. </tbody>
  1502. </table>
  1503. <h3><a name="__USUB16"></a>Function __USUB16</h3>
  1504. <table border="0" cellpadding="5" cellspacing="5">
  1505. <tbody>
  1506. <tr>
  1507. <td><b>Summary</b></td>
  1508. <td>
  1509. <pre style="margin-left:0px">
  1510. uint32_t __USUB16(uint32_t val1, uint32_t val2);</pre>
  1511. </td>
  1512. </tr>
  1513. <tr>
  1514. <td><b>Description</b></td>
  1515. <td>This function enables you to perform two 16-bit unsigned integer subtractions.<br>
  1516. The GE bits in the APSR are set according to the results.
  1517. </td>
  1518. </tr>
  1519. <tr>
  1520. <td><b>Parameter</b></td>
  1521. <td>
  1522. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1523. <li><b>val1</b>: first two 16-bit operands.</li>
  1524. <li><b>val2</b>: second two 16-bit operands.</li>
  1525. </ul>
  1526. </td>
  1527. </tr>
  1528. <tr>
  1529. <td><b>Return Value</b></td>
  1530. <td>
  1531. <p>The function returns:</p>
  1532. <ul style="margin-top:0px">
  1533. <li>the subtraction of the low halfword in the second operand from the low halfword
  1534. in the first operand, in the low halfword of the return value.</li>
  1535. <li>the subtraction of the high halfword in the second operand from the high halfword
  1536. in the first operand, in the high halfword of the return value.</li>
  1537. </ul>
  1538. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  1539. the results of the operation.<br>
  1540. If <i>res</i> is the return value, then:
  1541. </p>
  1542. <ul style="margin-top:0px">
  1543. <li>if res[15:0] &ge; 0 then APSR.GE[1:0] = 11 else 00</li>
  1544. <li>if res[31:16] &ge; 0 then APSR.GE[3:2] = 11 else 00</li>
  1545. </ul>
  1546. </td>
  1547. </tr>
  1548. <tr>
  1549. <td><b>Operation</b></td>
  1550. <td>
  1551. <pre style="margin-left:0px">
  1552. res[15:0] = val1[15:0] - val2[15:0]
  1553. res[31:16] = val1[31:16] - val2[31:16]</pre>
  1554. </td>
  1555. </tr>
  1556. </tbody>
  1557. </table>
  1558. <h3><a name="__UQSUB16"></a>Function __UQSUB16</h3>
  1559. <table border="0" cellpadding="5" cellspacing="5">
  1560. <tbody>
  1561. <tr>
  1562. <td><b>Summary</b></td>
  1563. <td>
  1564. <pre style="margin-left:0px">
  1565. uint32_t __UQSUB16(uint32_t val1, uint32_t val2);</pre>
  1566. </td>
  1567. </tr>
  1568. <tr>
  1569. <td><b>Description</b></td>
  1570. <td>This function enables you to perform two unsigned 16-bit integer subtractions, saturating
  1571. the results to the 16-bit unsigned integer range 0 &le; x &le; 2<sup>16</sup> - 1.
  1572. </td>
  1573. </tr>
  1574. <tr>
  1575. <td><b>Parameter</b></td>
  1576. <td>
  1577. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1578. <li><b>val1</b>: first two 16-bit operands for each subtraction.</li>
  1579. <li><b>val2</b>: second two 16-bit operands for each subtraction.</li>
  1580. </ul>
  1581. </td>
  1582. </tr>
  1583. <tr>
  1584. <td><b>Return Value</b></td>
  1585. <td>
  1586. <p>The function returns:</p>
  1587. <ul style="margin-top:0px">
  1588. <li>the subtraction of the low halfword in the second operand from the low halfword
  1589. in the first operand, in the low halfword of the return value.</li>
  1590. <li>the subtraction of the high halfword in the second operand from the high halfword
  1591. in the first operand, in the high halfword of the return value.</li>
  1592. </ul>
  1593. <p>The results are saturated to the 16-bit unsigned integer range 0 &le; x &le; 2<sup>16</sup> - 1.
  1594. </p>
  1595. </td>
  1596. </tr>
  1597. <tr>
  1598. <td><b>Operation</b></td>
  1599. <td>
  1600. <pre style="margin-left:0px">
  1601. res[15:0] = val1[15:0] - val2[15:0]
  1602. res[31:16] = val1[31:16] - val2[31:16]</pre>
  1603. </td>
  1604. </tr>
  1605. </tbody>
  1606. </table>
  1607. <h3><a name="__UHSUB16"></a>Function __UHSUB16</h3>
  1608. <table border="0" cellpadding="5" cellspacing="5">
  1609. <tbody>
  1610. <tr>
  1611. <td><b>Summary</b></td>
  1612. <td>
  1613. <pre style="margin-left:0px">
  1614. uint32_t __UHSUB16(uint32_t val1, uint32_t val2);</pre>
  1615. </td>
  1616. </tr>
  1617. <tr>
  1618. <td><b>Description</b></td>
  1619. <td>This function enables you to perform two unsigned 16-bit integer subtractions, halving
  1620. the results.
  1621. </td>
  1622. </tr>
  1623. <tr>
  1624. <td><b>Parameter</b></td>
  1625. <td>
  1626. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1627. <li><b>val1</b>: first two 16-bit operands.</li>
  1628. <li><b>val2</b>: second two 16-bit operands.</li>
  1629. </ul>
  1630. </td>
  1631. </tr>
  1632. <tr>
  1633. <td><b>Return Value</b></td>
  1634. <td>
  1635. <p>The function returns:</p>
  1636. <ul style="margin-top:0px">
  1637. <li>the halved subtraction of the low halfword in the second operand from the low
  1638. halfword in the first operand, in the low halfword of the return value.</li>
  1639. <li>the halved subtraction of the high halfword in the second operand from the high
  1640. halfword in the first operand, in the high halfword of the return value.</li>
  1641. </ul>
  1642. </td>
  1643. </tr>
  1644. <tr>
  1645. <td><b>Operation</b></td>
  1646. <td>
  1647. <pre style="margin-left:0px">
  1648. res[15:0] = (val1[15:0] - val2[15:0]) &gt;&gt; 1
  1649. res[31:16] = (val1[31:16] - val2[31:16]) &gt;&gt; 1</pre>
  1650. </td>
  1651. </tr>
  1652. </tbody>
  1653. </table>
  1654. <h3><a name="__SASX"></a>Function __SASX</h3>
  1655. <table border="0" cellpadding="5" cellspacing="5">
  1656. <tbody>
  1657. <tr>
  1658. <td><b>Summary</b></td>
  1659. <td>
  1660. <pre style="margin-left:0px">
  1661. uint32_t __SASX(uint32_t val1, uint32_t val2);</pre>
  1662. </td>
  1663. </tr>
  1664. <tr>
  1665. <td><b>Description</b></td>
  1666. <td>This function inserts an SASX instruction into the instruction stream generated by the
  1667. compiler. It enables you to exchange the halfwords of the second operand, add the high
  1668. halfwords and subtract the low halfwords.<br>
  1669. The GE bits in the APRS are set according to the results.
  1670. </td>
  1671. </tr>
  1672. <tr>
  1673. <td><b>Parameter</b></td>
  1674. <td>
  1675. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1676. <li><b>val1</b>: first operand for the subtraction in the low halfword, and the
  1677. first operand for the addition in the high halfword.</li>
  1678. <li><b>val2</b>: second operand for the subtraction in the high halfword, and the
  1679. second operand for the addition in the low halfword.</li>
  1680. </ul>
  1681. </td>
  1682. </tr>
  1683. <tr>
  1684. <td><b>Return Value</b></td>
  1685. <td>
  1686. <p>The function returns:</p>
  1687. <ul style="margin-top:0px">
  1688. <li>the subtraction of the high halfword in the second operand from the low halfword
  1689. in the first operand, in the low halfword of the return value.</li>
  1690. <li>the addition of the high halfword in the first operand and the low halfword in the
  1691. second operand, in the high halfword of the return value.</li>
  1692. </ul>
  1693. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  1694. the results of the operation.<br>
  1695. If <i>res</i> is the return value, then:
  1696. </p>
  1697. <ul style="margin-top:0px">
  1698. <li>if res[15:0] &ge; 0 then APSR.GE[1:0] = 11 else 00</li>
  1699. <li>if res[31:16] &ge; 0 then APSR.GE[3:2] = 11 else 00</li>
  1700. </ul>
  1701. </td>
  1702. </tr>
  1703. <tr>
  1704. <td><b>Operation</b></td>
  1705. <td>
  1706. <pre style="margin-left:0px">
  1707. res[15:0] = val1[15:0] - val2[31:16]
  1708. res[31:16] = val1[31:16] + val2[15:0]</pre>
  1709. </td>
  1710. </tr>
  1711. </tbody>
  1712. </table>
  1713. <h3><a name="__QASX"></a>Function __QASX</h3>
  1714. <table border="0" cellpadding="5" cellspacing="5">
  1715. <tbody>
  1716. <tr>
  1717. <td><b>Summary</b></td>
  1718. <td>
  1719. <pre style="margin-left:0px">
  1720. uint32_t __QASX(uint32_t val1, uint32_t val2);</pre>
  1721. </td>
  1722. </tr>
  1723. <tr>
  1724. <td><b>Description</b></td>
  1725. <td>This function enables you to exchange the halfwords of the one operand, then add the high
  1726. halfwords and subtract the low halfwords, saturating the results to the 16-bit signed
  1727. integer range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  1728. </td>
  1729. </tr>
  1730. <tr>
  1731. <td><b>Parameter</b></td>
  1732. <td>
  1733. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1734. <li><b>val1</b>: first operand for the subtraction in the low halfword, and the
  1735. first operand for the addition in the high halfword.</li>
  1736. <li><b>val2</b>: second operand for the subtraction in the high halfword, and the
  1737. second operand for the addition in the low halfword.</li>
  1738. </ul>
  1739. </td>
  1740. </tr>
  1741. <tr>
  1742. <td><b>Return Value</b></td>
  1743. <td>
  1744. <p>The function returns:</p>
  1745. <ul style="margin-top:0px">
  1746. <li>the saturated subtraction of the high halfword in the second operand from the low
  1747. halfword in the first operand, in the low halfword of the return value.</li>
  1748. <li>the saturated addition of the high halfword in the first operand and the low
  1749. halfword in the second operand, in the high halfword of the return value.</li>
  1750. </ul>
  1751. <p>The returned results are saturated to the 16-bit signed integer
  1752. range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  1753. </p>
  1754. </td>
  1755. </tr>
  1756. <tr>
  1757. <td><b>Operation</b></td>
  1758. <td>
  1759. <pre style="margin-left:0px">
  1760. res[15:0] = val1[15:0] - val2[31:16]
  1761. res[31:16] = val1[31:16] + val2[15:0]</pre>
  1762. </td>
  1763. </tr>
  1764. </tbody>
  1765. </table>
  1766. <h3><a name="__SHASX"></a>Function __SHASX</h3>
  1767. <table border="0" cellpadding="5" cellspacing="5">
  1768. <tbody>
  1769. <tr>
  1770. <td><b>Summary</b></td>
  1771. <td>
  1772. <pre style="margin-left:0px">
  1773. uint32_t __SHASX(uint32_t val1, uint32_t val2);</pre>
  1774. </td>
  1775. </tr>
  1776. <tr>
  1777. <td><b>Description</b></td>
  1778. <td>This function enables you to exchange the two halfwords of one operand, perform one
  1779. signed 16-bit integer addition and one signed 16-bit subtraction, and halve the results.
  1780. </td>
  1781. </tr>
  1782. <tr>
  1783. <td><b>Parameter</b></td>
  1784. <td>
  1785. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1786. <li><b>val1</b>: first 16-bit operands.</li>
  1787. <li><b>val2</b>: second 16-bit operands.</li>
  1788. </ul>
  1789. </td>
  1790. </tr>
  1791. <tr>
  1792. <td><b>Return Value</b></td>
  1793. <td>
  1794. <p>The function returns:</p>
  1795. <ul style="margin-top:0px">
  1796. <li>the halved subtraction of the high halfword in the second operand from the low
  1797. halfword in the first operand, in the low halfword of the return value.</li>
  1798. <li>the halved subtraction of the low halfword in the second operand from the high
  1799. halfword in the first operand, in the high halfword of the return value.</li>
  1800. </ul>
  1801. </td>
  1802. </tr>
  1803. <tr>
  1804. <td><b>Operation</b></td>
  1805. <td>
  1806. <pre style="margin-left:0px">
  1807. res[15:0] = (val1[15:0] - val2[31:16]) &gt;&gt; 1
  1808. res[31:16] = (val1[31:16] - val2[15:0]) &gt;&gt; 1</pre>
  1809. </td>
  1810. </tr>
  1811. </tbody>
  1812. </table>
  1813. <h3><a name="__UASX"></a>Function __UASX</h3>
  1814. <table border="0" cellpadding="5" cellspacing="5">
  1815. <tbody>
  1816. <tr>
  1817. <td><b>Summary</b></td>
  1818. <td>
  1819. <pre style="margin-left:0px">
  1820. uint32_t __UASX(uint32_t val1, uint32_t val2);</pre>
  1821. </td>
  1822. </tr>
  1823. <tr>
  1824. <td><b>Description</b></td>
  1825. <td>This function enables you to exchange the two halfwords of the second operand, add the
  1826. high halfwords and subtract the low halfwords.<br>
  1827. The GE bits in the APSR are set according to the results.
  1828. </td>
  1829. </tr>
  1830. <tr>
  1831. <td><b>Parameter</b></td>
  1832. <td>
  1833. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1834. <li><b>val1</b>: first operand for the subtraction in the low halfword, and the
  1835. first operand for the addition in the high halfword.</li>
  1836. <li><b>val2</b>: second operand for the subtraction in the high halfword and the
  1837. second operand for the addition in the low halfword.</li>
  1838. </ul>
  1839. </td>
  1840. </tr>
  1841. <tr>
  1842. <td><b>Return Value</b></td>
  1843. <td>
  1844. <p>The function returns:</p>
  1845. <ul style="margin-top:0px">
  1846. <li>the subtraction of the high halfword in the second operand from the low halfword
  1847. in the first operand, in the low halfword of the return value.</li>
  1848. <li>the addition of the high halfword in the first operand and the low halfword in the
  1849. second operand, in the high halfword of the return value.</li>
  1850. </ul>
  1851. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  1852. the results of the operation.<br>
  1853. If <i>res</i> is the return value, then:
  1854. </p>
  1855. <ul style="margin-top:0px">
  1856. <li>if res[15:0] &ge; 0 then APSR.GE[1:0] = 11 else 00</li>
  1857. <li>if res[31:16] &ge; 0x10000 then APSR.GE[3:2] = 11 else 00</li>
  1858. </ul>
  1859. </td>
  1860. </tr>
  1861. <tr>
  1862. <td><b>Operation</b></td>
  1863. <td>
  1864. <pre style="margin-left:0px">
  1865. res[15:0] = val1[15:0] - val2[31:16]
  1866. res[31:16] = val1[31:16] + val2[15:0]</pre>
  1867. </td>
  1868. </tr>
  1869. </tbody>
  1870. </table>
  1871. <h3><a name="__UQASX"></a>Function __UQASX</h3>
  1872. <table border="0" cellpadding="5" cellspacing="5">
  1873. <tbody>
  1874. <tr>
  1875. <td><b>Summary</b></td>
  1876. <td>
  1877. <pre style="margin-left:0px">
  1878. uint32_t __UQASX(uint32_t val1, uint32_t val2);</pre>
  1879. </td>
  1880. </tr>
  1881. <tr>
  1882. <td><b>Description</b></td>
  1883. <td>This function enables you to exchange the halfwords of the second operand and perform
  1884. one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, saturating the
  1885. results to the 16-bit unsigned integer range 0 &le; x &le; 2<sup>16</sup> - 1.
  1886. </td>
  1887. </tr>
  1888. <tr>
  1889. <td><b>Parameter</b></td>
  1890. <td>
  1891. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1892. <li><b>val1</b>: first two 16-bit operands.</li>
  1893. <li><b>val2</b>: second two 16-bit operands.</li>
  1894. </ul>
  1895. </td>
  1896. </tr>
  1897. <tr>
  1898. <td><b>Return Value</b></td>
  1899. <td>
  1900. <p>The function returns:</p>
  1901. <ul style="margin-top:0px">
  1902. <li>the subtraction of the high halfword in the second operand from the low halfword
  1903. in the first operand, in the low halfword of the return value.</li>
  1904. <li>the subtraction of the low halfword in the second operand from the high halfword
  1905. in the first operand, in the high halfword of the return value.</li>
  1906. </ul>
  1907. <p>The results are saturated to the 16-bit unsigned integer
  1908. range 0 &le; x &le; 2<sup>16</sup> - 1.
  1909. </p>
  1910. </td>
  1911. </tr>
  1912. <tr>
  1913. <td><b>Operation</b></td>
  1914. <td>
  1915. <pre style="margin-left:0px">
  1916. res[15:0] = val1[15:0] - val2[31:16]
  1917. res[31:16] = val1[31:16] + val2[15:0]</pre>
  1918. </td>
  1919. </tr>
  1920. </tbody>
  1921. </table>
  1922. <h3><a name="__UHASX"></a>Function __UHASX</h3>
  1923. <table border="0" cellpadding="5" cellspacing="5">
  1924. <tbody>
  1925. <tr>
  1926. <td><b>Summary</b></td>
  1927. <td>
  1928. <pre style="margin-left:0px">
  1929. uint32_t __UHASX(uint32_t val1, uint32_t val2);</pre>
  1930. </td>
  1931. </tr>
  1932. <tr>
  1933. <td><b>Description</b></td>
  1934. <td>This function enables you to exchange the halfwords of the second operand, add the high
  1935. halfwords and subtract the low halfwords, halving the results.
  1936. </td>
  1937. </tr>
  1938. <tr>
  1939. <td><b>Parameter</b></td>
  1940. <td>
  1941. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1942. <li><b>val1</b>: first operand for the subtraction in the low halfword, and the
  1943. first operand for the addition in the high halfword.</li>
  1944. <li><b>val2</b>: second operand for the subtraction in the high halfword, and the
  1945. second operand for the addition in the low halfword.</li>
  1946. </ul>
  1947. </td>
  1948. </tr>
  1949. <tr>
  1950. <td><b>Return Value</b></td>
  1951. <td>
  1952. <p>The function returns:</p>
  1953. <ul style="margin-top:0px">
  1954. <li>the halved subtraction of the high halfword in the second operand from the low
  1955. halfword in the first operand.</li>
  1956. <li>the halved addition of the high halfword in the first operand and the low halfword
  1957. in the second operand.</li>
  1958. </ul>
  1959. </td>
  1960. </tr>
  1961. <tr>
  1962. <td><b>Operation</b></td>
  1963. <td>
  1964. <pre style="margin-left:0px">
  1965. res[15:0] = (val1[15:0] - val2[31:16]) &gt;&gt; 1
  1966. res[31:16] = (val1[31:16] + val2[15:0]) &gt;&gt; 1</pre>
  1967. </td>
  1968. </tr>
  1969. </tbody>
  1970. </table>
  1971. <h3><a name="__SSAX"></a>Function __SSAX</h3>
  1972. <table border="0" cellpadding="5" cellspacing="5">
  1973. <tbody>
  1974. <tr>
  1975. <td><b>Summary</b></td>
  1976. <td>
  1977. <pre style="margin-left:0px">
  1978. uint32_t __SSAX(uint32_t val1, uint32_t val2);</pre>
  1979. </td>
  1980. </tr>
  1981. <tr>
  1982. <td><b>Description</b></td>
  1983. <td>This function enables you to exchange the two halfwords of one operand and perform one
  1984. 16-bit integer subtraction and one 16-bit addition.<br>
  1985. The GE bits in the APSR are set according to the results.
  1986. </td>
  1987. </tr>
  1988. <tr>
  1989. <td><b>Parameter</b></td>
  1990. <td>
  1991. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  1992. <li><b>val1</b>: first operand for the addition in the low halfword, and the first
  1993. operand for the subtraction in the high halfword.</li>
  1994. <li><b>val2</b>: second operand for the addition in the high halfword, and the
  1995. second operand for the subtraction in the low halfword.</li>
  1996. </ul>
  1997. </td>
  1998. </tr>
  1999. <tr>
  2000. <td><b>Return Value</b></td>
  2001. <td>
  2002. <p>The function returns:</p>
  2003. <ul style="margin-top:0px">
  2004. <li>the addition of the low halfword in the first operand and the high halfword in the
  2005. second operand, in the low halfword of the return value.</li>
  2006. <li>the subtraction of the low halfword in the second operand from the high halfword
  2007. in the first operand, in the high halfword of the return value.</li>
  2008. </ul>
  2009. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  2010. the results of the operation.<br>
  2011. If <i>res</i> is the return value, then:
  2012. </p>
  2013. <ul style="margin-top:0px">
  2014. <li>if res[15:0] &ge; 0 then APSR.GE[1:0] = 11 else 00</li>
  2015. <li>if res[31:16] &ge; 0 then APSR.GE[3:2] = 11 else 00</li>
  2016. </ul>
  2017. </td>
  2018. </tr>
  2019. <tr>
  2020. <td><b>Operation</b></td>
  2021. <td>
  2022. <pre style="margin-left:0px">
  2023. res[15:0] = val1[15:0] + val2[31:16]
  2024. res[31:16] = val1[31:16] - val2[15:0]</pre>
  2025. </td>
  2026. </tr>
  2027. </tbody>
  2028. </table>
  2029. <h3><a name="__QSAX"></a>Function __QSAX</h3>
  2030. <table border="0" cellpadding="5" cellspacing="5">
  2031. <tbody>
  2032. <tr>
  2033. <td><b>Summary</b></td>
  2034. <td>
  2035. <pre style="margin-left:0px">
  2036. uint32_t __QSAX(uint32_t val1, uint32_t val2);</pre>
  2037. </td>
  2038. </tr>
  2039. <tr>
  2040. <td><b>Description</b></td>
  2041. <td>This function enables you to exchange the halfwords of one operand, then subtract the
  2042. high halfwords and add the low halfwords, saturating the results to the 16-bit signed
  2043. integer range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  2044. </td>
  2045. </tr>
  2046. <tr>
  2047. <td><b>Parameter</b></td>
  2048. <td>
  2049. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2050. <li><b>val1</b>: first operand for the addition in the low halfword, and the first
  2051. operand for the subtraction in the high halfword.</li>
  2052. <li><b>val2</b>: second operand for the addition in the high halfword, and the
  2053. second operand for the subtraction in the low halfword.</li>
  2054. </ul>
  2055. </td>
  2056. </tr>
  2057. <tr>
  2058. <td><b>Return Value</b></td>
  2059. <td>
  2060. <p>The function returns:</p>
  2061. <ul style="margin-top:0px">
  2062. <li>the saturated addition of the low halfword of the first operand and the high
  2063. halfword of the second operand, in the low halfword of the return value.</li>
  2064. <li>the saturated subtraction of the low halfword of the second operand from the high
  2065. halfword of the first operand, in the high halfword of the return value.</li>
  2066. </ul>
  2067. <p>The returned results are saturated to the 16-bit signed integer
  2068. range -2<sup>15</sup> &le; x &le; 2<sup>15</sup> - 1.
  2069. </p>
  2070. </td>
  2071. </tr>
  2072. <tr>
  2073. <td><b>Operation</b></td>
  2074. <td>
  2075. <pre style="margin-left:0px">
  2076. res[15:0] = val1[15:0] + val2[31:16]
  2077. res[31:16] = val1[31:16] - val2[15:0]</pre>
  2078. </td>
  2079. </tr>
  2080. </tbody>
  2081. </table>
  2082. <h3><a name="__SHSAX"></a>Function __SHSAX</h3>
  2083. <table border="0" cellpadding="5" cellspacing="5">
  2084. <tbody>
  2085. <tr>
  2086. <td><b>Summary</b></td>
  2087. <td>
  2088. <pre style="margin-left:0px">
  2089. uint32_t __SHSAX(uint32_t val1, uint32_t val2);</pre>
  2090. </td>
  2091. </tr>
  2092. <tr>
  2093. <td><b>Description</b></td>
  2094. <td>This function enables you to exchange the two halfwords of one operand, perform one
  2095. signed 16-bit integer subtraction and one signed 16-bit addition, and halve the results.
  2096. </td>
  2097. </tr>
  2098. <tr>
  2099. <td><b>Parameter</b></td>
  2100. <td>
  2101. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2102. <li><b>val1</b>: first 16-bit operands.</li>
  2103. <li><b>val2</b>: second 16-bit operands.</li>
  2104. </ul>
  2105. </td>
  2106. </tr>
  2107. <tr>
  2108. <td><b>Return Value</b></td>
  2109. <td>
  2110. <p>The function returns:</p>
  2111. <ul style="margin-top:0px">
  2112. <li>the halved addition of the low halfword in the first operand and the high halfword
  2113. in the second operand, in the low halfword of the return value.</li>
  2114. <li>the halved subtraction of the low halfword in the second operand from the high
  2115. halfword in the first operand, in the high halfword of the return value.</li>
  2116. </ul>
  2117. </td>
  2118. </tr>
  2119. <tr>
  2120. <td><b>Operation</b></td>
  2121. <td>
  2122. <pre style="margin-left:0px">
  2123. res[15:0] = (val1[15:0] + val2[31:16]) &gt;&gt; 1
  2124. res[31:16] = (val1[31:16] - val2[15:0]) &gt;&gt; 1</pre>
  2125. </td>
  2126. </tr>
  2127. </tbody>
  2128. </table>
  2129. <h3><a name="__USAX"></a>Function __USAX</h3>
  2130. <table border="0" cellpadding="5" cellspacing="5">
  2131. <tbody>
  2132. <tr>
  2133. <td><b>Summary</b></td>
  2134. <td>
  2135. <pre style="margin-left:0px">
  2136. uint32_t __USAX(uint32_t val1, uint32_t val2);</pre>
  2137. </td>
  2138. </tr>
  2139. <tr>
  2140. <td><b>Description</b></td>
  2141. <td>This function enables you to exchange the halfwords of the second operand, subtract the
  2142. high halfwords and add the low halfwords.<br>
  2143. The GE bits in the APSR are set according to the results.
  2144. </td>
  2145. </tr>
  2146. <tr>
  2147. <td><b>Parameter</b></td>
  2148. <td>
  2149. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2150. <li><b>val1</b>: first operand for the addition in the low halfword, and the first
  2151. operand for the subtraction in the high halfword.</li>
  2152. <li><b>val2</b>: second operand for the addition in the high halfword, and the
  2153. second operand for the subtraction in the low halfword.</li>
  2154. </ul>
  2155. </td>
  2156. </tr>
  2157. <tr>
  2158. <td><b>Return Value</b></td>
  2159. <td>
  2160. <p>The function returns:</p>
  2161. <ul style="margin-top:0px">
  2162. <li>the addition of the low halfword in the first operand and the high halfword in the
  2163. second operand, in the low halfword of the return value.</li>
  2164. <li>the subtraction of the low halfword in the second operand from the high halfword
  2165. in the first operand, in the high halfword of the return value.</li>
  2166. </ul>
  2167. <p>Each bit in APSR.GE is set or cleared for each byte in the return value, depending on
  2168. the results of the operation.<br>
  2169. If <i>res</i> is the return value, then:
  2170. </p>
  2171. <ul style="margin-top:0px">
  2172. <li>if res[15:0] &ge; 0x10000 then APSR.GE[1:0] = 11 else 00</li>
  2173. <li>if res[31:16] &ge; 0 then APSR.GE[3:2] = 11 else 00</li>
  2174. </ul>
  2175. </td>
  2176. </tr>
  2177. <tr>
  2178. <td><b>Operation</b></td>
  2179. <td>
  2180. <pre style="margin-left:0px">
  2181. res[15:0] = val1[15:0] + val2[31:16]
  2182. res[31:16] = val1[31:16] - val2[15:0]</pre>
  2183. </td>
  2184. </tr>
  2185. </tbody>
  2186. </table>
  2187. <h3><a name="__UQSAX"></a>Function __UQSAX</h3>
  2188. <table border="0" cellpadding="5" cellspacing="5">
  2189. <tbody>
  2190. <tr>
  2191. <td><b>Summary</b></td>
  2192. <td>
  2193. <pre style="margin-left:0px">
  2194. uint32_t __UQSAX(uint32_t val1, uint32_t val2);</pre>
  2195. </td>
  2196. </tr>
  2197. <tr>
  2198. <td><b>Description</b></td>
  2199. <td>This function enables you to exchange the halfwords of the second operand and perform
  2200. one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, saturating the
  2201. results to the 16-bit unsigned integer range 0 &le; x &le; 2<sup>16</sup> - 1.
  2202. </td>
  2203. </tr>
  2204. <tr>
  2205. <td><b>Parameter</b></td>
  2206. <td>
  2207. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2208. <li><b>val1</b>: first 16-bit operand for the addition in the low halfword, and the
  2209. first 16-bit operand for the subtraction in the high halfword.</li>
  2210. <li><b>val2</b>: second 16-bit halfword for the addition in the high halfword,
  2211. and the second 16-bit halfword for the subtraction in the low halfword.</li>
  2212. </ul>
  2213. </td>
  2214. </tr>
  2215. <tr>
  2216. <td><b>Return Value</b></td>
  2217. <td>
  2218. <p>The function returns:</p>
  2219. <ul style="margin-top:0px">
  2220. <li>the addition of the low halfword in the first operand and the high halfword in the
  2221. second operand, in the low halfword of the return value.</li>
  2222. <li>the subtraction of the low halfword in the second operand from the high halfword
  2223. in the first operand, in the high halfword of the return value.</li>
  2224. </ul>
  2225. <p>The results are saturated to the 16-bit unsigned integer
  2226. range 0 &le; x &le; 2<sup>16</sup> - 1.
  2227. </p>
  2228. </td>
  2229. </tr>
  2230. <tr>
  2231. <td><b>Operation</b></td>
  2232. <td>
  2233. <pre style="margin-left:0px">
  2234. res[15:0] = val1[15:0] + val2[31:16]
  2235. res[31:16] = val1[31:16] - val2[15:0]</pre>
  2236. </td>
  2237. </tr>
  2238. </tbody>
  2239. </table>
  2240. <h3><a name="__UHSAX"></a>Function __UHSAX</h3>
  2241. <table border="0" cellpadding="5" cellspacing="5">
  2242. <tbody>
  2243. <tr>
  2244. <td><b>Summary</b></td>
  2245. <td>
  2246. <pre style="margin-left:0px">
  2247. uint32_t __UHSAX(uint32_t val1, uint32_t val2);</pre>
  2248. </td>
  2249. </tr>
  2250. <tr>
  2251. <td><b>Description</b></td>
  2252. <td>This function enables you to exchange the halfwords of the second operand, subtract the
  2253. high halfwords and add the low halfwords, halving the results.
  2254. </td>
  2255. </tr>
  2256. <tr>
  2257. <td><b>Parameter</b></td>
  2258. <td>
  2259. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2260. <li><b>val1</b>: first operand for the addition in the low halfword, and the first
  2261. operand for the subtraction in the high halfword.</li>
  2262. <li><b>val2</b>: second operand for the addition in the high halfword, and the
  2263. second operand for the subtraction in the low halfword.</li>
  2264. </ul>
  2265. </td>
  2266. </tr>
  2267. <tr>
  2268. <td><b>Return Value</b></td>
  2269. <td>
  2270. <p>The function returns:</p>
  2271. <ul style="margin-top:0px">
  2272. <li>the halved addition of the high halfword in the second operand and the low
  2273. halfword in the first operand, in the low halfword of the return value.</li>
  2274. <li>the halved subtraction of the low halfword in the second operand from the high
  2275. halfword in the first operand, in the high halfword of the return value.</li>
  2276. </ul>
  2277. </td>
  2278. </tr>
  2279. <tr>
  2280. <td><b>Operation</b></td>
  2281. <td>
  2282. <pre style="margin-left:0px">
  2283. res[15:0] = (val1[15:0] + val2[31:16]) &gt;&gt; 1
  2284. res[31:16] = (val1[31:16] - val2[15:0]) &gt;&gt; 1</pre>
  2285. </td>
  2286. </tr>
  2287. </tbody>
  2288. </table>
  2289. <h3><a name="__USAD8"></a>Function __USAD8</h3>
  2290. <table border="0" cellpadding="5" cellspacing="5">
  2291. <tbody>
  2292. <tr>
  2293. <td><b>Summary</b></td>
  2294. <td>
  2295. <pre style="margin-left:0px">
  2296. uint32_t __USAD8(uint32_t val1, uint32_t val2);</pre>
  2297. </td>
  2298. </tr>
  2299. <tr>
  2300. <td><b>Description</b></td>
  2301. <td>This function enables you to perform four unsigned 8-bit subtractions, and add the
  2302. absolute values of the differences together, returning the result as a single unsigned
  2303. integer.
  2304. </td>
  2305. </tr>
  2306. <tr>
  2307. <td><b>Parameter</b></td>
  2308. <td>
  2309. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2310. <li><b>val1</b>: first four 8-bit operands for the subtractions.</li>
  2311. <li><b>val2</b>: second four 8-bit operands for the subtractions.</li>
  2312. </ul>
  2313. </td>
  2314. </tr>
  2315. <tr>
  2316. <td><b>Return Value</b></td>
  2317. <td>
  2318. <p>The function returns the sum of the absolute differences of:</p>
  2319. <ul style="margin-top:0px">
  2320. <li>the subtraction of the first byte in the second operand from the first byte in the
  2321. first operand.</li>
  2322. <li>the subtraction of the second byte in the second operand from the second byte in
  2323. the first operand.</li>
  2324. <li>the subtraction of the third byte in the second operand from the third byte in the
  2325. first operand.</li>
  2326. <li>the subtraction of the fourth byte in the second operand from the fourth byte in
  2327. the first operand.</li>
  2328. </ul>
  2329. <p>The sum is returned as a single unsigned integer.</p>
  2330. </td>
  2331. </tr>
  2332. <tr>
  2333. <td><b>Operation</b></td>
  2334. <td>
  2335. <pre style="margin-left:0px">
  2336. absdiff1 = val1[7:0] - val2[7:0]
  2337. absdiff2 = val1[15:8] - val2[15:8]
  2338. absdiff3 = val1[23:16] - val2[23:16]
  2339. absdiff4 = val1[31:24] - val2[31:24]
  2340. res[31:0] = absdiff1 + absdiff2 + absdiff3 + absdiff4</pre>
  2341. </td>
  2342. </tr>
  2343. </tbody>
  2344. </table>
  2345. <h3><a name="__USADA8"></a>Function __USADA8</h3>
  2346. <table border="0" cellpadding="5" cellspacing="5">
  2347. <tbody>
  2348. <tr>
  2349. <td><b>Summary</b></td>
  2350. <td>
  2351. <pre style="margin-left:0px">
  2352. uint32_t __USADA8(uint32_t val1, uint32_t val2, uint32_t val3);</pre>
  2353. </td>
  2354. </tr>
  2355. <tr>
  2356. <td><b>Description</b></td>
  2357. <td>This function enables you to perform four unsigned 8-bit subtractions, and add the
  2358. absolute values of the differences to a 32-bit accumulate operand.
  2359. </td>
  2360. </tr>
  2361. <tr>
  2362. <td><b>Parameter</b></td>
  2363. <td>
  2364. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2365. <li><b>val1</b>: first four 8-bit operands for the subtractions.</li>
  2366. <li><b>val2</b>: second four 8-bit operands for the subtractions.</li>
  2367. <li><b>val3</b>: accumulation value.</li>
  2368. </ul>
  2369. </td>
  2370. </tr>
  2371. <tr>
  2372. <td><b>Return Value</b></td>
  2373. <td>
  2374. <p>The function returns the sum of the absolute differences of the following
  2375. bytes, added to the accumulation value:</p>
  2376. <ul style="margin-top:0px">
  2377. <li>the subtraction of the first byte in the second operand from the first byte in the
  2378. first operand.</li>
  2379. <li>the subtraction of the second byte in the second operand from the second byte in
  2380. the first operand.</li>
  2381. <li>the subtraction of the third byte in the second operand from the third byte in the
  2382. first operand.</li>
  2383. <li>the subtraction of the fourth byte in the second operand from the fourth byte in
  2384. the first operand.</li>
  2385. </ul>
  2386. </td>
  2387. </tr>
  2388. <tr>
  2389. <td><b>Operation</b></td>
  2390. <td>
  2391. <pre style="margin-left:0px">
  2392. absdiff1 = val1[7:0] - val2[7:0]
  2393. absdiff2 = val1[15:8] - val2[15:8]
  2394. absdiff3 = val1[23:16] - val2[23:16]
  2395. absdiff4 = val1[31:24] - val2[31:24]
  2396. sum = absdiff1 + absdiff2 + absdiff3 + absdiff4
  2397. res[31:0] = sum[31:0] + val3[31:0]</pre>
  2398. </td>
  2399. </tr>
  2400. </tbody>
  2401. </table>
  2402. <h3><a name="__SSAT16"></a>Function __SSAT16</h3>
  2403. <table border="0" cellpadding="5" cellspacing="5">
  2404. <tbody>
  2405. <tr>
  2406. <td><b>Summary</b></td>
  2407. <td>
  2408. <pre style="margin-left:0px">
  2409. uint32_t __SSAT16(uint32_t val1, const uint32_t val2);</pre>
  2410. </td>
  2411. </tr>
  2412. <tr>
  2413. <td><b>Description</b></td>
  2414. <td>This function enables you to saturate two signed 16-bit values to a selected signed range.<br>
  2415. The Q bit is set if either operation saturates.
  2416. </td>
  2417. </tr>
  2418. <tr>
  2419. <td><b>Parameter</b></td>
  2420. <td>
  2421. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2422. <li><b>val1</b>: two signed 16-bit values to be saturated.</li>
  2423. <li><b>val2</b>: bit position for saturation, an integral constant expression in the
  2424. range 1 to 16.</li>
  2425. </ul>
  2426. </td>
  2427. </tr>
  2428. <tr>
  2429. <td><b>Return Value</b></td>
  2430. <td>
  2431. <p>The function returns:</p>
  2432. <ul style="margin-top:0px">
  2433. <li>the signed saturation of the low halfword in <i>val1</i>, saturated to the bit position
  2434. specified in <i>val2</i> and returned in the low halfword of the return value.</li>
  2435. <li>the signed saturation of the high halfword in <i>val1</i>, saturated to the bit position
  2436. specified in <i>val2</i> and returned in the high halfword of the return value.</li>
  2437. </ul>
  2438. </td>
  2439. </tr>
  2440. <tr>
  2441. <td><b>Operation</b></td>
  2442. <td>
  2443. <pre style="margin-left:0px">
  2444. Saturate halfwords in val1 to the signed range specified by the bit position in val2</pre>
  2445. </td>
  2446. </tr>
  2447. </tbody>
  2448. </table>
  2449. <h3><a name="__USAT16"></a>Function __USAT16</h3>
  2450. <table border="0" cellpadding="5" cellspacing="5">
  2451. <tbody>
  2452. <tr>
  2453. <td><b>Summary</b></td>
  2454. <td>
  2455. <pre style="margin-left:0px">
  2456. uint32_t __USAT16(uint32_t val1, const uint32_t val2);</pre>
  2457. </td>
  2458. </tr>
  2459. <tr>
  2460. <td><b>Description</b></td>
  2461. <td>This function enables you to saturate two signed 16-bit values to a selected unsigned
  2462. range.<br>
  2463. The Q bit is set if either operation saturates.
  2464. </td>
  2465. </tr>
  2466. <tr>
  2467. <td><b>Parameter</b></td>
  2468. <td>
  2469. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2470. <li><b>val1</b>: two 16-bit values that are to be saturated.</li>
  2471. <li><b>val2</b>: bit position for saturation, and must be an integral constant
  2472. expression in the range 0 to 15.</li>
  2473. </ul>
  2474. </td>
  2475. </tr>
  2476. <tr>
  2477. <td><b>Return Value</b></td>
  2478. <td>
  2479. <p>The function returns the saturation of the two signed 16-bit values, as non-negative values.</p>
  2480. <ul style="margin-top:0px">
  2481. <li>the saturation of the low halfword in <i>val1</i>, saturated to the bit position
  2482. specified in <i>val2</i> and returned in the low halfword of the return value.</li>
  2483. <li>the saturation of the high halfword in <i>val1</i>, saturated to the bit position
  2484. specified in <i>val2</i> and returned in the high halfword of the return value.</li>
  2485. </ul>
  2486. </td>
  2487. </tr>
  2488. <tr>
  2489. <td><b>Operation</b></td>
  2490. <td>
  2491. <pre style="margin-left:0px">
  2492. Saturate halfwords in val1 to the unsigned range specified by the bit position in val2</pre>
  2493. </td>
  2494. </tr>
  2495. </tbody>
  2496. </table>
  2497. <h3><a name="__UXTB16"></a>Function __UXTB16</h3>
  2498. <table border="0" cellpadding="5" cellspacing="5">
  2499. <tbody>
  2500. <tr>
  2501. <td><b>Summary</b></td>
  2502. <td>
  2503. <pre style="margin-left:0px">
  2504. uint32_t __UXTB16(uint32_t val);</pre>
  2505. </td>
  2506. </tr>
  2507. <tr>
  2508. <td><b>Description</b></td>
  2509. <td>This function enables you to extract two 8-bit values from an operand and zero-extend
  2510. them to 16 bits each.
  2511. </td>
  2512. </tr>
  2513. <tr>
  2514. <td><b>Parameter</b></td>
  2515. <td>
  2516. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2517. <li><b>val1</b>: two 8-bit values in val[7:0] and val[23:16] to be sign-extended.</li>
  2518. </ul>
  2519. </td>
  2520. </tr>
  2521. <tr>
  2522. <td><b>Return Value</b></td>
  2523. <td>
  2524. <p>The function returns the 8-bit values zero-extended to 16-bit values.</p>
  2525. <ul style="margin-top:0px">
  2526. <li>zero-extended value of val[7:0] in the low halfword of the return value.</li>
  2527. <li>zero-extended value of val[23:16] in the high halfword of the return value.</li>
  2528. </ul>
  2529. </td>
  2530. </tr>
  2531. <tr>
  2532. <td><b>Operation</b></td>
  2533. <td>
  2534. <pre style="margin-left:0px">
  2535. res[15:0] = ZeroExtended(val[7:0] )
  2536. res[31:16] = ZeroExtended(val[23:16])</pre>
  2537. </td>
  2538. </tr>
  2539. </tbody>
  2540. </table>
  2541. <h3><a name="__UXTAB16"></a>Function __UXTAB16</h3>
  2542. <table border="0" cellpadding="5" cellspacing="5">
  2543. <tbody>
  2544. <tr>
  2545. <td><b>Summary</b></td>
  2546. <td>
  2547. <pre style="margin-left:0px">
  2548. uint32_t __UXTAB16(uint32_t val1, uint32_t val2);</pre>
  2549. </td>
  2550. </tr>
  2551. <tr>
  2552. <td><b>Description</b></td>
  2553. <td>This function enables you to extract two 8-bit values from one operand, zero-extend them
  2554. to 16 bits each, and add the results to two 16-bit values from another operand.
  2555. </td>
  2556. </tr>
  2557. <tr>
  2558. <td><b>Parameter</b></td>
  2559. <td>
  2560. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2561. <li><b>val1</b>: value added to the zero-extended to 16-bit values.</li>
  2562. <li><b>val2</b>: two 8-bit values to be extracted and zero-extended.</li>
  2563. </ul>
  2564. </td>
  2565. </tr>
  2566. <tr>
  2567. <td><b>Return Value</b></td>
  2568. <td>
  2569. <p>The function returns the 8-bit values in <i>val2</i>, zero-extended to 16-bit values
  2570. and added to <i>val1</i>.</p>
  2571. </td>
  2572. </tr>
  2573. <tr>
  2574. <td><b>Operation</b></td>
  2575. <td>
  2576. <pre style="margin-left:0px">
  2577. res[15:0] = ZeroExt(val2[7:0] to 16 bits) + val1[15:0]
  2578. res[31:16] = ZeroExt(val2[31:16] to 16 bits) + val1[31:16]</pre>
  2579. </td>
  2580. </tr>
  2581. </tbody>
  2582. </table>
  2583. <h3><a name="__SXTB16"></a>Function __SXTB16</h3>
  2584. <table border="0" cellpadding="5" cellspacing="5">
  2585. <tbody>
  2586. <tr>
  2587. <td><b>Summary</b></td>
  2588. <td>
  2589. <pre style="margin-left:0px">
  2590. uint32_t __SXTB16(uint32_t val);</pre>
  2591. </td>
  2592. </tr>
  2593. <tr>
  2594. <td><b>Description</b></td>
  2595. <td>This function enables you to extract two 8-bit values from an operand and sign-extend
  2596. them to 16 bits each.
  2597. </td>
  2598. </tr>
  2599. <tr>
  2600. <td><b>Parameter</b></td>
  2601. <td>
  2602. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2603. <li><b>val1</b>: two 8-bit values in val[7:0] and val[23:16] to be sign-extended.</li>
  2604. </ul>
  2605. </td>
  2606. </tr>
  2607. <tr>
  2608. <td><b>Return Value</b></td>
  2609. <td>
  2610. <p>The function returns the 8-bit values sign-extended to 16-bit values.</p>
  2611. <ul style="margin-top:0px">
  2612. <li>sign-extended value of val[7:0] in the low halfword of the return value.</li>
  2613. <li>sign-extended value of val[23:16] in the high halfword of the return value.</li>
  2614. </ul>
  2615. </td>
  2616. </tr>
  2617. <tr>
  2618. <td><b>Operation</b></td>
  2619. <td>
  2620. <pre style="margin-left:0px">
  2621. res[15:0] = SignExtended(val[7:0]
  2622. res[31:16] = SignExtended(val[23:16]</pre>
  2623. </td>
  2624. </tr>
  2625. </tbody>
  2626. </table>
  2627. <h3><a name="__SXTAB16"></a>Function __SXTAB16</h3>
  2628. <table border="0" cellpadding="5" cellspacing="5">
  2629. <tbody>
  2630. <tr>
  2631. <td><b>Summary</b></td>
  2632. <td>
  2633. <pre style="margin-left:0px">
  2634. uint32_t __SXTAB16(uint32_t val1, uint32_t val2);</pre>
  2635. </td>
  2636. </tr>
  2637. <tr>
  2638. <td><b>Description</b></td>
  2639. <td>This function enables you to extract two 8-bit values from the second operand (at bit
  2640. positions [7:0] and [23:16]), sign-extend them to 16-bits each, and add the results to the
  2641. first operand.
  2642. </td>
  2643. </tr>
  2644. <tr>
  2645. <td><b>Parameter</b></td>
  2646. <td>
  2647. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2648. <li><b>val1</b>: values added to the zero-extended to 16-bit values.</li>
  2649. <li><b>val2</b>: two 8-bit values to be extracted and zero-extended.</li>
  2650. </ul>
  2651. </td>
  2652. </tr>
  2653. <tr>
  2654. <td><b>Return Value</b></td>
  2655. <td>
  2656. <p>The function returns the addition of <i>val1</i> and <i>val2</i>, where the 8-bit values in
  2657. val2[7:0] and val2[23:16] have been extracted and sign-extended prior to the addition.</p>
  2658. </td>
  2659. </tr>
  2660. <tr>
  2661. <td><b>Operation</b></td>
  2662. <td>
  2663. <pre style="margin-left:0px">
  2664. res[15:0] = val1[15:0] + SignExtended(val2[7:0])
  2665. res[31:16] = val1[31:16] + SignExtended(val2[23:16])</pre>
  2666. </td>
  2667. </tr>
  2668. </tbody>
  2669. </table>
  2670. <h3><a name="__SMUAD"></a>Function __SMUAD</h3>
  2671. <table border="0" cellpadding="5" cellspacing="5">
  2672. <tbody>
  2673. <tr>
  2674. <td><b>Summary</b></td>
  2675. <td>
  2676. <pre style="margin-left:0px">
  2677. uint32_t __SMUAD(uint32_t val1, uint32_t val2);</pre>
  2678. </td>
  2679. </tr>
  2680. <tr>
  2681. <td><b>Description</b></td>
  2682. <td>This function It enables you to perform two 16-bit signed multiplications, adding the
  2683. products together.<br>
  2684. The Q bit is set if the addition overflows.
  2685. </td>
  2686. </tr>
  2687. <tr>
  2688. <td><b>Parameter</b></td>
  2689. <td>
  2690. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2691. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2692. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2693. </ul>
  2694. </td>
  2695. </tr>
  2696. <tr>
  2697. <td><b>Return Value</b></td>
  2698. <td>
  2699. <p>The function returns the sum of the products of the two 16-bit signed multiplications.</p>
  2700. </td>
  2701. </tr>
  2702. <tr>
  2703. <td><b>Operation</b></td>
  2704. <td>
  2705. <pre style="margin-left:0px">
  2706. p1 = val1[15:0] * val2[15:0]
  2707. p2 = val1[31:16] * val2[31:16]
  2708. res[31:0] = p1 + p2</pre>
  2709. </td>
  2710. </tr>
  2711. </tbody>
  2712. </table>
  2713. <h3><a name="__SMUADX"></a>Function __SMUADX</h3>
  2714. <table border="0" cellpadding="5" cellspacing="5">
  2715. <tbody>
  2716. <tr>
  2717. <td><b>Summary</b></td>
  2718. <td>
  2719. <pre style="margin-left:0px">
  2720. uint32_t __SMUADX(uint32_t val1, uint32_t val2);</pre>
  2721. </td>
  2722. </tr>
  2723. <tr>
  2724. <td><b>Description</b></td>
  2725. <td>This function enables you to perform two 16-bit signed multiplications with exchanged
  2726. halfwords of the second operand, adding the products together.<br>
  2727. The Q bit is set if the addition overflows.
  2728. </td>
  2729. </tr>
  2730. <tr>
  2731. <td><b>Parameter</b></td>
  2732. <td>
  2733. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2734. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2735. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2736. </ul>
  2737. </td>
  2738. </tr>
  2739. <tr>
  2740. <td><b>Return Value</b></td>
  2741. <td>
  2742. <p>The function returns the sum of the products of the two 16-bit signed multiplications with exchanged
  2743. halfwords of the second operand.</p>
  2744. </td>
  2745. </tr>
  2746. <tr>
  2747. <td><b>Operation</b></td>
  2748. <td>
  2749. <pre style="margin-left:0px">
  2750. p1 = val1[15:0] * val2[31:16]
  2751. p2 = val1[31:16] * val2[15:0]
  2752. res[31:0] = p1 + p2</pre>
  2753. </td>
  2754. </tr>
  2755. </tbody>
  2756. </table>
  2757. <h3><a name="__SMLAD"></a>Function __SMLAD</h3>
  2758. <table border="0" cellpadding="5" cellspacing="5">
  2759. <tbody>
  2760. <tr>
  2761. <td><b>Summary</b></td>
  2762. <td>
  2763. <pre style="margin-left:0px">
  2764. uint32_t __SMLAD(uint32_t val1, uint32_t val2, uint32_t val3);</pre>
  2765. </td>
  2766. </tr>
  2767. <tr>
  2768. <td><b>Description</b></td>
  2769. <td>This function enables you to perform two signed 16-bit multiplications, adding both
  2770. results to a 32-bit accumulate operand.<br>
  2771. The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications.
  2772. </td>
  2773. </tr>
  2774. <tr>
  2775. <td><b>Parameter</b></td>
  2776. <td>
  2777. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2778. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2779. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2780. <li><b>val2</b>: accumulate value.</li>
  2781. </ul>
  2782. </td>
  2783. </tr>
  2784. <tr>
  2785. <td><b>Return Value</b></td>
  2786. <td>
  2787. <p>The function returns the product of each multiplication added to the accumulate
  2788. value, as a 32-bit integer.</p>
  2789. </td>
  2790. </tr>
  2791. <tr>
  2792. <td><b>Operation</b></td>
  2793. <td>
  2794. <pre style="margin-left:0px">
  2795. p1 = val1[15:0] * val2[15:0]
  2796. p2 = val1[31:16] * val2[31:16]
  2797. res[31:0] = p1 + p2 + val3[31:0]</pre>
  2798. </td>
  2799. </tr>
  2800. </tbody>
  2801. </table>
  2802. <h3><a name="__SMLADX"></a>Function __SMLADX</h3>
  2803. <table border="0" cellpadding="5" cellspacing="5">
  2804. <tbody>
  2805. <tr>
  2806. <td><b>Summary</b></td>
  2807. <td>
  2808. <pre style="margin-left:0px">
  2809. uint32_t __SMLADX(uint32_t val1, uint32_t val2, uint32_t val3);</pre>
  2810. </td>
  2811. </tr>
  2812. <tr>
  2813. <td><b>Description</b></td>
  2814. <td>This function enables you to perform two signed 16-bit multiplications with exchanged
  2815. halfwords of the second operand, adding both results to a 32-bit accumulate operand.<br>
  2816. The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications.
  2817. </td>
  2818. </tr>
  2819. <tr>
  2820. <td><b>Parameter</b></td>
  2821. <td>
  2822. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2823. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2824. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2825. <li><b>val2</b>: accumulate value.</li>
  2826. </ul>
  2827. </td>
  2828. </tr>
  2829. <tr>
  2830. <td><b>Return Value</b></td>
  2831. <td>
  2832. <p>The function returns the product of each multiplication with exchanged
  2833. halfwords of the second operand added to the accumulate value, as a 32-bit integer.</p>
  2834. </td>
  2835. </tr>
  2836. <tr>
  2837. <td><b>Operation</b></td>
  2838. <td>
  2839. <pre style="margin-left:0px">
  2840. p1 = val1[15:0] * val2[31:16]
  2841. p2 = val1[31:16] * val2[15:0]
  2842. res[31:0] = p1 + p2 + val3[31:0]</pre>
  2843. </td>
  2844. </tr>
  2845. </tbody>
  2846. </table>
  2847. <h3><a name="__SMLALD"></a>Function __SMLALD</h3>
  2848. <table border="0" cellpadding="5" cellspacing="5">
  2849. <tbody>
  2850. <tr>
  2851. <td><b>Summary</b></td>
  2852. <td>
  2853. <pre style="margin-left:0px">
  2854. uint64_t __SMLALD(uint32_t val1, uint32_t val2, uint64_t val3);</pre>
  2855. </td>
  2856. </tr>
  2857. <tr>
  2858. <td><b>Description</b></td>
  2859. <td>This function enables you to perform two signed 16-bit multiplications, adding both
  2860. results to a 64-bit accumulate operand. Overflow is only possible as a result of the 64-bit
  2861. addition. This overflow is not detected if it occurs. Instead, the result wraps around
  2862. modulo2<sup>64</sup>.
  2863. </td>
  2864. </tr>
  2865. <tr>
  2866. <td><b>Parameter</b></td>
  2867. <td>
  2868. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2869. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2870. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2871. <li><b>val2</b>: accumulate value.</li>
  2872. </ul>
  2873. </td>
  2874. </tr>
  2875. <tr>
  2876. <td><b>Return Value</b></td>
  2877. <td>
  2878. <p>The function returns the product of each multiplication added to the accumulate value.</p>
  2879. </td>
  2880. </tr>
  2881. <tr>
  2882. <td><b>Operation</b></td>
  2883. <td>
  2884. <pre style="margin-left:0px">
  2885. p1 = val1[15:0] * val2[15:0]
  2886. p2 = val1[31:16] * val2[31:16]
  2887. sum = p1 + p2 + val3[63:32][31:0]
  2888. res[63:32] = sum[63:32]
  2889. res[31:0] = sum[31:0]</pre>
  2890. </td>
  2891. </tr>
  2892. </tbody>
  2893. </table>
  2894. <h3><a name="__SMLALDX"></a>Function __SMLALDX</h3>
  2895. <table border="0" cellpadding="5" cellspacing="5">
  2896. <tbody>
  2897. <tr>
  2898. <td><b>Summary</b></td>
  2899. <td>
  2900. <pre style="margin-left:0px">
  2901. unsigned long long __SMLALDX(uint32_t val1, uint32_t val2, unsigned long long val3);</pre>
  2902. </td>
  2903. </tr>
  2904. <tr>
  2905. <td><b>Description</b></td>
  2906. <td>This function enables you to exchange the halfwords of the second operand, and perform
  2907. two signed 16-bit multiplications, adding both results to a 64-bit accumulate operand.
  2908. Overflow is only possible as a result of the 64-bit addition. This overflow is not detected
  2909. if it occurs. Instead, the result wraps around modulo2<sup>64</sup>.
  2910. </td>
  2911. </tr>
  2912. <tr>
  2913. <td><b>Parameter</b></td>
  2914. <td>
  2915. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2916. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2917. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2918. <li><b>val2</b>: accumulate value.</li>
  2919. </ul>
  2920. </td>
  2921. </tr>
  2922. <tr>
  2923. <td><b>Return Value</b></td>
  2924. <td>
  2925. <p>The function returns the product of each multiplication added to the accumulate value.</p>
  2926. </td>
  2927. </tr>
  2928. <tr>
  2929. <td><b>Operation</b></td>
  2930. <td>
  2931. <pre style="margin-left:0px">
  2932. p1 = val1[15:0] * val2[31:16]
  2933. p2 = val1[31:16] * val2[15:0]
  2934. sum = p1 + p2 + val3[63:32][31:0]
  2935. res[63:32] = sum[63:32]
  2936. res[31:0] = sum[31:0]</pre>
  2937. </td>
  2938. </tr>
  2939. </tbody>
  2940. </table>
  2941. <h3><a name="__SMUSD"></a>Function __SMUSD</h3>
  2942. <table border="0" cellpadding="5" cellspacing="5">
  2943. <tbody>
  2944. <tr>
  2945. <td><b>Summary</b></td>
  2946. <td>
  2947. <pre style="margin-left:0px">
  2948. uint32_t __SMUSD(uint32_t val1, uint32_t val2);</pre>
  2949. </td>
  2950. </tr>
  2951. <tr>
  2952. <td><b>Description</b></td>
  2953. <td>This function enables you to perform two 16-bit signed multiplications, taking the
  2954. difference of the products by subtracting the high halfword product from the low
  2955. halfword product.
  2956. </td>
  2957. </tr>
  2958. <tr>
  2959. <td><b>Parameter</b></td>
  2960. <td>
  2961. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  2962. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  2963. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  2964. </ul>
  2965. </td>
  2966. </tr>
  2967. <tr>
  2968. <td><b>Return Value</b></td>
  2969. <td>
  2970. <p>The function returns the difference of the products of the two 16-bit signed multiplications.</p>
  2971. </td>
  2972. </tr>
  2973. <tr>
  2974. <td><b>Operation</b></td>
  2975. <td>
  2976. <pre style="margin-left:0px">
  2977. p1 = val1[15:0] * val2[15:0]
  2978. p2 = val1[31:16] * val2[31:16]
  2979. res[31:0] = p1 - p2</pre>
  2980. </td>
  2981. </tr>
  2982. </tbody>
  2983. </table>
  2984. <h3><a name="__SMUSDX"></a>Function __SMUSDX</h3>
  2985. <table border="0" cellpadding="5" cellspacing="5">
  2986. <tbody>
  2987. <tr>
  2988. <td><b>Summary</b></td>
  2989. <td>
  2990. <pre style="margin-left:0px">
  2991. uint32_t __SMUSDX(uint32_t val1, uint32_t val2);</pre>
  2992. </td>
  2993. </tr>
  2994. <tr>
  2995. <td><b>Description</b></td>
  2996. <td>This function enables you to perform two 16-bit signed multiplications, subtracting one
  2997. of the products from the other. The halfwords of the second operand are exchanged
  2998. before performing the arithmetic. This produces top * bottom and bottom * top
  2999. multiplication.
  3000. </td>
  3001. </tr>
  3002. <tr>
  3003. <td><b>Parameter</b></td>
  3004. <td>
  3005. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3006. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  3007. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  3008. </ul>
  3009. </td>
  3010. </tr>
  3011. <tr>
  3012. <td><b>Return Value</b></td>
  3013. <td>
  3014. <p>The function returns the difference of the products of the two 16-bit signed multiplications.</p>
  3015. </td>
  3016. </tr>
  3017. <tr>
  3018. <td><b>Operation</b></td>
  3019. <td>
  3020. <pre style="margin-left:0px">
  3021. p1 = val1[15:0] * val2[31:16]
  3022. p2 = val1[31:16] * val2[15:0]
  3023. res[31:0] = p1 - p2</pre>
  3024. </td>
  3025. </tr>
  3026. </tbody>
  3027. </table>
  3028. <h3><a name="__SMLSD"></a>Function __SMLSD</h3>
  3029. <table border="0" cellpadding="5" cellspacing="5">
  3030. <tbody>
  3031. <tr>
  3032. <td><b>Summary</b></td>
  3033. <td>
  3034. <pre style="margin-left:0px">
  3035. uint32_t __SMLSD(uint32_t val1, uint32_t val2, uint32_t val3);</pre>
  3036. </td>
  3037. </tr>
  3038. <tr>
  3039. <td><b>Description</b></td>
  3040. <td>This function enables you to perform two 16-bit signed multiplications, take the
  3041. difference of the products, subtracting the high halfword product from the low halfword
  3042. product, and add the difference to a 32-bit accumulate operand.<br>
  3043. The Q bit is set if the accumulation overflows. Overflow cannot occur during the multiplications or the
  3044. subtraction.
  3045. </td>
  3046. </tr>
  3047. <tr>
  3048. <td><b>Parameter</b></td>
  3049. <td>
  3050. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3051. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  3052. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  3053. <li><b>val3</b>: accumulate value.</li>
  3054. </ul>
  3055. </td>
  3056. </tr>
  3057. <tr>
  3058. <td><b>Return Value</b></td>
  3059. <td>
  3060. <p>The function returns the difference of the product of each multiplication, added
  3061. to the accumulate value.</p>
  3062. </td>
  3063. </tr>
  3064. <tr>
  3065. <td><b>Operation</b></td>
  3066. <td>
  3067. <pre style="margin-left:0px">
  3068. p1 = val1[15:0] * val2[15:0]
  3069. p2 = val1[31:16] * val2[31:16]
  3070. res[31:0] = p1 - p2 + val3[31:0]</pre>
  3071. </td>
  3072. </tr>
  3073. </tbody>
  3074. </table>
  3075. <h3><a name="__SMLSDX"></a>Function __SMLSDX</h3>
  3076. <table border="0" cellpadding="5" cellspacing="5">
  3077. <tbody>
  3078. <tr>
  3079. <td><b>Summary</b></td>
  3080. <td>
  3081. <pre style="margin-left:0px">
  3082. uint32_t __SMLSDX(uint32_t val1, uint32_t val2, uint32_t val3);</pre>
  3083. </td>
  3084. </tr>
  3085. <tr>
  3086. <td><b>Description</b></td>
  3087. <td>This function enables you to exchange the halfwords in the second operand, then perform
  3088. two 16-bit signed multiplications. The difference of the products is added to a 32-bit
  3089. accumulate operand.<br>
  3090. The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications or the subtraction.
  3091. </td>
  3092. </tr>
  3093. <tr>
  3094. <td><b>Parameter</b></td>
  3095. <td>
  3096. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3097. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  3098. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  3099. <li><b>val3</b>: accumulate value.</li>
  3100. </ul>
  3101. </td>
  3102. </tr>
  3103. <tr>
  3104. <td><b>Return Value</b></td>
  3105. <td>
  3106. <p>The function returns the difference of the product of each multiplication, added
  3107. to the accumulate value.</p>
  3108. </td>
  3109. </tr>
  3110. <tr>
  3111. <td><b>Operation</b></td>
  3112. <td>
  3113. <pre style="margin-left:0px">
  3114. p1 = val1[15:0] * val2[31:16]
  3115. p2 = val1[31:16] * val2[15:0]
  3116. res[31:0] = p1 - p2 + val3[31:0]</pre>
  3117. </td>
  3118. </tr>
  3119. </tbody>
  3120. </table>
  3121. <h3><a name="__SMLSLD"></a>Function __SMLSLD</h3>
  3122. <table border="0" cellpadding="5" cellspacing="5">
  3123. <tbody>
  3124. <tr>
  3125. <td><b>Summary</b></td>
  3126. <td>
  3127. <pre style="margin-left:0px">
  3128. uint64_t __SMLSLD(uint32_t val1, uint32_t val2, uint64_t val3);</pre>
  3129. </td>
  3130. </tr>
  3131. <tr>
  3132. <td><b>Description</b></td>
  3133. <td>This function It enables you to perform two 16-bit signed multiplications, take the
  3134. difference of the products, subtracting the high halfword product from the low halfword
  3135. product, and add the difference to a 64-bit accumulate operand. Overflow cannot occur
  3136. during the multiplications or the subtraction. Overflow can occur as a result of the 64-bit
  3137. addition, and this overflow is not detected. Instead, the result wraps round to
  3138. modulo2<sup>64</sup>.
  3139. </td>
  3140. </tr>
  3141. <tr>
  3142. <td><b>Parameter</b></td>
  3143. <td>
  3144. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3145. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  3146. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  3147. <li><b>val3</b>: accumulate value.</li>
  3148. </ul>
  3149. </td>
  3150. </tr>
  3151. <tr>
  3152. <td><b>Return Value</b></td>
  3153. <td>
  3154. <p>The function returns the difference of the product of each multiplication,
  3155. added to the accumulate value.</p>
  3156. </td>
  3157. </tr>
  3158. <tr>
  3159. <td><b>Operation</b></td>
  3160. <td>
  3161. <pre style="margin-left:0px">
  3162. p1 = val1[15:0] * val2[15:0]
  3163. p2 = val1[31:16] * val2[31:16]
  3164. res[63:0] = p1 - p2 + val3[63:0]</pre>
  3165. </td>
  3166. </tr>
  3167. </tbody>
  3168. </table>
  3169. <h3><a name="__SMLSLDX"></a>Function __SMLSLDX</h3>
  3170. <table border="0" cellpadding="5" cellspacing="5">
  3171. <tbody>
  3172. <tr>
  3173. <td><b>Summary</b></td>
  3174. <td>
  3175. <pre style="margin-left:0px">
  3176. unsigned long long __SMLSLDX(uint32_t val1, uint32_t val2, unsigned long long val3);</pre>
  3177. </td>
  3178. </tr>
  3179. <tr>
  3180. <td><b>Description</b></td>
  3181. <td>This function enables you to exchange the halfwords of the second operand, perform two
  3182. 16-bit multiplications, adding the difference of the products to a 64-bit accumulate
  3183. operand. Overflow cannot occur during the multiplications or the subtraction. Overflow
  3184. can occur as a result of the 64-bit addition, and this overflow is not detected. Instead,
  3185. the result wraps round to modulo2<sup>64</sup>.
  3186. </td>
  3187. </tr>
  3188. <tr>
  3189. <td><b>Parameter</b></td>
  3190. <td>
  3191. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3192. <li><b>val1</b>: first 16-bit operands for each multiplication.</li>
  3193. <li><b>val2</b>: second 16-bit operands for each multiplication.</li>
  3194. <li><b>val3</b>: accumulate value.</li>
  3195. </ul>
  3196. </td>
  3197. </tr>
  3198. <tr>
  3199. <td><b>Return Value</b></td>
  3200. <td>
  3201. <p>The function returns the difference of the product of each multiplication,
  3202. added to the accumulate value.</p>
  3203. </td>
  3204. </tr>
  3205. <tr>
  3206. <td><b>Operation</b></td>
  3207. <td>
  3208. <pre style="margin-left:0px">
  3209. p1 = val1[15:0] * val2[31:16]
  3210. p2 = val1[31:16] * val2[15:0]
  3211. res[63:0] = p1 - p2 + val3[63:0]</pre>
  3212. </td>
  3213. </tr>
  3214. </tbody>
  3215. </table>
  3216. <h3><a name="__SEL"></a>Function __SEL</h3>
  3217. <table border="0" cellpadding="5" cellspacing="5">
  3218. <tbody>
  3219. <tr>
  3220. <td><b>Summary</b></td>
  3221. <td>
  3222. <pre style="margin-left:0px">
  3223. uint32_t __SEL(uint32_t val1, uint32_t val2);</pre>
  3224. </td>
  3225. </tr>
  3226. <tr>
  3227. <td><b>Description</b></td>
  3228. <td>This function inserts a SEL instruction into the instruction stream generated by the
  3229. compiler. It enables you to select bytes from the input parameters, whereby the bytes
  3230. that are selected depend upon the results of previous SIMD instruction function. The
  3231. results of previous SIMD instruction function are represented by the Greater than or
  3232. Equal flags in the Application Program Status Register (APSR).
  3233. The __SEL function works equally well on both halfword and byte operand function
  3234. results. This is because halfword operand operations set two (duplicate) GE bits per
  3235. value.
  3236. </td>
  3237. </tr>
  3238. <tr>
  3239. <td><b>Parameter</b></td>
  3240. <td>
  3241. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3242. <li><b>val1</b>: four selectable 8-bit values.</li>
  3243. <li><b>val2</b>: four selectable 8-bit values.</li>
  3244. </ul>
  3245. </td>
  3246. </tr>
  3247. <tr>
  3248. <td><b>Return Value</b></td>
  3249. <td>
  3250. <p>The function selects bytes from the input parameters and returns them in the
  3251. return value, res, according to the following criteria:</p>
  3252. <ul style="margin-top:0px">
  3253. <li>if APSR.GE[0] == 1 then res[7:0] = val1[7:0] else res[7:0] = val2[7:0]</li>
  3254. <li>if APSR.GE[1] == 1 then res[15:8] = val1[15:8] else res[15:8] = val2[15:8]</li>
  3255. <li>if APSR.GE[2] == 1 then res[23:16] = val1[23:16] else res[23:16] = val2[23:16]</li>
  3256. <li>if APSR.GE[3] == 1 then res[31;24] = val1[31:24] else res = val2[31:24]</li>
  3257. </ul>
  3258. </td>
  3259. </tr>
  3260. </tbody>
  3261. </table>
  3262. <h3><a name="__QADD"></a>Function __QADD</h3>
  3263. <table border="0" cellpadding="5" cellspacing="5">
  3264. <tbody>
  3265. <tr>
  3266. <td><b>Summary</b></td>
  3267. <td>
  3268. <pre style="margin-left:0px">
  3269. uint32_t __QADD(uint32_t val1, uint32_t val2);</pre>
  3270. </td>
  3271. </tr>
  3272. <tr>
  3273. <td><b>Description</b></td>
  3274. <td>This function enables you to obtain the saturating add of two integers.<br>
  3275. The Q bit is set if the operation saturates.
  3276. </td>
  3277. </tr>
  3278. <tr>
  3279. <td><b>Parameter</b></td>
  3280. <td>
  3281. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3282. <li><b>val1</b>: first summand of the saturating add operation.</li>
  3283. <li><b>val2</b>: second summand of the saturating add operation.</li>
  3284. </ul>
  3285. </td>
  3286. </tr>
  3287. <tr>
  3288. <td><b>Return Value</b></td>
  3289. <td>
  3290. <p>The function returns the saturating addition of val1 and val2.</p>
  3291. </td>
  3292. </tr>
  3293. <tr>
  3294. <td><b>Operation</b></td>
  3295. <td>
  3296. <pre style="margin-left:0px">
  3297. res[31:0] = SAT(val1 + SAT(val2 * 2))</pre>
  3298. </td>
  3299. </tr>
  3300. </tbody>
  3301. </table>
  3302. <h3><a name="__QSUB"></a>Function __QSUB</h3>
  3303. <table border="0" cellpadding="5" cellspacing="5">
  3304. <tbody>
  3305. <tr>
  3306. <td><b>Summary</b></td>
  3307. <td>
  3308. <pre style="margin-left:0px">
  3309. uint32_t __QSUB(uint32_t val1, uint32_t val2);</pre>
  3310. </td>
  3311. </tr>
  3312. <tr>
  3313. <td><b>Description</b></td>
  3314. <td>This function enables you to obtain the saturating subtraction of two integers.<br>
  3315. The Q bit is set if the operation saturates.
  3316. </td>
  3317. </tr>
  3318. <tr>
  3319. <td><b>Parameter</b></td>
  3320. <td>
  3321. <ul style="list-style-type:none; margin-left:0px; margin-top:0px">
  3322. <li><b>val1</b>: minuend of the saturating subtraction operation.</li>
  3323. <li><b>val2</b>: subtrahend of the saturating subtraction operation.</li>
  3324. </ul>
  3325. </td>
  3326. </tr>
  3327. <tr>
  3328. <td><b>Return Value</b></td>
  3329. <td>
  3330. <p>The function returns the saturating subtraction of val1 and val2.</p>
  3331. </td>
  3332. </tr>
  3333. <tr>
  3334. <td><b>Operation</b></td>
  3335. <td>
  3336. <pre style="margin-left:0px">
  3337. res[31:0] = SAT(val1 - SAT(val2 * 2))</pre>
  3338. </td>
  3339. </tr>
  3340. </tbody>
  3341. </table>
  3342. <!-- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  3343. <!-- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
  3344. <p>&nbsp;</p>
  3345. <h2><a name="Examples"></a>Examples</h2>
  3346. <p>Following are some coding examples using the SIMD functions:
  3347. </p>
  3348. <table class="kt" border="0" cellpadding="0" cellspacing="0">
  3349. <tbody>
  3350. <tr>
  3351. <th class="kt">Name</th>
  3352. <th class="kt">Description</th>
  3353. </tr>
  3354. <tr>
  3355. <td class="kt"><b><a href="#Addition">Addition</a></b></td>
  3356. <td class="kt">Add two values using SIMD function</td>
  3357. </tr>
  3358. </tr>
  3359. <tr>
  3360. <td class="kt"><b><a href="#Addition">Subtraction</a></b></td>
  3361. <td class="kt">Subtract two values using SIMD function</td>
  3362. </tr>
  3363. </tr>
  3364. <tr>
  3365. <td class="kt"><b><a href="#Multiplication">Multiplication</a></b></td>
  3366. <td class="kt">Performing a multiplication using SIMD function</td>
  3367. </tr>
  3368. </tr>
  3369. </tbody>
  3370. </table>
  3371. <h3><a name="Addition"></a>Addition</h3>
  3372. <table border="0" cellpadding="5" cellspacing="5">
  3373. <tbody>
  3374. <tr>
  3375. <td><b>Example</b></td>
  3376. <td>
  3377. <pre style="margin-left:0px">
  3378. uint32_t add_halfwords(uint32_t val1, uint32_t val2)
  3379. {
  3380. uint32_t res;
  3381. res = __SADD16(val1, val2);
  3382. return res;
  3383. }</pre>
  3384. </td>
  3385. </tr>
  3386. </tbody>
  3387. </table>
  3388. <h3><a name="Subtraction"></a>Subtraction</h3>
  3389. <table border="0" cellpadding="5" cellspacing="5">
  3390. <tbody>
  3391. <tr>
  3392. <td><b>Example</b></td>
  3393. <td>
  3394. <pre style="margin-left:0px">
  3395. uint32_t sub_halfwords(uint32_t val1, uint32_t val2)
  3396. {
  3397. uint32_t res;
  3398. res = __SSUB16(val1, val2);
  3399. return res;
  3400. }</pre>
  3401. </td>
  3402. </tr>
  3403. </tbody>
  3404. </table>
  3405. <h3><a name="Multiplication"></a>Multiplication</h3>
  3406. <table border="0" cellpadding="5" cellspacing="5">
  3407. <tbody>
  3408. <tr>
  3409. <td><b>Example</b></td>
  3410. <td>
  3411. <pre style="margin-left:0px">
  3412. uint32_t dual_mul_add_products(uint32_t val1, uint32_t val2)
  3413. {
  3414. uint32_t res;
  3415. res = __SMUAD(val1, val2);
  3416. return res;
  3417. }</pre>
  3418. </td>
  3419. </tr>
  3420. </tbody>
  3421. </table>
  3422. </body>
  3423. </html>