<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90287>90287</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[PPC] DoubleAPFloat frexp ignores possibility that second double affects exponent
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:PowerPC
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hubert-reinterpretcast
</td>
</tr>
</table>
<pre>
In a subset of the values where `ilogb` is wrong as reported in llvm/llvm-project#89841 (but not because of the `ilogb` bug), `frexp` is also wrong:
https://github.com/llvm/llvm-project/blob/0c0c5c475857e9cd6a2fe82fd1e46abdb174a1c1/llvm/lib/Support/APFloat.cpp#L5139-L5143
For a value like `1.L - DBL_EPSILON/4.`, the correct return value is the same as the input value (as it is in the appropriate range); however, the code would return a value equal to one-half of the input value (because `1.` is not in the appropriate range).
Note: The current code is potentially more correct for `2.L - DBL_TRUE_MIN` because the purely mathematical result, when rounded, generates a result that is not in the appropriate range.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM-O4zYPfxrlQsSwZTuxDz5kJmtggHzzBd3teSFZtK2uIrkSNdl5-0JO0hm0QIteEssU-ftD0iIEPVnEjtVPrD5uRKTZ-W6OEj1tPWpL6BePNIhAG-nUe_diQUCIMiCBG4FmhDdhIga4zugR2C7Xxk2S7XLQAa7e2QlEAI-L84QKtAVj3i6M9-lvu3j3Gw7EeNm0TVUA442MBNYRSBxEDPiA-VxZxonxlvHn9Hb0-HO54wkT3A2UlQeWH1l-mImWkE68Z7yfNM1RZoN7MPgbkV4aJxnv8yEf6qHa1029x3ZQO8FHbPioCqx2QipZ7CtRDMWnOjrlfY1Lksp4fzj3xgnKhmVhvDzVRdluT3VRlTdit9_eeRA3D8HoH6vOIjvBFo5Pp-9fzl9fTv9_ZbyvMrbLk-LkxeC8x4HAI0Vv79k6rLEgLpgcT8_aLpHuYcYbEUBTuqftGhbL4t3itSAEL-yEydTyCWZ3xTf0H2gK4eqiUQ_AB2H8PQoD5MBZ3M7CjI9m_QX40cpV271VqcX_wCP7bNKrI2TlAb4lNtF7tHRjpQMsjtCSFsa8w8X5D3NG5xMg_9PMb7_8-uX7_15e1wm6M0rwS_SYkgXNeBGkB2HAY4iGkgPXGS14F61Clc4TWvSCMIC43wKaBf2bpGyjulK1ZSs22BX7oir2eVtUm7kbd6oQdVtgMVSKS-Q7UTbjWCmJLR9EtdEdz3mVV3zHeVkXVVa2UgrVoMS2bpqcsyrHi9AmS4OYOT9tdAgRuzbnzX5jhEQT1h3nXIrhB1rFysPZXdGfnxnnafV9t26BjFNgVW50oPBRjTSZ9SNxPj-z-ghHF6XB-3jDun-gJ-s8pnaEoKU2mt5vvgQcnFWg1hwQ44gDBcCfi7NoaRO96f7ziq7yAuP9qvCPAAAA__9vqJJP">