<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/121122>121122</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [amdgpu] Using fp128 fails with unsupported libcalls
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:AMDGPU
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Flakebi
      </td>
    </tr>
</table>

<pre>
    `fp128` seems to work fine in arguments and return values, but trying to do computations like `fmul` or `fdiv` fails:
```llvm
target triple = "amdgcn-amd-amdhsa"

define fp128 @fp128(fp128 %a, fp128 %b) {
  %res = fmul fp128 %a, %b
  ret fp128 %res
}
```
results in
```
LLVM ERROR: unsupported libcall legalization
Stack dump:

#10 llvm::SITargetLowering::LowerCall(llvm::TargetLowering::CallLoweringInfo&, llvm::SmallVectorImpl<llvm::SDValue>&) const llvm-project/llvm/lib/Target/AMDGPU/SIISelLowering.cpp:3877:34
```

I assume this is expected.
I encountered this while trying to compile Rust code, see also https://github.com/rust-lang/compiler-builtins/pull/737.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8VN1u2zgTfZrxzSAGNbQl-0IXahx9MJDiWyTb3FPSWOaaEgX-JNt9-gVpp0mLYgEb0vxx5hydofJejzNzDdsvsD2sVAxn6-rWqAt3etXZ4XsNpTgtBe2gFOiZJ4_B4pt1FzzpmVHPqNwYJ56DRzUP6DhEN-OrMpE90D12MWBw3_U8psrBYm-nJQYVtJ09Gn1hTD2maFIL67I16NdknZQ2HmQDooFSXH_GvE4gmqDcyOlkvRhGkAcEIjUNYz_fqWlI_7NXQJRqRTNwHjdDQdjcMNHu5qCtSrP-sDqgPUL1BUSDyXbsc480Jv5ck7NTmuPwEXLsU-Pq8Hl0EI1jH03wqOdfAo-PL1_x4enp_08gG4yzj8tiXeABje56ZQwaHpXR_2TiQDTPQfUXHOK03Ah6INgJaMr0TrIQmJmSDcjm-fhnpuvRvrHT83j1ZuteGQO0-8j9XWZKevcc55MFKhP0Tw0mZcwL98G647QYkPefYoeXJAaQD7lsj72dfcjFd4uzf3EfgNqcT63RHVB7nQGobb4e_vfHN6D2-Xh85h8zrPsloZa7qkqPzS9cgmiOqLyPE2M4a4_aI_-9cB94WOcgz72Nc2DHwzXj7awNf9JpEmnyPEUfsLcDJ7yeGZXxFs8hLFmX1AK1ow7n2K17mwC46MOdUfMI1N4OcXdd1Cbo2QO1S0x8t5Ws1quhlsNe7tWK66KS26La7arN6lwXZS-7ohq2Jykkseg21O26fVlUUpIqypWuSdCmICoFiWq7WZfdlk79sKkkFX3ZC9gInpQ260Tr2rpxpb2PXBdUFEQrozo2Pq89Uaf6C88DyOadbUqXgavzF-ri6GEjjPbBf5wWdDD52kgbt0TYHvCbT9RdFyDvLb7pcP6dkv0qOlP_B4fvWvhZIRlBovAG4rWmfwMAAP__E-F6WA">