xref: /llvm-project/llvm/test/CodeGen/LoongArch/ir-instruction/select-bare-flt.ll (revision ed078c48f0d7b499a4565d4da2dde22a4dbf19d9)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc --mtriple=loongarch32 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA32
3; RUN: llc --mtriple=loongarch64 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA64
4
5;; Test the bare single-precision floating-point values selection:
6;; https://llvm.org/docs/LangRef.html#select-instruction
7
8define float @test(i1 %a, float %b, float %c) {
9; LA32-LABEL: test:
10; LA32:       # %bb.0:
11; LA32-NEXT:    andi $a0, $a0, 1
12; LA32-NEXT:    movgr2cf $fcc0, $a0
13; LA32-NEXT:    fsel $fa0, $fa1, $fa0, $fcc0
14; LA32-NEXT:    ret
15;
16; LA64-LABEL: test:
17; LA64:       # %bb.0:
18; LA64-NEXT:    andi $a0, $a0, 1
19; LA64-NEXT:    movgr2cf $fcc0, $a0
20; LA64-NEXT:    fsel $fa0, $fa1, $fa0, $fcc0
21; LA64-NEXT:    ret
22  %res = select i1 %a, float %b, float %c
23  ret float %res
24}
25