<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/140252>140252</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
__builtin_round() uses dynamic rounding mode on x86 (only)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
enh-google
</td>
</tr>
</table>
<pre>
my assumption was that `__builtin_round()` was meant to be like the `round()` libc function, and for arm and riscv, that's how it behaves: Android's libc can use `__builtin_round()` to implement `round()`.
for x86/x86-64 though, `__builtin_round()` seems to use the _dynamic_ rounding mode rather than hard-coding "away from zero" as specified by round().
seems like a bug?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8ksuu2zgMhp9G3hAJbPqahReZGfg1Al1oS1NdAklOTvr0hdwALU6Ls7IBkv__8Rd5SmbzRDPr_2H9fxXfsw5xJq9PWwibpUoE9ZrdC3hKu7tnEzw8eYKseQY21Leb2I3Nxt9i2L1iODG8sKE-mhxxnyEHEATWfCPImsrQp1ZrhIR197KoM_wXuFewhgg8uuM_miQfpVBcGY4JdHiCySBI8wcl1l7h6lUMRh3VQ1ByD3uiLyFzAOPulhz5_CfYmdVXVl8Lycc0MFw-puE0dJB12DddeL7STkQuFYcCURa_qZfnzsgbHJ3Gb-CCIog8a4plNw-aR3WS4SgyRP7kL1hjcPCdYmCIwBOkO0mzGlIgXvCb6Rv3p-8RNwexb6xdKjW36tJeeEVzM3ZjV7d931V67oa2vaDsxlWRpI4Pah36SfRCdFMz9k1lZqyxr_tmaNoe2-7crHIa-57EOAzTWkvW1eS4sWdrH-4c4laZlHaam67GHivLBdl0XBeipyccVYZYji3OZegk9i2xrrYm5fRLJptsaf5ruiXRBO80P4UZfHkrYDgFb18ML9Ue7axzvpcrYbgwXDaT9S7OMjiGSzF8f073GP4nmRkuB2ZiuLz3eMz4IwAA__8_BAWE">