<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95216>95216</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Converting float16 -> float32 in computations seem to behave inconsistently
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DenisYaroshevskiy
</td>
</tr>
</table>
<pre>
Hi!
In the following example tst1 and tst2 produce different assembly, specifically tst2 does `__truncsfhf2` on every add.
```
_Float16 tst1(_Float16 a, _Float16 b, _Float16 c) {
return a + b + c;
}
_Float16 tst2(_Float16 a, _Float16 b, _Float16 c) {
_Float16 res = 0;
res *= a;
res *= b;
res *= c;
return res;
}
```
https://godbolt.org/z/WKh8v1EaE
Is this an expected/desired behaviour? If so - what is the rule governing _Float16 emulation.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU9FuozoQ_ZrhZZQI7EDCAw9tU3Sr-wFX96ky9hC8a-zIY2izX78iyaZN1aeV0MCZMXPmHAbFbA-eqIHyEcp9pqY0hNjsyVv-X8XAA838056yLphT848FUUC-h_zhEl88poGwD86FN-sPSO9qPDrCxKlA5c3yIPAYg5k0obF9T5F8QsVMY-dOIJ6Qj6Rtb7Vy7nQ5bwIxQpW_vqY4ec390AuocgweaaZ4QmXM-vMc11jl1-sMX1sXVCqq8zAgdjesFtYb6u6QBlEjbB8vLRAjpSl6VAjiEbtz1CCvZdjuP_N_JhR_SXjLx8UCucf8g-02EiOIh6WobsW7dPd9Wn9tdRUXib-RdG_mJQ4pHRnkA4gWRHsIpgsurUM8gGh_gWj_-3fYzcWzer5bEsY0WEblkd6PpBMZEK0htpEMdjSo2YYpgmzxpUcOuMK3QSW0fF6uODnCQ5gp-mXDbgbRODmVbPDrzDTS1LJWGTXFttgVu7IsZDY0G60rolwrVdddJXuS1dYoqUSdV6R2ZWYbkYtNXhUirzdlIdfU7YQxm7JTVGm5U7DJaVTWrZ2bx0VoZpknaupSFFXmVEeO__w7sVkOrbrpwLDJneXEH68lmxw1T8HPFNOio7_KWIF8vgAp0HrUYTxO6SyMkYlGTOFiEqH1Oni2nMgnd8qm6JovX8SmYerWOowg2oX7elsdY_hBOoFoz_MziPYiYW7E7wAAAP__tKI2KA">