1 <!-- HTML header for doxygen 1.8.20-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <meta name="generator" content="Doxygen 1.9.4"/>
8 <meta name="viewport" content="width=device-width, initial-scale=1"/>
9 <title>Raspberry Pi Pico SDK: hardware_divider</title>
10 <!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="dynsections.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <link href="search/search.css" rel="stylesheet" type="text/css"/>
18 <script type="text/javascript" src="search/searchdata.js"></script>
19 <script type="text/javascript" src="search/search.js"></script>
20 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
21 <link href="doxygen.css" rel="stylesheet" type="text/css" />
22 <link href="normalise.css" rel="stylesheet" type="text/css"/>
23 <link href="main.css" rel="stylesheet" type="text/css"/>
24 <link href="styles.css" rel="stylesheet" type="text/css"/>
27 <div class="navigation-mobile">
28 <div class="logo--mobile">
29 <a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
31 <div class="navigation-toggle">
32 <span class="line-1"></span>
36 <span class="line-3"></span>
39 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
41 <a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
42 <span style="display: inline-block; margin-top: 10px;">
46 <div class="navigation-footer">
47 <img src="logo-mobile.svg" alt="Raspberry Pi">
48 <a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
50 <!-- <div class="search">
52 <input type="search" name="search" id="search" placeholder="Search">
53 <input type="submit" value="Search">
56 <!-- Generated by Doxygen 1.9.4 -->
57 <script type="text/javascript">
58 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
59 var searchBox = new SearchBox("searchBox", "search",'Search','.html');
62 <script type="text/javascript" src="menudata.js"></script>
63 <script type="text/javascript" src="menu.js"></script>
64 <script type="text/javascript">
65 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
67 initMenu('',true,false,'search.php','Search');
68 $(document).ready(function() { init_search(); });
72 <div id="main-nav"></div>
74 <div id="side-nav" class="ui-resizable side-nav-resizable">
76 <div id="nav-tree-contents">
77 <div id="nav-sync" class="sync"></div>
80 <div id="splitbar" style="-moz-user-select:none;"
81 class="ui-resizable-handle">
84 <script type="text/javascript">
85 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
86 $(document).ready(function(){initNavTree('group__hardware__divider.html',''); initResizable(); });
89 <div id="doc-content">
90 <!-- window showing the filter options -->
91 <div id="MSearchSelectWindow"
92 onmouseover="return searchBox.OnSearchSelectShow()"
93 onmouseout="return searchBox.OnSearchSelectHide()"
94 onkeydown="return searchBox.OnSearchSelectKey(event)">
97 <!-- iframe showing the search results (closed by default) -->
98 <div id="MSearchResultsWindow">
99 <iframe src="javascript:void(0)" frameborder="0"
100 name="MSearchResults" id="MSearchResults">
105 <div class="summary">
106 <a href="#func-members">Functions</a> </div>
107 <div class="headertitle"><div class="title">hardware_divider<div class="ingroups"><a class="el" href="group__hardware.html">Hardware APIs</a></div></div></div>
109 <div class="contents">
111 <p>RP2040 Low Low-level hardware-divider API. Non-RP2040 platforms provide software versions of all the functions.
112 <a href="#details">More...</a></p>
113 <table class="memberdecls">
114 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
115 Functions</h2></td></tr>
116 <tr class="memitem:ga806e168e895d53a3c261ba3e95ed2639"><td class="memItemLeft" align="right" valign="top">static divmod_result_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga806e168e895d53a3c261ba3e95ed2639">hw_divider_divmod_s32</a> (int32_t a, int32_t b)</td></tr>
117 <tr class="memdesc:ga806e168e895d53a3c261ba3e95ed2639"><td class="mdescLeft"> </td><td class="mdescRight">Do a signed HW divide and wait for result. <a href="group__hardware__divider.html#ga806e168e895d53a3c261ba3e95ed2639">More...</a><br /></td></tr>
118 <tr class="separator:ga806e168e895d53a3c261ba3e95ed2639"><td class="memSeparator" colspan="2"> </td></tr>
119 <tr class="memitem:gac2f4fea8c3ef19a04e574f64f5f520c2"><td class="memItemLeft" align="right" valign="top">static divmod_result_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gac2f4fea8c3ef19a04e574f64f5f520c2">hw_divider_divmod_u32</a> (uint32_t a, uint32_t b)</td></tr>
120 <tr class="memdesc:gac2f4fea8c3ef19a04e574f64f5f520c2"><td class="mdescLeft"> </td><td class="mdescRight">Do an unsigned HW divide and wait for result. <a href="group__hardware__divider.html#gac2f4fea8c3ef19a04e574f64f5f520c2">More...</a><br /></td></tr>
121 <tr class="separator:gac2f4fea8c3ef19a04e574f64f5f520c2"><td class="memSeparator" colspan="2"> </td></tr>
122 <tr class="memitem:ga3388fa85b0c81ee403a3e5bb34dc7274"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga3388fa85b0c81ee403a3e5bb34dc7274">hw_divider_divmod_s32_start</a> (int32_t a, int32_t b)</td></tr>
123 <tr class="memdesc:ga3388fa85b0c81ee403a3e5bb34dc7274"><td class="mdescLeft"> </td><td class="mdescRight">Start a signed asynchronous divide. <a href="group__hardware__divider.html#ga3388fa85b0c81ee403a3e5bb34dc7274">More...</a><br /></td></tr>
124 <tr class="separator:ga3388fa85b0c81ee403a3e5bb34dc7274"><td class="memSeparator" colspan="2"> </td></tr>
125 <tr class="memitem:ga30b74e3742fbd3aeb6dfca568e8d0ae4"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga30b74e3742fbd3aeb6dfca568e8d0ae4">hw_divider_divmod_u32_start</a> (uint32_t a, uint32_t b)</td></tr>
126 <tr class="memdesc:ga30b74e3742fbd3aeb6dfca568e8d0ae4"><td class="mdescLeft"> </td><td class="mdescRight">Start an unsigned asynchronous divide. <a href="group__hardware__divider.html#ga30b74e3742fbd3aeb6dfca568e8d0ae4">More...</a><br /></td></tr>
127 <tr class="separator:ga30b74e3742fbd3aeb6dfca568e8d0ae4"><td class="memSeparator" colspan="2"> </td></tr>
128 <tr class="memitem:ga82cfc7c264f332ad15135158a37821dc"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc">hw_divider_wait_ready</a> (void)</td></tr>
129 <tr class="memdesc:ga82cfc7c264f332ad15135158a37821dc"><td class="mdescLeft"> </td><td class="mdescRight">Wait for a divide to complete. <a href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc">More...</a><br /></td></tr>
130 <tr class="separator:ga82cfc7c264f332ad15135158a37821dc"><td class="memSeparator" colspan="2"> </td></tr>
131 <tr class="memitem:ga57310adb7901fb25ee82370130834e1d"><td class="memItemLeft" align="right" valign="top">static divmod_result_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga57310adb7901fb25ee82370130834e1d">hw_divider_result_nowait</a> (void)</td></tr>
132 <tr class="memdesc:ga57310adb7901fb25ee82370130834e1d"><td class="mdescLeft"> </td><td class="mdescRight">Return result of HW divide, nowait. <a href="group__hardware__divider.html#ga57310adb7901fb25ee82370130834e1d">More...</a><br /></td></tr>
133 <tr class="separator:ga57310adb7901fb25ee82370130834e1d"><td class="memSeparator" colspan="2"> </td></tr>
134 <tr class="memitem:gac1fa72fbead3c6737dfcb4dd7b3db6ed"><td class="memItemLeft" align="right" valign="top">static divmod_result_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gac1fa72fbead3c6737dfcb4dd7b3db6ed">hw_divider_result_wait</a> (void)</td></tr>
135 <tr class="memdesc:gac1fa72fbead3c6737dfcb4dd7b3db6ed"><td class="mdescLeft"> </td><td class="mdescRight">Return result of last asynchronous HW divide. <a href="group__hardware__divider.html#gac1fa72fbead3c6737dfcb4dd7b3db6ed">More...</a><br /></td></tr>
136 <tr class="separator:gac1fa72fbead3c6737dfcb4dd7b3db6ed"><td class="memSeparator" colspan="2"> </td></tr>
137 <tr class="memitem:ga21752b8ee127370df37cd9a9e4e4050e"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga21752b8ee127370df37cd9a9e4e4050e">to_quotient_u32</a> (divmod_result_t r)</td></tr>
138 <tr class="memdesc:ga21752b8ee127370df37cd9a9e4e4050e"><td class="mdescLeft"> </td><td class="mdescRight">Efficient extraction of unsigned quotient from 32p32 fixed point. <a href="group__hardware__divider.html#ga21752b8ee127370df37cd9a9e4e4050e">More...</a><br /></td></tr>
139 <tr class="separator:ga21752b8ee127370df37cd9a9e4e4050e"><td class="memSeparator" colspan="2"> </td></tr>
140 <tr class="memitem:ga62820b8678505f5ea007cedd012da0aa"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga62820b8678505f5ea007cedd012da0aa">to_quotient_s32</a> (divmod_result_t r)</td></tr>
141 <tr class="memdesc:ga62820b8678505f5ea007cedd012da0aa"><td class="mdescLeft"> </td><td class="mdescRight">Efficient extraction of signed quotient from 32p32 fixed point. <a href="group__hardware__divider.html#ga62820b8678505f5ea007cedd012da0aa">More...</a><br /></td></tr>
142 <tr class="separator:ga62820b8678505f5ea007cedd012da0aa"><td class="memSeparator" colspan="2"> </td></tr>
143 <tr class="memitem:gaea3762e4a27f1e42f8e03e6607917462"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gaea3762e4a27f1e42f8e03e6607917462">to_remainder_u32</a> (divmod_result_t r)</td></tr>
144 <tr class="memdesc:gaea3762e4a27f1e42f8e03e6607917462"><td class="mdescLeft"> </td><td class="mdescRight">Efficient extraction of unsigned remainder from 32p32 fixed point. <a href="group__hardware__divider.html#gaea3762e4a27f1e42f8e03e6607917462">More...</a><br /></td></tr>
145 <tr class="separator:gaea3762e4a27f1e42f8e03e6607917462"><td class="memSeparator" colspan="2"> </td></tr>
146 <tr class="memitem:ga7ca08fd8fd1961ee25233d4587067178"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga7ca08fd8fd1961ee25233d4587067178">to_remainder_s32</a> (divmod_result_t r)</td></tr>
147 <tr class="memdesc:ga7ca08fd8fd1961ee25233d4587067178"><td class="mdescLeft"> </td><td class="mdescRight">Efficient extraction of signed remainder from 32p32 fixed point. <a href="group__hardware__divider.html#ga7ca08fd8fd1961ee25233d4587067178">More...</a><br /></td></tr>
148 <tr class="separator:ga7ca08fd8fd1961ee25233d4587067178"><td class="memSeparator" colspan="2"> </td></tr>
149 <tr class="memitem:ga56d6c26b06211b6f6ae3069b2c612562"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga56d6c26b06211b6f6ae3069b2c612562">hw_divider_u32_quotient_wait</a> (void)</td></tr>
150 <tr class="memdesc:ga56d6c26b06211b6f6ae3069b2c612562"><td class="mdescLeft"> </td><td class="mdescRight">Return result of last asynchronous HW divide, unsigned quotient only. <a href="group__hardware__divider.html#ga56d6c26b06211b6f6ae3069b2c612562">More...</a><br /></td></tr>
151 <tr class="separator:ga56d6c26b06211b6f6ae3069b2c612562"><td class="memSeparator" colspan="2"> </td></tr>
152 <tr class="memitem:gab10a183b8e7bd77ae20a811a4265ea56"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gab10a183b8e7bd77ae20a811a4265ea56">hw_divider_s32_quotient_wait</a> (void)</td></tr>
153 <tr class="memdesc:gab10a183b8e7bd77ae20a811a4265ea56"><td class="mdescLeft"> </td><td class="mdescRight">Return result of last asynchronous HW divide, signed quotient only. <a href="group__hardware__divider.html#gab10a183b8e7bd77ae20a811a4265ea56">More...</a><br /></td></tr>
154 <tr class="separator:gab10a183b8e7bd77ae20a811a4265ea56"><td class="memSeparator" colspan="2"> </td></tr>
155 <tr class="memitem:ga2e23739484aa748a5900d215d279acdf"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga2e23739484aa748a5900d215d279acdf">hw_divider_u32_remainder_wait</a> (void)</td></tr>
156 <tr class="memdesc:ga2e23739484aa748a5900d215d279acdf"><td class="mdescLeft"> </td><td class="mdescRight">Return result of last asynchronous HW divide, unsigned remainder only. <a href="group__hardware__divider.html#ga2e23739484aa748a5900d215d279acdf">More...</a><br /></td></tr>
157 <tr class="separator:ga2e23739484aa748a5900d215d279acdf"><td class="memSeparator" colspan="2"> </td></tr>
158 <tr class="memitem:gad2e7f31926e286544a8d47fdf8131eb5"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gad2e7f31926e286544a8d47fdf8131eb5">hw_divider_s32_remainder_wait</a> (void)</td></tr>
159 <tr class="memdesc:gad2e7f31926e286544a8d47fdf8131eb5"><td class="mdescLeft"> </td><td class="mdescRight">Return result of last asynchronous HW divide, signed remainder only. <a href="group__hardware__divider.html#gad2e7f31926e286544a8d47fdf8131eb5">More...</a><br /></td></tr>
160 <tr class="separator:gad2e7f31926e286544a8d47fdf8131eb5"><td class="memSeparator" colspan="2"> </td></tr>
161 <tr class="memitem:ga8f8f25f9f8feefb588fefed9992e180b"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga8f8f25f9f8feefb588fefed9992e180b">hw_divider_u32_quotient</a> (uint32_t a, uint32_t b)</td></tr>
162 <tr class="memdesc:ga8f8f25f9f8feefb588fefed9992e180b"><td class="mdescLeft"> </td><td class="mdescRight">Do an unsigned HW divide, wait for result, return quotient. <a href="group__hardware__divider.html#ga8f8f25f9f8feefb588fefed9992e180b">More...</a><br /></td></tr>
163 <tr class="separator:ga8f8f25f9f8feefb588fefed9992e180b"><td class="memSeparator" colspan="2"> </td></tr>
164 <tr class="memitem:gaa9fec9c4204fb6f874f660b529190d96"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gaa9fec9c4204fb6f874f660b529190d96">hw_divider_u32_remainder</a> (uint32_t a, uint32_t b)</td></tr>
165 <tr class="memdesc:gaa9fec9c4204fb6f874f660b529190d96"><td class="mdescLeft"> </td><td class="mdescRight">Do an unsigned HW divide, wait for result, return remainder. <a href="group__hardware__divider.html#gaa9fec9c4204fb6f874f660b529190d96">More...</a><br /></td></tr>
166 <tr class="separator:gaa9fec9c4204fb6f874f660b529190d96"><td class="memSeparator" colspan="2"> </td></tr>
167 <tr class="memitem:ga1a4e287ce14e27ad959f30e16ee17e4f"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga1a4e287ce14e27ad959f30e16ee17e4f">hw_divider_quotient_s32</a> (int32_t a, int32_t b)</td></tr>
168 <tr class="memdesc:ga1a4e287ce14e27ad959f30e16ee17e4f"><td class="mdescLeft"> </td><td class="mdescRight">Do a signed HW divide, wait for result, return quotient. <a href="group__hardware__divider.html#ga1a4e287ce14e27ad959f30e16ee17e4f">More...</a><br /></td></tr>
169 <tr class="separator:ga1a4e287ce14e27ad959f30e16ee17e4f"><td class="memSeparator" colspan="2"> </td></tr>
170 <tr class="memitem:ga41fe9c9d7dd1e9638ec5dd724698adad"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga41fe9c9d7dd1e9638ec5dd724698adad">hw_divider_remainder_s32</a> (int32_t a, int32_t b)</td></tr>
171 <tr class="memdesc:ga41fe9c9d7dd1e9638ec5dd724698adad"><td class="mdescLeft"> </td><td class="mdescRight">Do a signed HW divide, wait for result, return remainder. <a href="group__hardware__divider.html#ga41fe9c9d7dd1e9638ec5dd724698adad">More...</a><br /></td></tr>
172 <tr class="separator:ga41fe9c9d7dd1e9638ec5dd724698adad"><td class="memSeparator" colspan="2"> </td></tr>
173 <tr class="memitem:gac9751d0cb261941773c083d1e79569e3"><td class="memItemLeft" align="right" valign="top"><a id="gac9751d0cb261941773c083d1e79569e3" name="gac9751d0cb261941773c083d1e79569e3"></a>
174 static void </td><td class="memItemRight" valign="bottom"><b>hw_divider_pause</b> (void)</td></tr>
175 <tr class="memdesc:gac9751d0cb261941773c083d1e79569e3"><td class="mdescLeft"> </td><td class="mdescRight">Pause for exact amount of time needed for a asynchronous divide to complete. <br /></td></tr>
176 <tr class="separator:gac9751d0cb261941773c083d1e79569e3"><td class="memSeparator" colspan="2"> </td></tr>
177 <tr class="memitem:gad18c35723af182a45e044b29cd1e60b2"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gad18c35723af182a45e044b29cd1e60b2">hw_divider_u32_quotient_inlined</a> (uint32_t a, uint32_t b)</td></tr>
178 <tr class="memdesc:gad18c35723af182a45e044b29cd1e60b2"><td class="mdescLeft"> </td><td class="mdescRight">Do a hardware unsigned HW divide, wait for result, return quotient. <a href="group__hardware__divider.html#gad18c35723af182a45e044b29cd1e60b2">More...</a><br /></td></tr>
179 <tr class="separator:gad18c35723af182a45e044b29cd1e60b2"><td class="memSeparator" colspan="2"> </td></tr>
180 <tr class="memitem:ga46f7b5751556b7b1d5600561160abb3c"><td class="memItemLeft" align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga46f7b5751556b7b1d5600561160abb3c">hw_divider_u32_remainder_inlined</a> (uint32_t a, uint32_t b)</td></tr>
181 <tr class="memdesc:ga46f7b5751556b7b1d5600561160abb3c"><td class="mdescLeft"> </td><td class="mdescRight">Do a hardware unsigned HW divide, wait for result, return remainder. <a href="group__hardware__divider.html#ga46f7b5751556b7b1d5600561160abb3c">More...</a><br /></td></tr>
182 <tr class="separator:ga46f7b5751556b7b1d5600561160abb3c"><td class="memSeparator" colspan="2"> </td></tr>
183 <tr class="memitem:ga23a3a2a911f5d78bb56799969b079f94"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga23a3a2a911f5d78bb56799969b079f94">hw_divider_s32_quotient_inlined</a> (int32_t a, int32_t b)</td></tr>
184 <tr class="memdesc:ga23a3a2a911f5d78bb56799969b079f94"><td class="mdescLeft"> </td><td class="mdescRight">Do a hardware signed HW divide, wait for result, return quotient. <a href="group__hardware__divider.html#ga23a3a2a911f5d78bb56799969b079f94">More...</a><br /></td></tr>
185 <tr class="separator:ga23a3a2a911f5d78bb56799969b079f94"><td class="memSeparator" colspan="2"> </td></tr>
186 <tr class="memitem:ga82f0cdc6ef9e74346c0af8e492a0eb8d"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#ga82f0cdc6ef9e74346c0af8e492a0eb8d">hw_divider_s32_remainder_inlined</a> (int32_t a, int32_t b)</td></tr>
187 <tr class="memdesc:ga82f0cdc6ef9e74346c0af8e492a0eb8d"><td class="mdescLeft"> </td><td class="mdescRight">Do a hardware signed HW divide, wait for result, return remainder. <a href="group__hardware__divider.html#ga82f0cdc6ef9e74346c0af8e492a0eb8d">More...</a><br /></td></tr>
188 <tr class="separator:ga82f0cdc6ef9e74346c0af8e492a0eb8d"><td class="memSeparator" colspan="2"> </td></tr>
189 <tr class="memitem:gac12f398a163e90ca4d52386bd7e161b9"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gac12f398a163e90ca4d52386bd7e161b9">hw_divider_save_state</a> (hw_divider_state_t *dest)</td></tr>
190 <tr class="memdesc:gac12f398a163e90ca4d52386bd7e161b9"><td class="mdescLeft"> </td><td class="mdescRight">Save the calling cores hardware divider state. <a href="group__hardware__divider.html#gac12f398a163e90ca4d52386bd7e161b9">More...</a><br /></td></tr>
191 <tr class="separator:gac12f398a163e90ca4d52386bd7e161b9"><td class="memSeparator" colspan="2"> </td></tr>
192 <tr class="memitem:gaa8efb2ea90ef78f863b1c518c5824002"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__divider.html#gaa8efb2ea90ef78f863b1c518c5824002">hw_divider_restore_state</a> (hw_divider_state_t *src)</td></tr>
193 <tr class="memdesc:gaa8efb2ea90ef78f863b1c518c5824002"><td class="mdescLeft"> </td><td class="mdescRight">Load a saved hardware divider state into the current core's hardware divider. <a href="group__hardware__divider.html#gaa8efb2ea90ef78f863b1c518c5824002">More...</a><br /></td></tr>
194 <tr class="separator:gaa8efb2ea90ef78f863b1c518c5824002"><td class="memSeparator" colspan="2"> </td></tr>
196 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
197 <p >RP2040 Low Low-level hardware-divider API. Non-RP2040 platforms provide software versions of all the functions. </p>
198 <p >The SIO contains an 8-cycle signed/unsigned divide/modulo circuit, per core. Calculation is started by writing a dividend and divisor to the two argument registers, DIVIDEND and DIVISOR. The divider calculates the quotient / and remainder % of this division over the next 8 cycles, and on the 9th cycle the results can be read from the two result registers DIV_QUOTIENT and DIV_REMAINDER. A 'ready' bit in register DIV_CSR can be polled to wait for the calculation to complete, or software can insert a fixed 8-cycle delay</p>
199 <p >This header provides low level macros and inline functions for accessing the hardware dividers directly, and perhaps most usefully performing asynchronous divides. These functions however do not follow the regular SDK conventions for saving/restoring the divider state, so are not generally safe to call from interrupt handlers</p>
200 <p >The pico_divider library provides a more user friendly set of APIs over the divider (and support for 64 bit divides), and of course by default regular C language integer divisions are redirected through that library, meaning you can just use C level <code>/</code> and <code>%</code> operators and gain the benefits of the fast hardware divider.</p>
201 <p >On RP2350 there is no hardware divider, and the functions are implemented in software </p>
202 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group__pico__divider.html" title="Optimized 32 and 64 bit division functions accelerated by the RP2040 hardware divider.">pico_divider</a></dd></dl>
203 <h2><a class="anchor" id="divider_example"></a>
205 <div class="fragment"><div class="line"> </div>
206 <div class="line"><span class="preprocessor">#include <<a class="code" href="stdio_8h.html">stdio.h</a>></span></div>
207 <div class="line"><span class="preprocessor">#include "<a class="code" href="stdlib_8h.html">pico/stdlib.h</a>"</span></div>
208 <div class="line"><span class="preprocessor">#include "<a class="code" href="rp2__common_2hardware__divider_2include_2hardware_2divider_8h.html">hardware/divider.h</a>"</span></div>
209 <div class="line"> </div>
210 <div class="line"><span class="keywordtype">int</span> main() {</div>
211 <div class="line"> <a class="code hl_function" href="group__pico__stdio.html#ga0e604311fb226dae91ff4eb17a19d67a">stdio_init_all</a>();</div>
212 <div class="line"> printf(<span class="stringliteral">"Hello, divider!\n"</span>);</div>
213 <div class="line"> </div>
214 <div class="line"> <span class="comment">// This is the basic hardware divider function</span></div>
215 <div class="line"> int32_t dividend = 123456;</div>
216 <div class="line"> int32_t divisor = -321;</div>
217 <div class="line"> divmod_result_t result = <a class="code hl_function" href="group__hardware__divider.html#ga806e168e895d53a3c261ba3e95ed2639">hw_divider_divmod_s32</a>(dividend, divisor);</div>
218 <div class="line"> </div>
219 <div class="line"> printf(<span class="stringliteral">"%d/%d = %d remainder %d\n"</span>, dividend, divisor, <a class="code hl_function" href="group__hardware__divider.html#ga62820b8678505f5ea007cedd012da0aa">to_quotient_s32</a>(result), <a class="code hl_function" href="group__hardware__divider.html#ga7ca08fd8fd1961ee25233d4587067178">to_remainder_s32</a>(result));</div>
220 <div class="line"> </div>
221 <div class="line"> <span class="comment">// Is it right?</span></div>
222 <div class="line"> </div>
223 <div class="line"> printf(<span class="stringliteral">"Working backwards! Result %d should equal %d!\n\n"</span>,</div>
224 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#ga62820b8678505f5ea007cedd012da0aa">to_quotient_s32</a>(result) * divisor + <a class="code hl_function" href="group__hardware__divider.html#ga7ca08fd8fd1961ee25233d4587067178">to_remainder_s32</a>(result), dividend);</div>
225 <div class="line"> </div>
226 <div class="line"> <span class="comment">// This is the recommended unsigned fast divider for general use.</span></div>
227 <div class="line"> int32_t udividend = 123456;</div>
228 <div class="line"> int32_t udivisor = 321;</div>
229 <div class="line"> divmod_result_t uresult = <a class="code hl_function" href="group__hardware__divider.html#gac2f4fea8c3ef19a04e574f64f5f520c2">hw_divider_divmod_u32</a>(udividend, udivisor);</div>
230 <div class="line"> </div>
231 <div class="line"> printf(<span class="stringliteral">"%d/%d = %d remainder %d\n"</span>, udividend, udivisor, <a class="code hl_function" href="group__hardware__divider.html#ga21752b8ee127370df37cd9a9e4e4050e">to_quotient_u32</a>(uresult), <a class="code hl_function" href="group__hardware__divider.html#gaea3762e4a27f1e42f8e03e6607917462">to_remainder_u32</a>(uresult));</div>
232 <div class="line"> </div>
233 <div class="line"> <span class="comment">// Is it right?</span></div>
234 <div class="line"> </div>
235 <div class="line"> printf(<span class="stringliteral">"Working backwards! Result %d should equal %d!\n\n"</span>,</div>
236 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#ga21752b8ee127370df37cd9a9e4e4050e">to_quotient_u32</a>(result) * divisor + <a class="code hl_function" href="group__hardware__divider.html#gaea3762e4a27f1e42f8e03e6607917462">to_remainder_u32</a>(result), dividend);</div>
237 <div class="line"> </div>
238 <div class="line"> <span class="comment">// You can also do divides asynchronously. Divides will be complete after 8 cycles.</span></div>
239 <div class="line"> </div>
240 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#ga3388fa85b0c81ee403a3e5bb34dc7274">hw_divider_divmod_s32_start</a>(dividend, divisor);</div>
241 <div class="line"> </div>
242 <div class="line"> <span class="comment">// Do something for 8 cycles!</span></div>
243 <div class="line"> </div>
244 <div class="line"> <span class="comment">// In this example, our results function will wait for completion.</span></div>
245 <div class="line"> <span class="comment">// Use hw_divider_result_nowait() if you don't want to wait, but are sure you have delayed at least 8 cycles</span></div>
246 <div class="line"> </div>
247 <div class="line"> result = <a class="code hl_function" href="group__hardware__divider.html#gac1fa72fbead3c6737dfcb4dd7b3db6ed">hw_divider_result_wait</a>();</div>
248 <div class="line"> </div>
249 <div class="line"> printf(<span class="stringliteral">"Async result %d/%d = %d remainder %d\n"</span>, dividend, divisor, <a class="code hl_function" href="group__hardware__divider.html#ga62820b8678505f5ea007cedd012da0aa">to_quotient_s32</a>(result),</div>
250 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#ga7ca08fd8fd1961ee25233d4587067178">to_remainder_s32</a>(result));</div>
251 <div class="line"> </div>
252 <div class="line"> <span class="comment">// For a really fast divide, you can use the inlined versions... the / involves a function call as / always does</span></div>
253 <div class="line"> <span class="comment">// when using the ARM AEABI, so if you really want the best performance use the inlined versions.</span></div>
254 <div class="line"> <span class="comment">// Note that the / operator function DOES use the hardware divider by default, although you can change</span></div>
255 <div class="line"> <span class="comment">// that behavior by calling pico_set_divider_implementation in the cmake build for your target.</span></div>
256 <div class="line"> printf(<span class="stringliteral">"%d / %d = (by operator %d) (inlined %d)\n"</span>, dividend, divisor,</div>
257 <div class="line"> dividend / divisor, <a class="code hl_function" href="group__hardware__divider.html#ga23a3a2a911f5d78bb56799969b079f94">hw_divider_s32_quotient_inlined</a>(dividend, divisor));</div>
258 <div class="line"> </div>
259 <div class="line"> <span class="comment">// Note however you must manually save/restore the divider state if you call the inlined methods from within an IRQ</span></div>
260 <div class="line"> <span class="comment">// handler.</span></div>
261 <div class="line"> hw_divider_state_t state;</div>
262 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#ga3388fa85b0c81ee403a3e5bb34dc7274">hw_divider_divmod_s32_start</a>(dividend, divisor);</div>
263 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#gac12f398a163e90ca4d52386bd7e161b9">hw_divider_save_state</a>(&state);</div>
264 <div class="line"> </div>
265 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#ga3388fa85b0c81ee403a3e5bb34dc7274">hw_divider_divmod_s32_start</a>(123, 7);</div>
266 <div class="line"> printf(<span class="stringliteral">"inner %d / %d = %d\n"</span>, 123, 7, <a class="code hl_function" href="group__hardware__divider.html#gab10a183b8e7bd77ae20a811a4265ea56">hw_divider_s32_quotient_wait</a>());</div>
267 <div class="line"> </div>
268 <div class="line"> <a class="code hl_function" href="group__hardware__divider.html#gaa8efb2ea90ef78f863b1c518c5824002">hw_divider_restore_state</a>(&state);</div>
269 <div class="line"> int32_t tmp = <a class="code hl_function" href="group__hardware__divider.html#gab10a183b8e7bd77ae20a811a4265ea56">hw_divider_s32_quotient_wait</a>();</div>
270 <div class="line"> printf(<span class="stringliteral">"outer divide %d / %d = %d\n"</span>, dividend, divisor, tmp);</div>
271 <div class="line"> <span class="keywordflow">return</span> 0;</div>
272 <div class="line">}</div>
273 <div class="ttc" id="agroup__hardware__divider_html_ga21752b8ee127370df37cd9a9e4e4050e"><div class="ttname"><a href="group__hardware__divider.html#ga21752b8ee127370df37cd9a9e4e4050e">to_quotient_u32</a></div><div class="ttdeci">static uint32_t to_quotient_u32(divmod_result_t r)</div><div class="ttdoc">Efficient extraction of unsigned quotient from 32p32 fixed point.</div><div class="ttdef"><b>Definition:</b> divider.h:198</div></div>
274 <div class="ttc" id="agroup__hardware__divider_html_ga23a3a2a911f5d78bb56799969b079f94"><div class="ttname"><a href="group__hardware__divider.html#ga23a3a2a911f5d78bb56799969b079f94">hw_divider_s32_quotient_inlined</a></div><div class="ttdeci">static int32_t hw_divider_s32_quotient_inlined(int32_t a, int32_t b)</div><div class="ttdoc">Do a hardware signed HW divide, wait for result, return quotient.</div><div class="ttdef"><b>Definition:</b> divider.h:440</div></div>
275 <div class="ttc" id="agroup__hardware__divider_html_ga3388fa85b0c81ee403a3e5bb34dc7274"><div class="ttname"><a href="group__hardware__divider.html#ga3388fa85b0c81ee403a3e5bb34dc7274">hw_divider_divmod_s32_start</a></div><div class="ttdeci">static void hw_divider_divmod_s32_start(int32_t a, int32_t b)</div><div class="ttdoc">Start a signed asynchronous divide.</div><div class="ttdef"><b>Definition:</b> divider.h:107</div></div>
276 <div class="ttc" id="agroup__hardware__divider_html_ga62820b8678505f5ea007cedd012da0aa"><div class="ttname"><a href="group__hardware__divider.html#ga62820b8678505f5ea007cedd012da0aa">to_quotient_s32</a></div><div class="ttdeci">static int32_t to_quotient_s32(divmod_result_t r)</div><div class="ttdoc">Efficient extraction of signed quotient from 32p32 fixed point.</div><div class="ttdef"><b>Definition:</b> divider.h:208</div></div>
277 <div class="ttc" id="agroup__hardware__divider_html_ga7ca08fd8fd1961ee25233d4587067178"><div class="ttname"><a href="group__hardware__divider.html#ga7ca08fd8fd1961ee25233d4587067178">to_remainder_s32</a></div><div class="ttdeci">static int32_t to_remainder_s32(divmod_result_t r)</div><div class="ttdoc">Efficient extraction of signed remainder from 32p32 fixed point.</div><div class="ttdef"><b>Definition:</b> divider.h:232</div></div>
278 <div class="ttc" id="agroup__hardware__divider_html_ga806e168e895d53a3c261ba3e95ed2639"><div class="ttname"><a href="group__hardware__divider.html#ga806e168e895d53a3c261ba3e95ed2639">hw_divider_divmod_s32</a></div><div class="ttdeci">static divmod_result_t hw_divider_divmod_s32(int32_t a, int32_t b)</div><div class="ttdoc">Do a signed HW divide and wait for result.</div><div class="ttdef"><b>Definition:</b> divider.h:74</div></div>
279 <div class="ttc" id="agroup__hardware__divider_html_gaa8efb2ea90ef78f863b1c518c5824002"><div class="ttname"><a href="group__hardware__divider.html#gaa8efb2ea90ef78f863b1c518c5824002">hw_divider_restore_state</a></div><div class="ttdeci">static void hw_divider_restore_state(hw_divider_state_t *src)</div><div class="ttdoc">Load a saved hardware divider state into the current core's hardware divider.</div><div class="ttdef"><b>Definition:</b> divider.h:506</div></div>
280 <div class="ttc" id="agroup__hardware__divider_html_gab10a183b8e7bd77ae20a811a4265ea56"><div class="ttname"><a href="group__hardware__divider.html#gab10a183b8e7bd77ae20a811a4265ea56">hw_divider_s32_quotient_wait</a></div><div class="ttdeci">static int32_t hw_divider_s32_quotient_wait(void)</div><div class="ttdoc">Return result of last asynchronous HW divide, signed quotient only.</div><div class="ttdef"><b>Definition:</b> divider.h:260</div></div>
281 <div class="ttc" id="agroup__hardware__divider_html_gac12f398a163e90ca4d52386bd7e161b9"><div class="ttname"><a href="group__hardware__divider.html#gac12f398a163e90ca4d52386bd7e161b9">hw_divider_save_state</a></div><div class="ttdeci">static void hw_divider_save_state(hw_divider_state_t *dest)</div><div class="ttdoc">Save the calling cores hardware divider state.</div><div class="ttdef"><b>Definition:</b> divider.h:491</div></div>
282 <div class="ttc" id="agroup__hardware__divider_html_gac1fa72fbead3c6737dfcb4dd7b3db6ed"><div class="ttname"><a href="group__hardware__divider.html#gac1fa72fbead3c6737dfcb4dd7b3db6ed">hw_divider_result_wait</a></div><div class="ttdeci">static divmod_result_t hw_divider_result_wait(void)</div><div class="ttdoc">Return result of last asynchronous HW divide.</div><div class="ttdef"><b>Definition:</b> divider.h:187</div></div>
283 <div class="ttc" id="agroup__hardware__divider_html_gac2f4fea8c3ef19a04e574f64f5f520c2"><div class="ttname"><a href="group__hardware__divider.html#gac2f4fea8c3ef19a04e574f64f5f520c2">hw_divider_divmod_u32</a></div><div class="ttdeci">static divmod_result_t hw_divider_divmod_u32(uint32_t a, uint32_t b)</div><div class="ttdoc">Do an unsigned HW divide and wait for result.</div><div class="ttdef"><b>Definition:</b> divider.h:92</div></div>
284 <div class="ttc" id="agroup__hardware__divider_html_gaea3762e4a27f1e42f8e03e6607917462"><div class="ttname"><a href="group__hardware__divider.html#gaea3762e4a27f1e42f8e03e6607917462">to_remainder_u32</a></div><div class="ttdeci">static uint32_t to_remainder_u32(divmod_result_t r)</div><div class="ttdoc">Efficient extraction of unsigned remainder from 32p32 fixed point.</div><div class="ttdef"><b>Definition:</b> divider.h:220</div></div>
285 <div class="ttc" id="agroup__pico__stdio_html_ga0e604311fb226dae91ff4eb17a19d67a"><div class="ttname"><a href="group__pico__stdio.html#ga0e604311fb226dae91ff4eb17a19d67a">stdio_init_all</a></div><div class="ttdeci">bool stdio_init_all(void)</div><div class="ttdoc">Initialize all of the present standard stdio types that are linked into the binary.</div><div class="ttdef"><b>Definition:</b> stdio.c:200</div></div>
286 <div class="ttc" id="arp2__common_2hardware__divider_2include_2hardware_2divider_8h_html"><div class="ttname"><a href="rp2__common_2hardware__divider_2include_2hardware_2divider_8h.html">divider.h</a></div></div>
287 <div class="ttc" id="astdio_8h_html"><div class="ttname"><a href="stdio_8h.html">stdio.h</a></div></div>
288 <div class="ttc" id="astdlib_8h_html"><div class="ttname"><a href="stdlib_8h.html">stdlib.h</a></div></div>
289 </div><!-- fragment --> <h2 class="groupheader">Function Documentation</h2>
290 <a id="ga806e168e895d53a3c261ba3e95ed2639" name="ga806e168e895d53a3c261ba3e95ed2639"></a>
291 <h2 class="memtitle"><span class="permalink"><a href="#ga806e168e895d53a3c261ba3e95ed2639">◆ </a></span>hw_divider_divmod_s32()</h2>
293 <div class="memitem">
294 <div class="memproto">
295 <table class="mlabels">
297 <td class="mlabels-left">
298 <table class="memname">
300 <td class="memname">static divmod_result_t hw_divider_divmod_s32 </td>
302 <td class="paramtype">int32_t </td>
303 <td class="paramname"><em>a</em>, </td>
306 <td class="paramkey"></td>
308 <td class="paramtype">int32_t </td>
309 <td class="paramname"><em>b</em> </td>
318 <td class="mlabels-right">
319 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
322 </div><div class="memdoc">
324 <p>Do a signed HW divide and wait for result. </p>
325 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return result as a pair of 32-bit quotient/remainder values.</p>
326 <dl class="params"><dt>Parameters</dt><dd>
327 <table class="params">
328 <tr><td class="paramname">a</td><td>The dividend </td></tr>
329 <tr><td class="paramname">b</td><td>The divisor </td></tr>
333 <dl class="section return"><dt>Returns</dt><dd>Results of divide as a pair of 32-bit quotient/remainder values. </dd></dl>
337 <a id="ga3388fa85b0c81ee403a3e5bb34dc7274" name="ga3388fa85b0c81ee403a3e5bb34dc7274"></a>
338 <h2 class="memtitle"><span class="permalink"><a href="#ga3388fa85b0c81ee403a3e5bb34dc7274">◆ </a></span>hw_divider_divmod_s32_start()</h2>
340 <div class="memitem">
341 <div class="memproto">
342 <table class="mlabels">
344 <td class="mlabels-left">
345 <table class="memname">
347 <td class="memname">static void hw_divider_divmod_s32_start </td>
349 <td class="paramtype">int32_t </td>
350 <td class="paramname"><em>a</em>, </td>
353 <td class="paramkey"></td>
355 <td class="paramtype">int32_t </td>
356 <td class="paramname"><em>b</em> </td>
365 <td class="mlabels-right">
366 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
369 </div><div class="memdoc">
371 <p>Start a signed asynchronous divide. </p>
372 <p >Start a divide of the specified signed parameters. You should wait for 8 cycles (__div_pause()) or wait for the ready bit to be set (<a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>) prior to reading the results.</p>
373 <dl class="params"><dt>Parameters</dt><dd>
374 <table class="params">
375 <tr><td class="paramname">a</td><td>The dividend </td></tr>
376 <tr><td class="paramname">b</td><td>The divisor </td></tr>
383 <a id="gac2f4fea8c3ef19a04e574f64f5f520c2" name="gac2f4fea8c3ef19a04e574f64f5f520c2"></a>
384 <h2 class="memtitle"><span class="permalink"><a href="#gac2f4fea8c3ef19a04e574f64f5f520c2">◆ </a></span>hw_divider_divmod_u32()</h2>
386 <div class="memitem">
387 <div class="memproto">
388 <table class="mlabels">
390 <td class="mlabels-left">
391 <table class="memname">
393 <td class="memname">static divmod_result_t hw_divider_divmod_u32 </td>
395 <td class="paramtype">uint32_t </td>
396 <td class="paramname"><em>a</em>, </td>
399 <td class="paramkey"></td>
401 <td class="paramtype">uint32_t </td>
402 <td class="paramname"><em>b</em> </td>
411 <td class="mlabels-right">
412 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
415 </div><div class="memdoc">
417 <p>Do an unsigned HW divide and wait for result. </p>
418 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return result as a pair of 32-bit quotient/remainder values.</p>
419 <dl class="params"><dt>Parameters</dt><dd>
420 <table class="params">
421 <tr><td class="paramname">a</td><td>The dividend </td></tr>
422 <tr><td class="paramname">b</td><td>The divisor </td></tr>
426 <dl class="section return"><dt>Returns</dt><dd>Results of divide as a pair of 32-bit quotient/remainder values. </dd></dl>
430 <a id="ga30b74e3742fbd3aeb6dfca568e8d0ae4" name="ga30b74e3742fbd3aeb6dfca568e8d0ae4"></a>
431 <h2 class="memtitle"><span class="permalink"><a href="#ga30b74e3742fbd3aeb6dfca568e8d0ae4">◆ </a></span>hw_divider_divmod_u32_start()</h2>
433 <div class="memitem">
434 <div class="memproto">
435 <table class="mlabels">
437 <td class="mlabels-left">
438 <table class="memname">
440 <td class="memname">static void hw_divider_divmod_u32_start </td>
442 <td class="paramtype">uint32_t </td>
443 <td class="paramname"><em>a</em>, </td>
446 <td class="paramkey"></td>
448 <td class="paramtype">uint32_t </td>
449 <td class="paramname"><em>b</em> </td>
458 <td class="mlabels-right">
459 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
462 </div><div class="memdoc">
464 <p>Start an unsigned asynchronous divide. </p>
465 <p >Start a divide of the specified unsigned parameters. You should wait for 8 cycles (__div_pause()) or wait for the ready bit to be set (<a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>) prior to reading the results.</p>
466 <dl class="params"><dt>Parameters</dt><dd>
467 <table class="params">
468 <tr><td class="paramname">a</td><td>The dividend </td></tr>
469 <tr><td class="paramname">b</td><td>The divisor </td></tr>
476 <a id="ga1a4e287ce14e27ad959f30e16ee17e4f" name="ga1a4e287ce14e27ad959f30e16ee17e4f"></a>
477 <h2 class="memtitle"><span class="permalink"><a href="#ga1a4e287ce14e27ad959f30e16ee17e4f">◆ </a></span>hw_divider_quotient_s32()</h2>
479 <div class="memitem">
480 <div class="memproto">
481 <table class="mlabels">
483 <td class="mlabels-left">
484 <table class="memname">
486 <td class="memname">static int32_t hw_divider_quotient_s32 </td>
488 <td class="paramtype">int32_t </td>
489 <td class="paramname"><em>a</em>, </td>
492 <td class="paramkey"></td>
494 <td class="paramtype">int32_t </td>
495 <td class="paramname"><em>b</em> </td>
504 <td class="mlabels-right">
505 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
508 </div><div class="memdoc">
510 <p>Do a signed HW divide, wait for result, return quotient. </p>
511 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return quotient.</p>
512 <dl class="params"><dt>Parameters</dt><dd>
513 <table class="params">
514 <tr><td class="paramname">a</td><td>The dividend </td></tr>
515 <tr><td class="paramname">b</td><td>The divisor </td></tr>
519 <dl class="section return"><dt>Returns</dt><dd>Quotient results of the divide </dd></dl>
523 <a id="ga41fe9c9d7dd1e9638ec5dd724698adad" name="ga41fe9c9d7dd1e9638ec5dd724698adad"></a>
524 <h2 class="memtitle"><span class="permalink"><a href="#ga41fe9c9d7dd1e9638ec5dd724698adad">◆ </a></span>hw_divider_remainder_s32()</h2>
526 <div class="memitem">
527 <div class="memproto">
528 <table class="mlabels">
530 <td class="mlabels-left">
531 <table class="memname">
533 <td class="memname">static int32_t hw_divider_remainder_s32 </td>
535 <td class="paramtype">int32_t </td>
536 <td class="paramname"><em>a</em>, </td>
539 <td class="paramkey"></td>
541 <td class="paramtype">int32_t </td>
542 <td class="paramname"><em>b</em> </td>
551 <td class="mlabels-right">
552 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
555 </div><div class="memdoc">
557 <p>Do a signed HW divide, wait for result, return remainder. </p>
558 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return remainder.</p>
559 <dl class="params"><dt>Parameters</dt><dd>
560 <table class="params">
561 <tr><td class="paramname">a</td><td>The dividend </td></tr>
562 <tr><td class="paramname">b</td><td>The divisor </td></tr>
566 <dl class="section return"><dt>Returns</dt><dd>Remainder results of the divide </dd></dl>
570 <a id="gaa8efb2ea90ef78f863b1c518c5824002" name="gaa8efb2ea90ef78f863b1c518c5824002"></a>
571 <h2 class="memtitle"><span class="permalink"><a href="#gaa8efb2ea90ef78f863b1c518c5824002">◆ </a></span>hw_divider_restore_state()</h2>
573 <div class="memitem">
574 <div class="memproto">
575 <table class="mlabels">
577 <td class="mlabels-left">
578 <table class="memname">
580 <td class="memname">static void hw_divider_restore_state </td>
582 <td class="paramtype">hw_divider_state_t * </td>
583 <td class="paramname"><em>src</em></td><td>)</td>
588 <td class="mlabels-right">
589 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
592 </div><div class="memdoc">
594 <p>Load a saved hardware divider state into the current core's hardware divider. </p>
595 <p >Copy the passed hardware divider state into the hardware divider.</p>
596 <dl class="params"><dt>Parameters</dt><dd>
597 <table class="params">
598 <tr><td class="paramname">src</td><td>the location to load the divider state from </td></tr>
605 <a id="ga57310adb7901fb25ee82370130834e1d" name="ga57310adb7901fb25ee82370130834e1d"></a>
606 <h2 class="memtitle"><span class="permalink"><a href="#ga57310adb7901fb25ee82370130834e1d">◆ </a></span>hw_divider_result_nowait()</h2>
608 <div class="memitem">
609 <div class="memproto">
610 <table class="mlabels">
612 <td class="mlabels-left">
613 <table class="memname">
615 <td class="memname">static divmod_result_t hw_divider_result_nowait </td>
617 <td class="paramtype">void </td>
618 <td class="paramname"></td><td>)</td>
623 <td class="mlabels-right">
624 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
627 </div><div class="memdoc">
629 <p>Return result of HW divide, nowait. </p>
630 <dl class="section note"><dt>Note</dt><dd>This is UNSAFE in that the calculation may not have been completed.</dd></dl>
631 <dl class="section return"><dt>Returns</dt><dd>Current result. Most significant 32 bits are the remainder, lower 32 bits are the quotient. </dd></dl>
635 <a id="gac1fa72fbead3c6737dfcb4dd7b3db6ed" name="gac1fa72fbead3c6737dfcb4dd7b3db6ed"></a>
636 <h2 class="memtitle"><span class="permalink"><a href="#gac1fa72fbead3c6737dfcb4dd7b3db6ed">◆ </a></span>hw_divider_result_wait()</h2>
638 <div class="memitem">
639 <div class="memproto">
640 <table class="mlabels">
642 <td class="mlabels-left">
643 <table class="memname">
645 <td class="memname">static divmod_result_t hw_divider_result_wait </td>
647 <td class="paramtype">void </td>
648 <td class="paramname"></td><td>)</td>
653 <td class="mlabels-right">
654 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
657 </div><div class="memdoc">
659 <p>Return result of last asynchronous HW divide. </p>
660 <p >This function waits for the result to be ready by calling <a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>.</p>
661 <dl class="section return"><dt>Returns</dt><dd>Current result. Most significant 32 bits are the remainder, lower 32 bits are the quotient. </dd></dl>
665 <a id="ga23a3a2a911f5d78bb56799969b079f94" name="ga23a3a2a911f5d78bb56799969b079f94"></a>
666 <h2 class="memtitle"><span class="permalink"><a href="#ga23a3a2a911f5d78bb56799969b079f94">◆ </a></span>hw_divider_s32_quotient_inlined()</h2>
668 <div class="memitem">
669 <div class="memproto">
670 <table class="mlabels">
672 <td class="mlabels-left">
673 <table class="memname">
675 <td class="memname">static int32_t hw_divider_s32_quotient_inlined </td>
677 <td class="paramtype">int32_t </td>
678 <td class="paramname"><em>a</em>, </td>
681 <td class="paramkey"></td>
683 <td class="paramtype">int32_t </td>
684 <td class="paramname"><em>b</em> </td>
693 <td class="mlabels-right">
694 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
697 </div><div class="memdoc">
699 <p>Do a hardware signed HW divide, wait for result, return quotient. </p>
700 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return quotient.</p>
701 <dl class="params"><dt>Parameters</dt><dd>
702 <table class="params">
703 <tr><td class="paramname">a</td><td>The dividend </td></tr>
704 <tr><td class="paramname">b</td><td>The divisor </td></tr>
708 <dl class="section return"><dt>Returns</dt><dd>Quotient result of the divide </dd></dl>
712 <a id="gab10a183b8e7bd77ae20a811a4265ea56" name="gab10a183b8e7bd77ae20a811a4265ea56"></a>
713 <h2 class="memtitle"><span class="permalink"><a href="#gab10a183b8e7bd77ae20a811a4265ea56">◆ </a></span>hw_divider_s32_quotient_wait()</h2>
715 <div class="memitem">
716 <div class="memproto">
717 <table class="mlabels">
719 <td class="mlabels-left">
720 <table class="memname">
722 <td class="memname">static int32_t hw_divider_s32_quotient_wait </td>
724 <td class="paramtype">void </td>
725 <td class="paramname"></td><td>)</td>
730 <td class="mlabels-right">
731 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
734 </div><div class="memdoc">
736 <p>Return result of last asynchronous HW divide, signed quotient only. </p>
737 <p >This function waits for the result to be ready by calling <a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>.</p>
738 <dl class="section return"><dt>Returns</dt><dd>Current signed quotient result. </dd></dl>
742 <a id="ga82f0cdc6ef9e74346c0af8e492a0eb8d" name="ga82f0cdc6ef9e74346c0af8e492a0eb8d"></a>
743 <h2 class="memtitle"><span class="permalink"><a href="#ga82f0cdc6ef9e74346c0af8e492a0eb8d">◆ </a></span>hw_divider_s32_remainder_inlined()</h2>
745 <div class="memitem">
746 <div class="memproto">
747 <table class="mlabels">
749 <td class="mlabels-left">
750 <table class="memname">
752 <td class="memname">static int32_t hw_divider_s32_remainder_inlined </td>
754 <td class="paramtype">int32_t </td>
755 <td class="paramname"><em>a</em>, </td>
758 <td class="paramkey"></td>
760 <td class="paramtype">int32_t </td>
761 <td class="paramname"><em>b</em> </td>
770 <td class="mlabels-right">
771 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
774 </div><div class="memdoc">
776 <p>Do a hardware signed HW divide, wait for result, return remainder. </p>
777 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return remainder.</p>
778 <dl class="params"><dt>Parameters</dt><dd>
779 <table class="params">
780 <tr><td class="paramname">a</td><td>The dividend </td></tr>
781 <tr><td class="paramname">b</td><td>The divisor </td></tr>
785 <dl class="section return"><dt>Returns</dt><dd>Remainder result of the divide </dd></dl>
789 <a id="gad2e7f31926e286544a8d47fdf8131eb5" name="gad2e7f31926e286544a8d47fdf8131eb5"></a>
790 <h2 class="memtitle"><span class="permalink"><a href="#gad2e7f31926e286544a8d47fdf8131eb5">◆ </a></span>hw_divider_s32_remainder_wait()</h2>
792 <div class="memitem">
793 <div class="memproto">
794 <table class="mlabels">
796 <td class="mlabels-left">
797 <table class="memname">
799 <td class="memname">static int32_t hw_divider_s32_remainder_wait </td>
801 <td class="paramtype">void </td>
802 <td class="paramname"></td><td>)</td>
807 <td class="mlabels-right">
808 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
811 </div><div class="memdoc">
813 <p>Return result of last asynchronous HW divide, signed remainder only. </p>
814 <p >This function waits for the result to be ready by calling <a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>.</p>
815 <dl class="section return"><dt>Returns</dt><dd>Current remainder results. </dd></dl>
819 <a id="gac12f398a163e90ca4d52386bd7e161b9" name="gac12f398a163e90ca4d52386bd7e161b9"></a>
820 <h2 class="memtitle"><span class="permalink"><a href="#gac12f398a163e90ca4d52386bd7e161b9">◆ </a></span>hw_divider_save_state()</h2>
822 <div class="memitem">
823 <div class="memproto">
824 <table class="mlabels">
826 <td class="mlabels-left">
827 <table class="memname">
829 <td class="memname">static void hw_divider_save_state </td>
831 <td class="paramtype">hw_divider_state_t * </td>
832 <td class="paramname"><em>dest</em></td><td>)</td>
837 <td class="mlabels-right">
838 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
841 </div><div class="memdoc">
843 <p>Save the calling cores hardware divider state. </p>
844 <p >Copy the current core's hardware divider state into the provided structure. This method waits for the divider results to be stable, then copies them to memory. They can be restored via <a class="el" href="group__hardware__divider.html#gaa8efb2ea90ef78f863b1c518c5824002" title="Load a saved hardware divider state into the current core's hardware divider.">hw_divider_restore_state()</a></p>
845 <dl class="params"><dt>Parameters</dt><dd>
846 <table class="params">
847 <tr><td class="paramname">dest</td><td>the location to store the divider state </td></tr>
854 <a id="ga8f8f25f9f8feefb588fefed9992e180b" name="ga8f8f25f9f8feefb588fefed9992e180b"></a>
855 <h2 class="memtitle"><span class="permalink"><a href="#ga8f8f25f9f8feefb588fefed9992e180b">◆ </a></span>hw_divider_u32_quotient()</h2>
857 <div class="memitem">
858 <div class="memproto">
859 <table class="mlabels">
861 <td class="mlabels-left">
862 <table class="memname">
864 <td class="memname">static uint32_t hw_divider_u32_quotient </td>
866 <td class="paramtype">uint32_t </td>
867 <td class="paramname"><em>a</em>, </td>
870 <td class="paramkey"></td>
872 <td class="paramtype">uint32_t </td>
873 <td class="paramname"><em>b</em> </td>
882 <td class="mlabels-right">
883 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
886 </div><div class="memdoc">
888 <p>Do an unsigned HW divide, wait for result, return quotient. </p>
889 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return quotient.</p>
890 <dl class="params"><dt>Parameters</dt><dd>
891 <table class="params">
892 <tr><td class="paramname">a</td><td>The dividend </td></tr>
893 <tr><td class="paramname">b</td><td>The divisor </td></tr>
897 <dl class="section return"><dt>Returns</dt><dd>Quotient results of the divide </dd></dl>
901 <a id="gad18c35723af182a45e044b29cd1e60b2" name="gad18c35723af182a45e044b29cd1e60b2"></a>
902 <h2 class="memtitle"><span class="permalink"><a href="#gad18c35723af182a45e044b29cd1e60b2">◆ </a></span>hw_divider_u32_quotient_inlined()</h2>
904 <div class="memitem">
905 <div class="memproto">
906 <table class="mlabels">
908 <td class="mlabels-left">
909 <table class="memname">
911 <td class="memname">static uint32_t hw_divider_u32_quotient_inlined </td>
913 <td class="paramtype">uint32_t </td>
914 <td class="paramname"><em>a</em>, </td>
917 <td class="paramkey"></td>
919 <td class="paramtype">uint32_t </td>
920 <td class="paramname"><em>b</em> </td>
929 <td class="mlabels-right">
930 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
933 </div><div class="memdoc">
935 <p>Do a hardware unsigned HW divide, wait for result, return quotient. </p>
936 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return quotient.</p>
937 <dl class="params"><dt>Parameters</dt><dd>
938 <table class="params">
939 <tr><td class="paramname">a</td><td>The dividend </td></tr>
940 <tr><td class="paramname">b</td><td>The divisor </td></tr>
944 <dl class="section return"><dt>Returns</dt><dd>Quotient result of the divide </dd></dl>
948 <a id="ga56d6c26b06211b6f6ae3069b2c612562" name="ga56d6c26b06211b6f6ae3069b2c612562"></a>
949 <h2 class="memtitle"><span class="permalink"><a href="#ga56d6c26b06211b6f6ae3069b2c612562">◆ </a></span>hw_divider_u32_quotient_wait()</h2>
951 <div class="memitem">
952 <div class="memproto">
953 <table class="mlabels">
955 <td class="mlabels-left">
956 <table class="memname">
958 <td class="memname">static uint32_t hw_divider_u32_quotient_wait </td>
960 <td class="paramtype">void </td>
961 <td class="paramname"></td><td>)</td>
966 <td class="mlabels-right">
967 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
970 </div><div class="memdoc">
972 <p>Return result of last asynchronous HW divide, unsigned quotient only. </p>
973 <p >This function waits for the result to be ready by calling <a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>.</p>
974 <dl class="section return"><dt>Returns</dt><dd>Current unsigned quotient result. </dd></dl>
978 <a id="gaa9fec9c4204fb6f874f660b529190d96" name="gaa9fec9c4204fb6f874f660b529190d96"></a>
979 <h2 class="memtitle"><span class="permalink"><a href="#gaa9fec9c4204fb6f874f660b529190d96">◆ </a></span>hw_divider_u32_remainder()</h2>
981 <div class="memitem">
982 <div class="memproto">
983 <table class="mlabels">
985 <td class="mlabels-left">
986 <table class="memname">
988 <td class="memname">static uint32_t hw_divider_u32_remainder </td>
990 <td class="paramtype">uint32_t </td>
991 <td class="paramname"><em>a</em>, </td>
994 <td class="paramkey"></td>
996 <td class="paramtype">uint32_t </td>
997 <td class="paramname"><em>b</em> </td>
1006 <td class="mlabels-right">
1007 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1010 </div><div class="memdoc">
1012 <p>Do an unsigned HW divide, wait for result, return remainder. </p>
1013 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return remainder.</p>
1014 <dl class="params"><dt>Parameters</dt><dd>
1015 <table class="params">
1016 <tr><td class="paramname">a</td><td>The dividend </td></tr>
1017 <tr><td class="paramname">b</td><td>The divisor </td></tr>
1021 <dl class="section return"><dt>Returns</dt><dd>Remainder results of the divide </dd></dl>
1025 <a id="ga46f7b5751556b7b1d5600561160abb3c" name="ga46f7b5751556b7b1d5600561160abb3c"></a>
1026 <h2 class="memtitle"><span class="permalink"><a href="#ga46f7b5751556b7b1d5600561160abb3c">◆ </a></span>hw_divider_u32_remainder_inlined()</h2>
1028 <div class="memitem">
1029 <div class="memproto">
1030 <table class="mlabels">
1032 <td class="mlabels-left">
1033 <table class="memname">
1035 <td class="memname">static uint32_t hw_divider_u32_remainder_inlined </td>
1037 <td class="paramtype">uint32_t </td>
1038 <td class="paramname"><em>a</em>, </td>
1041 <td class="paramkey"></td>
1043 <td class="paramtype">uint32_t </td>
1044 <td class="paramname"><em>b</em> </td>
1053 <td class="mlabels-right">
1054 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1057 </div><div class="memdoc">
1059 <p>Do a hardware unsigned HW divide, wait for result, return remainder. </p>
1060 <p >Divide <code>a</code> by <code>b</code>, wait for calculation to complete, return remainder.</p>
1061 <dl class="params"><dt>Parameters</dt><dd>
1062 <table class="params">
1063 <tr><td class="paramname">a</td><td>The dividend </td></tr>
1064 <tr><td class="paramname">b</td><td>The divisor </td></tr>
1068 <dl class="section return"><dt>Returns</dt><dd>Remainder result of the divide </dd></dl>
1072 <a id="ga2e23739484aa748a5900d215d279acdf" name="ga2e23739484aa748a5900d215d279acdf"></a>
1073 <h2 class="memtitle"><span class="permalink"><a href="#ga2e23739484aa748a5900d215d279acdf">◆ </a></span>hw_divider_u32_remainder_wait()</h2>
1075 <div class="memitem">
1076 <div class="memproto">
1077 <table class="mlabels">
1079 <td class="mlabels-left">
1080 <table class="memname">
1082 <td class="memname">static uint32_t hw_divider_u32_remainder_wait </td>
1084 <td class="paramtype">void </td>
1085 <td class="paramname"></td><td>)</td>
1090 <td class="mlabels-right">
1091 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1094 </div><div class="memdoc">
1096 <p>Return result of last asynchronous HW divide, unsigned remainder only. </p>
1097 <p >This function waits for the result to be ready by calling <a class="el" href="group__hardware__divider.html#ga82cfc7c264f332ad15135158a37821dc" title="Wait for a divide to complete.">hw_divider_wait_ready()</a>.</p>
1098 <dl class="section return"><dt>Returns</dt><dd>Current unsigned remainder result. </dd></dl>
1102 <a id="ga82cfc7c264f332ad15135158a37821dc" name="ga82cfc7c264f332ad15135158a37821dc"></a>
1103 <h2 class="memtitle"><span class="permalink"><a href="#ga82cfc7c264f332ad15135158a37821dc">◆ </a></span>hw_divider_wait_ready()</h2>
1105 <div class="memitem">
1106 <div class="memproto">
1107 <table class="mlabels">
1109 <td class="mlabels-left">
1110 <table class="memname">
1112 <td class="memname">static void hw_divider_wait_ready </td>
1114 <td class="paramtype">void </td>
1115 <td class="paramname"></td><td>)</td>
1120 <td class="mlabels-right">
1121 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1124 </div><div class="memdoc">
1126 <p>Wait for a divide to complete. </p>
1127 <p >Wait for a divide to complete </p>
1131 <a id="ga62820b8678505f5ea007cedd012da0aa" name="ga62820b8678505f5ea007cedd012da0aa"></a>
1132 <h2 class="memtitle"><span class="permalink"><a href="#ga62820b8678505f5ea007cedd012da0aa">◆ </a></span>to_quotient_s32()</h2>
1134 <div class="memitem">
1135 <div class="memproto">
1136 <table class="mlabels">
1138 <td class="mlabels-left">
1139 <table class="memname">
1141 <td class="memname">static int32_t to_quotient_s32 </td>
1143 <td class="paramtype">divmod_result_t </td>
1144 <td class="paramname"><em>r</em></td><td>)</td>
1149 <td class="mlabels-right">
1150 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1153 </div><div class="memdoc">
1155 <p>Efficient extraction of signed quotient from 32p32 fixed point. </p>
1156 <dl class="params"><dt>Parameters</dt><dd>
1157 <table class="params">
1158 <tr><td class="paramname">r</td><td>A pair of 32-bit quotient/remainder values. </td></tr>
1162 <dl class="section return"><dt>Returns</dt><dd>Unsigned quotient </dd></dl>
1166 <a id="ga21752b8ee127370df37cd9a9e4e4050e" name="ga21752b8ee127370df37cd9a9e4e4050e"></a>
1167 <h2 class="memtitle"><span class="permalink"><a href="#ga21752b8ee127370df37cd9a9e4e4050e">◆ </a></span>to_quotient_u32()</h2>
1169 <div class="memitem">
1170 <div class="memproto">
1171 <table class="mlabels">
1173 <td class="mlabels-left">
1174 <table class="memname">
1176 <td class="memname">static uint32_t to_quotient_u32 </td>
1178 <td class="paramtype">divmod_result_t </td>
1179 <td class="paramname"><em>r</em></td><td>)</td>
1184 <td class="mlabels-right">
1185 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1188 </div><div class="memdoc">
1190 <p>Efficient extraction of unsigned quotient from 32p32 fixed point. </p>
1191 <dl class="params"><dt>Parameters</dt><dd>
1192 <table class="params">
1193 <tr><td class="paramname">r</td><td>A pair of 32-bit quotient/remainder values. </td></tr>
1197 <dl class="section return"><dt>Returns</dt><dd>Unsigned quotient </dd></dl>
1201 <a id="ga7ca08fd8fd1961ee25233d4587067178" name="ga7ca08fd8fd1961ee25233d4587067178"></a>
1202 <h2 class="memtitle"><span class="permalink"><a href="#ga7ca08fd8fd1961ee25233d4587067178">◆ </a></span>to_remainder_s32()</h2>
1204 <div class="memitem">
1205 <div class="memproto">
1206 <table class="mlabels">
1208 <td class="mlabels-left">
1209 <table class="memname">
1211 <td class="memname">static int32_t to_remainder_s32 </td>
1213 <td class="paramtype">divmod_result_t </td>
1214 <td class="paramname"><em>r</em></td><td>)</td>
1219 <td class="mlabels-right">
1220 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1223 </div><div class="memdoc">
1225 <p>Efficient extraction of signed remainder from 32p32 fixed point. </p>
1226 <dl class="params"><dt>Parameters</dt><dd>
1227 <table class="params">
1228 <tr><td class="paramname">r</td><td>A pair of 32-bit quotient/remainder values. </td></tr>
1232 <dl class="section return"><dt>Returns</dt><dd>Signed remainder</dd></dl>
1233 <dl class="section note"><dt>Note</dt><dd>On arm this is just a 32 bit register move or a nop </dd></dl>
1237 <a id="gaea3762e4a27f1e42f8e03e6607917462" name="gaea3762e4a27f1e42f8e03e6607917462"></a>
1238 <h2 class="memtitle"><span class="permalink"><a href="#gaea3762e4a27f1e42f8e03e6607917462">◆ </a></span>to_remainder_u32()</h2>
1240 <div class="memitem">
1241 <div class="memproto">
1242 <table class="mlabels">
1244 <td class="mlabels-left">
1245 <table class="memname">
1247 <td class="memname">static uint32_t to_remainder_u32 </td>
1249 <td class="paramtype">divmod_result_t </td>
1250 <td class="paramname"><em>r</em></td><td>)</td>
1255 <td class="mlabels-right">
1256 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
1259 </div><div class="memdoc">
1261 <p>Efficient extraction of unsigned remainder from 32p32 fixed point. </p>
1262 <dl class="params"><dt>Parameters</dt><dd>
1263 <table class="params">
1264 <tr><td class="paramname">r</td><td>A pair of 32-bit quotient/remainder values. </td></tr>
1268 <dl class="section return"><dt>Returns</dt><dd>Unsigned remainder</dd></dl>
1269 <dl class="section note"><dt>Note</dt><dd>On Arm this is just a 32 bit register move or a nop </dd></dl>
1273 </div><!-- contents -->
1274 </div><!-- doc-content -->
1276 <script src="main.js"></script>