<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/151138>151138</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
How to generate 0xFFFFFFFF NAN value using __builtin_nanf
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
quic-k
</td>
</tr>
</table>
<pre>
I tried using __builtin_nanf("0xFFFFFFFF"), but got 0x7FFFFFFF instead
why is the sign bit never set?
Is this the intended behaviour?
https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/ByteCode/InterpBuiltin.cpp#L363
I know the the sign bit is not really relevant for NAN, but if we provide the exact bits, __builtin, should not ignore the sign value
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkk9v2zAMxT8NfSEa2HScxAcd0hbGAgy9bPdCsmhbqypl-uMk335wkq4bsMt8MSQ-PJI_PRmjGR2zgOYRmudC5jT5IH5m0z-8FcrrizhgCoY15mjciK-vKhubjHt10g1AOyAqz939AyKgFugJVU44-oTleXuvoXExsdRQ7k_TBU3ENDEu7VGZhI5nDhg5Qd1BuT8s5bvGuMROs0bFk5yNz-GmgXI_pXSMUO-BOqBuNGnKatX7d6DO2vnj93AM_gf3CahT1iug7l0aB9T1VrpxEZnlcv_tO1D3eEn85DUDdQeXOBwfbwuv-uMRqP5ab-pb7wO-OX-6TvjXJiai8wkDS2svGNjyLF3CwQd82b98wDEDnhiPwc9G3wz4LPu0OMRF8xv0coiTz1Zfbc3ofPij4yxt5kKLWrd1KwsW1bapty1R1RaT2OyaUqmh182ml1rqdt1veq3leicHljQURlBJTbmltqK6rNrVQEM5tJLUuml2220P65LfpbGrBeTKh7EwMWYWVVNV9a6wUrGN1_gQOT7htbrkoHkugrjSV3mMsC6tiSl-2iSTLIsvC0GPIzsOMjF-ZmmBddvun9ErcrDiv5__Ol0E6u7jz4J-BQAA__8_lvy0">