<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/128230>128230</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] `clamp` overloads with mixed scalar vector operands
</td>
</tr>
<tr>
<th>Labels</th>
<td>
HLSL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
llvm-beanz
</td>
</tr>
</table>
<pre>
Presently Clang fails to resolve `clamp` overloads if the range values are scalars. We should support overloads where either or both values can be scalars:
```hlsl
export int4 call(int4 I, int Min, int Max) {
return clamp(I, Min, Max); // calls clamp(int4, int4, int4)
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0kk-L4zwMxj-NcxFTHKX5d8hhOqW8L8zCwh72LCdq7MWNg-1kOvvpl7idbi8LAokgPXqUnykEM07MnSgPojxmtETtfGftenlRTNPvTLnhs_vuOfAU7Se8WZpGOJOxAaIDz8HZlUFUsrd0mUUlwa3sraMhgDlD1AyeppFhJbtwAPIMoSdLPuzgJ0PQbrEDhGWenY9Pwx-aPQObqNmD86Bc1F8iPU2gHjqieBUyRSVvoW2wQr7yNWmaKe6hJ2sFNqn-X-Db9hW-melR0lVgC6I-CPkKAOA5Ln6C21nYpJl7_61XFAcQeBJ4SuLh0brtuMs-5XYzWB-fbWZDVwxt0VLGXV7vZV7nZV5lukNsqK7KqmzzQjGfCyVryVzmbaPqHjkzHUosJWKOsmyKaleotlWc94pqRVKWYi_5QsbuNpQ758fMhLBwl2ODhcwsKbYhUUf87_3Hu0Dc-H-hX8Yg9tKaEMNfhWiiTS8lDZTHf1D_MFHDxVx5uAOClfvoPLiZPU1DyBZvOx3jnMilPziaqBe1691F4GlbeE8vs3e_uI8CT8l_EHi6n7B2-CcAAP__YR7dSA">