<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58167>58167</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AMDGPU][GFX8+] Incorrect src1 handling for v_cmpx_class_f16, v_cmp_class_f16, v_ldexp_f16
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dpreobra
</td>
</tr>
</table>
<pre>
GFX8+ hardware incorrectly handles floating-point inline constants when they are used with 16-bit integer operands. We have a patch to workaround the issue: https://reviews.llvm.org/D81841.
However, opcodes `v_cmpx_class_f16`, `v_cmp_class_f16` and `v_ldexp_f16` are an exception. These opcodes have 16-bit integer `src1` operand but hardware treats this operand as if it has f16 type.
Currently, `src1` is handled incorrectly by the compiler. The operand either has a wrong type or it is affected by the patch (though it should not).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxlUsGOmzAQ_Rq4jILAEAIHDrsb7baHSj20am8rYw_g1rGRbcLm7zsQNqtsJQTj8fDmvXnTWnlpXp5_VxF7hIE7OXOHoIywzqEI-kJJIzV66LTlQZl-N1plApVoZRCENT5wEzzMAxoIA15gQZg8SphVGCArd61a6gP26MCO6AjRJ_ALCfuMwGHkQQwQLMzW_eXOTkYuSKC8nzDKH2AIYfQUROyZHodnhbNPtD6fEut6Sh2rrCqyJEqPUfpwfX-xM57RReyJegorSUJUpudXcRrfXoXm3r92WUmppeL95u4CiOf1Rkt8G29ZkscN4JvAMShrEvgxoMdbl1XUJ9X0n3ciW37fBgDtFD4GHhxymmEYlL8VcA-qA7VU0fSzEsJlxDuJTxOZZMikTcJ7C-U31-Sdk-1lnaqwp1FpdCvvWzckr4jo0ovD7Kzp135g3UKBEHnXEQxBbjBX0yJWhcFO_bBUeYq0BGNDxOqNaYxNVpZFfagrVsayyWWd1zwOKmhsov3jw7fjy_ef0f5I8baHdICv77xhEXWVQ8sHHfH5z0NS_9m9NXWzLZ6cbu6XqCe9U5vQMOiwbNL22Y3O_qG-dFzXz1Owr7LyEA9NzhnjXcH2ncyqSuaHvM15zQ95hoe6kFmseYvaL7IixgzO2wYzRpJi1bCUsSxN91nB8qJM0rQUQvC0O5RS1lhFRYonrvRtsWPXrJTaqfd0qZUPH1sfk1TVG1ynuODziZxwjRwd2tbxeO3drNz_AaC0Sd4">