1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d -target-abi=ilp32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32IFD %s
4 ; RUN: llc -mtriple=riscv32 -mattr=+zdinx -target-abi=ilp32 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV32IZFINXZDINX %s
7 define double @test(double %a) nounwind {
12 ; RV32IZFINXZDINX-LABEL: test:
13 ; RV32IZFINXZDINX: # %bb.0:
14 ; RV32IZFINXZDINX-NEXT: ret
18 ; This previously failed complaining of multiple vreg defs due to an ABI
21 define i32 @main() nounwind {
22 ; RV32IFD-LABEL: main:
23 ; RV32IFD: # %bb.0: # %entry
24 ; RV32IFD-NEXT: addi sp, sp, -16
25 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
26 ; RV32IFD-NEXT: lui a1, 262144
27 ; RV32IFD-NEXT: li a0, 0
28 ; RV32IFD-NEXT: call test
29 ; RV32IFD-NEXT: sw a0, 0(sp)
30 ; RV32IFD-NEXT: sw a1, 4(sp)
31 ; RV32IFD-NEXT: fld fa5, 0(sp)
32 ; RV32IFD-NEXT: lui a0, %hi(.LCPI1_0)
33 ; RV32IFD-NEXT: fld fa4, %lo(.LCPI1_0)(a0)
34 ; RV32IFD-NEXT: flt.d a0, fa5, fa4
35 ; RV32IFD-NEXT: bnez a0, .LBB1_3
36 ; RV32IFD-NEXT: # %bb.1: # %entry
37 ; RV32IFD-NEXT: lui a0, %hi(.LCPI1_1)
38 ; RV32IFD-NEXT: fld fa4, %lo(.LCPI1_1)(a0)
39 ; RV32IFD-NEXT: flt.d a0, fa4, fa5
40 ; RV32IFD-NEXT: bnez a0, .LBB1_3
41 ; RV32IFD-NEXT: # %bb.2: # %if.end
42 ; RV32IFD-NEXT: call exit
43 ; RV32IFD-NEXT: .LBB1_3: # %if.then
44 ; RV32IFD-NEXT: call abort
46 ; RV32IZFINXZDINX-LABEL: main:
47 ; RV32IZFINXZDINX: # %bb.0: # %entry
48 ; RV32IZFINXZDINX-NEXT: addi sp, sp, -16
49 ; RV32IZFINXZDINX-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
50 ; RV32IZFINXZDINX-NEXT: lui a1, 262144
51 ; RV32IZFINXZDINX-NEXT: li a0, 0
52 ; RV32IZFINXZDINX-NEXT: call test
53 ; RV32IZFINXZDINX-NEXT: lui a2, %hi(.LCPI1_0)
54 ; RV32IZFINXZDINX-NEXT: lw a3, %lo(.LCPI1_0+4)(a2)
55 ; RV32IZFINXZDINX-NEXT: lw a2, %lo(.LCPI1_0)(a2)
56 ; RV32IZFINXZDINX-NEXT: flt.d a2, a0, a2
57 ; RV32IZFINXZDINX-NEXT: bnez a2, .LBB1_3
58 ; RV32IZFINXZDINX-NEXT: # %bb.1: # %entry
59 ; RV32IZFINXZDINX-NEXT: lui a2, %hi(.LCPI1_1)
60 ; RV32IZFINXZDINX-NEXT: lw a3, %lo(.LCPI1_1+4)(a2)
61 ; RV32IZFINXZDINX-NEXT: lw a2, %lo(.LCPI1_1)(a2)
62 ; RV32IZFINXZDINX-NEXT: flt.d a0, a2, a0
63 ; RV32IZFINXZDINX-NEXT: bnez a0, .LBB1_3
64 ; RV32IZFINXZDINX-NEXT: # %bb.2: # %if.end
65 ; RV32IZFINXZDINX-NEXT: call exit
66 ; RV32IZFINXZDINX-NEXT: .LBB1_3: # %if.then
67 ; RV32IZFINXZDINX-NEXT: call abort
69 %call = call double @test(double 2.000000e+00)
70 %cmp = fcmp olt double %call, 2.400000e-01
71 %cmp2 = fcmp ogt double %call, 2.600000e-01
72 %or.cond = or i1 %cmp, %cmp2
73 br i1 %or.cond, label %if.then, label %if.end
80 call void @exit(i32 0)
86 declare void @exit(i32)