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

    <tr>
        <th>Summary</th>
        <td>
            Can't pass or return `half` or `fp128` on `arm64ec`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Trying to compile the following IR for `arm64ec-pc-windows-msvc` ([compiler explorer](https://godbolt.org/z/sqrn8Mnxo))

```llvm
define half @half(half) {
    ret half %0
}

define fp128 @fp128(fp128) {
 ret fp128 %0
}
```

will fail with the following error:

```
LLVM ERROR: Only 32 and 64 bit floating points are supported for ARM64EC thunks
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o /app/output.s -mtriple=arm64ec-pc-windows-msvc <source>
1.      Running pass 'AArch64Arm64ECCallLowering' on module '<source>'.
 #0 0x00000000036ffd18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x36ffd18)
 #1 0x00000000036fd68c SignalHandler(int) Signals.cpp:0:0
 #2 0x0000760bd1842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000760bd18969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000760bd1842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x0000760bd18287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000000000072f886 llvm::UniqueStringSaver::save(llvm::StringRef) (.cold) StringSaver.cpp:0:0
 #7 0x000000000364f7d8 (/opt/compiler-explorer/clang-trunk/bin/llc+0x364f7d8)
 #8 0x0000000000a7732c (anonymous namespace)::AArch64Arm64ECCallLowering::canonicalizeThunkType(llvm::Type*, llvm::Align, bool, unsigned long, llvm::raw_ostream&, llvm::Type*&, llvm::Type*&) (.constprop.0) AArch64Arm64ECCallLowering.cpp:0:0
 #9 0x0000000000a7887f (anonymous namespace)::AArch64Arm64ECCallLowering::getThunkType(llvm::FunctionType*, llvm::AttributeList, llvm::COFF::Arm64ECThunkType, llvm::raw_ostream&, llvm::FunctionType*&, llvm::FunctionType*&) AArch64Arm64ECCallLowering.cpp:0:0
#10 0x0000000000a7fd73 (anonymous namespace)::AArch64Arm64ECCallLowering::buildEntryThunk(llvm::Function*) AArch64Arm64ECCallLowering.cpp:0:0
#11 0x0000000000a83dea (anonymous namespace)::AArch64Arm64ECCallLowering::runOnModule(llvm::Module&) (.part.0) AArch64Arm64ECCallLowering.cpp:0:0
#12 0x0000000002d44ac0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2d44ac0)
#13 0x00000000008483f4 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#14 0x0000000000741b86 main (/opt/compiler-explorer/clang-trunk/bin/llc+0x741b86)
#15 0x0000760bd1829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#16 0x0000760bd1829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#17 0x000000000084002e _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x84002e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykV11z2rAS_TXiRQMjZOGPBx4Iwb2dSSadJLevGVmWjW5kyZXkEPrr70g2BFPaKU2HxqCPs2fPrqxdaq2oFedLsLgBi9sJ7dxWm2XBuTOc20mhy_3y2eyFqqHTkOmmFZJDt-Ww0lLqnZ_4-ggrbSCIETVNTDibtmy6E6rUOztt7BsDMYIAp2BxMwAYyN9bqQ03YHELcLp1rrUgWgGcA5zXuiy0dDNtaoDznw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