<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64527>64527</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm][gcc] why gcc and clang has the different behavior in function '__truncdfhf2'.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hippyll123
</td>
</tr>
</table>
<pre>
llvm11.0 and gcc11.0 has the same function __truncdfhf2,but its behavior is different.
llvm11.0 is in lib libclang_rt.builtins-x86_64.a.
gcc11.0 is in lib libgcc_s.so.
when i use clang and gcc compile the following code,the result is different.
```
#define half _Float16
int main() {
half *f16_b = (half *)malloc(sizeof(half));
int i = 5;
f16_b[0] = 121.1 + i;
printf("f16_b[0] = %f\n", (float)(f16_b[0]));
free(f16_b);
return 0;
}
```
output of gcc is 0.000059
output of clang is 126.125000
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U9tyrCoQ_Zr2pSsWtOLogw-ZTM1vTCGCcoqBKcHMyfn6UzKXJDvZFt560Yu-LRmjnbzWPYg9iEMh1zSHpZ_t5fLhHKeqGML40Tv3fua8ZCj9iJNS-XuWEdOsMcqzRrN6lWzweDqlZfVqNLMhoLdhTWhTxEHP8t2GBW3E0RqjF-1TCewA7PXJbiNaj84O262c9NNpSeWwWpesjy__ts2pqUt5d3vE8c1rUuoUyxjue66z9mhxjRoz3yMBVOF8sU7nBExwLlytn1CFUQO9bcZFx9Wl38KFht3X7ZeqURvrNc7SGTwdXZCJN3cwP61PeJbWA7VAHcJuf7PfPIBeDW9OA0J1QKD2YQTqztK5oIDaaP_TwdxBoG5b1YPlfm2n2EwiPrHMDGLPQBwyxomXHIH2aH8wXBbrk8lR0g9HIGFAvHmgra9boGbLNAfTft39l_DMovVz5y_4otO6eGRPAHaHXwse1nRZEwaTG2kjspIxxkT3J3zruI3IqSk5CcbY165gMfbV2FWdLHTPm47XXdXtqJh7pXnN24EJIyrVjqprulpXw9h0Yz2IbihsT4wq1rKWc2pYW7asZlRLbQY2NiRHqJk-S-vKbbbLsEyFjXHVfVML2hVODtrFrDkir6-Ywa2w4lAsWW0vwzpFqJmzMcVPlmSTy2LdLFutxX5SamvRdf7I9dgG_Jb4Q5_P-f0iQv8pWKDdd83uymJdXD-ndIlQvQIdgY6TTfM6lCqcgY758Nvr5bKEf7RKQMecRAQ65iT_DwAA__9CXkc6">