<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/149080>149080</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-cuda] clang segfaults when trying to convert a float to a 128 bit integer on device
</td>
</tr>
<tr>
<th>Labels</th>
<td>
cuda
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
miscco
</td>
</tr>
</table>
<pre>
consider the following minimal [reproducer](https://godbolt.org/z/7xbMofax1):
```cpp
__global__ void kernel() {
float meow = 1.0f;
#if 1
[[maybe_unused]] auto val = static_cast<__int128_t>(meow);
#else
[[maybe_unused]] auto val = static_cast<__int128_t>(static_cast<int>(meow));
#endif
}
int main() {
float meow = 1.0f;
auto val = __int128_t(meow);
kernel<<<1, 1>>>();
return 0;
}
```
This will fail with
```
fatal error: error in backend: unsupported library call operation
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
```
It would be awesome if the library call could be implemented for the 128 bit integers and all builtin types
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslEGP6jYQxz-NuYx25TgkJIccYClSD731jhx7AtPn2JE9gaWfvnLC6r2l6q3SSFjx3zO__xiPTokuHrET1UFUx42e-RpiN1IyJmz6YB-dCT6RxQh8RRiCc-FO_gIjeRq1A1EdIk4x2NlgFNVRqObKPCVR7oU6CXW6BNsHx-8hXoQ6_S3UaffZ_xEG_VkI1WaZXKKWa5hpEnJ_Pl9c6LU7n-EWyMIPjB6dUI1QLYjdQcg9AMDggmYYMdxBlEco3uUgyrwpVEkDFPDULfYOo370eJ79nNBm1OoIeuYAt-yjPEJizWTORicW5cf5TJ4L1ZxZlL8J1eQqC_EzP7qE_2P677vkX6r-WthbGvJyd1x7R55h1OS_t-c_e5OJv4H9gvJiM0ufrS8_1iiE-oAiw62x1Pypjshz9CCftCvi192uuH9eKcGdnINBk4M78fVFNGjWDjDGEEW5XxdAHnptfqC3-dvs0zxNITJacNRHHR9gtHMQJoyaKXgh98ZpfxHqkOMrT14s32GIwTN6CyaMo_Z2wUG7AAF-EoMJFmEnQahmTghvN-AACRHI34JZq6j23w5_Z7iH2VnoEfQdUxgRaFhe0DdW8yWicXI4os9uhrC-tUI10BMDecYLxgQZMZ_qZ3JMHvgxYRJyv7Fdaduy1Rvsil2l6rpuZb25dqXe2r6u261uto1stNFK6qZpd31jJG7bDXVKqkruirooqkrW703d17u-t5Wt6npXodhKHDW5d-duY37CG0ppxq7YtrKRG6d7dGkZHkqZ2WqhVB4jscv6t36-JLGVjhKnnxmY2C0DZ7mFt-VYdXzeScLLoGfHCe5X9MDxkYcNBzDB3zAy6Of_mgPo1xZB8GDxRgY3c3Tdyxwivs79uwmjUKcM8_x5m2L4Cw0LdVq8JaFOT3u3Tv0TAAD__4ltlWM">