<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64208>64208</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[LoongArch] Do not know how to soften llvm.{min,max}imum.{f32,f64} result
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Urgau
</td>
</tr>
</table>
<pre>
It seems that none of these intrinsics are currently working on LoongArch:
- llvm.minimum.f32
- llvm.minimum.f64
- llvm.maximum.f32
- llvm.maximum.f64
Error output [\[godbolt\]](https://godbolt.org/z/3qvMvrohf):
```
LLVM ERROR: Do not know how to soften the result of this operator!
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 -x86-asm-syntax=intel <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'LoongArch DAG->DAG Pattern Instruction Selection' on function '@_ZN1a4test17hb60f9f6975710eeaE'
#0 0x0000000003066278 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3066278)
#1 0x0000000003063e3c SignalHandler(int) Signals.cpp:0:0
#2 0x00007fb6c3580420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007fb6c304300b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007fb6c3022859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x000000000069cfa2 llvm::RISCVISAInfo::updateImplication() (.cold) RISCVISAInfo.cpp:0:0
#6 0x0000000002fc1688 (/opt/compiler-explorer/clang-trunk/bin/llc+0x2fc1688)
#7 0x0000000002f3df91 llvm::DAGTypeLegalizer::SoftenFloatResult(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2f3df91)
#8 0x0000000002ed7612 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2ed7612)
#9 0x0000000002ed7c69 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2ed7c69)
#10 0x0000000002e58dd1 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e58dd1)
#11 0x0000000002e5b9b9 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e5b9b9)
#12 0x0000000002e5e086 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#13 0x0000000002443820 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x00000000029263f2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x29263f2)
#15 0x0000000002926571 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2926571)
#16 0x00000000029280e0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x29280e0)
#17 0x0000000000766170 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#18 0x00000000006a7ce2 main (/opt/compiler-explorer/clang-trunk/bin/llc+0x6a7ce2)
#19 0x00007fb6c3024083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#20 0x000000000075e0be _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x75e0be)
```
Similar to https://github.com/llvm/llvm-project/issues/53353 which was for x86_64
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0l99z2yASx_8a_MLYg9DvBz84dpzLTNJm4l4f7sWDEJa4INABapz-9TcgObZct80luY7ryCvx3c-yK2CJMbySjM1BfAXi1Y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