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

    <tr>
        <th>Summary</th>
        <td>
            [MIPS] Cannot select llvm.{min,max}imum.{f32,f64}
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </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 MIPS:

- llvm.minimum.f32
- llvm.minimum.f64
- llvm.maximum.f32
- llvm.maximum.f64

Error output [\[godbolt\]](https://godbolt.org/z/91fdhPx9Y):
```
LLVM ERROR: Cannot select: 0x8787710: f32 = fmaximum 0x87875c0, 0x87876a0
  0x87875c0: f32,ch = CopyFromReg 0x86f0750, Register:f32 %0
    0x8787550: f32 = Register %0
  0x87876a0: f32,ch = CopyFromReg 0x86f0750, Register:f32 %1
    0x8787630: f32 = Register %1
In function: _ZN1a4test17hb60f9f6975710eeaE
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 'MIPS 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 0x00007fc3f21b8420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x00007fc3f1c7b00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #4 0x00007fc3f1c5a859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x000000000069cfa2 llvm::RISCVISAInfo::updateImplication() (.cold) RISCVISAInfo.cpp:0:0
 #6 0x0000000002e4f044 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e4f044)
 #7 0x0000000002e546d5 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e546d5)
 #8 0x0000000002e4c6a7 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e4c6a7)
 #9 0x0000000002e58f65 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e58f65)
#10 0x0000000002e5b9b9 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e5b9b9)
#11 0x0000000002e5e086 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#12 0x00000000013a2bcb llvm::MipsDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x13a2bcb)
#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 0x00007fc3f1c5c083 __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/eJy0mFFvqzgWxz-N82IlMjZgeMhDmjTdSLczVTM70uxLZIwh3oKNbLM33U-_MpAUMpltt-1e5abhYP_Pz-ccbGNmrSyVEEsQ3YFoM2OtO2qz_LspWTvLdP663DlohagtdEfmoNJKQF1AdxRWQKmckcpKbiEzAvLWGKFc9Qp_avMiVQm1go-7pz0gK4A2AA3fc1hV_6oXtVSybutFQfBtexxO7ex0u_3Zfm7ff98bow3UrWtaB7vhrUF0V-o805XrLjb-g5Ojc431iHgL8HZosNCmBHj7b4C3aVDkx6dT-gfA6dtIYjR8ussfP35_hPfPz78-A7KCa6aU9nGrBHfegE4JTSgNkL8oCIaAbGAxgA93I44AXg8XMRuE4ehu3xfgNT92AmvdvG6Nrp9F6VvFBaJRp_EsSmmdMICsOmc4uqhd9KIJy7nHpO0byhc8B9eeY_KXnoe2OwWLVnEntfItD__4JWChE9YF9JjFqEiLOKURDZAQ7L7v8vTjfrW_h7bNaukgg1lbQiMabRx0Gl5lWLpjmy24rgHe-goa_swbo__pE4a30tpWWIC3kKkcSsWrNhe-6CE3zB5hxviLM4yLRe9-7xh_gXlbN5cCQQuA0iejS8NqyEzZ1kI5DwEB3urGe-G6bmQlzFycmkobYbytYqqcO9OqF4C3mVQdHIdz7fuxpvG9u5peWDg_JfGc2XpuX5VjJ0A2UjlRQUDWVreGC0CG-ASe5rlVyj-VDbMWAky3Q5Dhkzc8MsVKz0D9Y1vrvK2EbzURw3QYMb4l6J91uFk9zAG536we4BNzThgFd8o60_a-9t1D4VPbOzpnunMVoneSjelQTgATBNEJnf8RFMeYJt2M4HNAVvbV9j-ejFSuy9BvPmUAJ2-NDPt50NYZwWqAY1_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