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@plt
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: lui a0, %hi(.LCPI1_1)
35 ; RV32IFD-NEXT: fld fa3, %lo(.LCPI1_1)(a0)
36 ; RV32IFD-NEXT: flt.d a0, fa5, fa4
37 ; RV32IFD-NEXT: flt.d a1, fa3, fa5
38 ; RV32IFD-NEXT: or a0, a0, a1
39 ; RV32IFD-NEXT: beqz a0, .LBB1_2
40 ; RV32IFD-NEXT: # %bb.1: # %if.then
41 ; RV32IFD-NEXT: call abort@plt
42 ; RV32IFD-NEXT: .LBB1_2: # %if.end
43 ; RV32IFD-NEXT: call exit@plt
45 ; RV32IZFINXZDINX-LABEL: main:
46 ; RV32IZFINXZDINX: # %bb.0: # %entry
47 ; RV32IZFINXZDINX-NEXT: addi sp, sp, -16
48 ; RV32IZFINXZDINX-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
49 ; RV32IZFINXZDINX-NEXT: lui a1, 262144
50 ; RV32IZFINXZDINX-NEXT: li a0, 0
51 ; RV32IZFINXZDINX-NEXT: call test@plt
52 ; RV32IZFINXZDINX-NEXT: sw a0, 0(sp)
53 ; RV32IZFINXZDINX-NEXT: sw a1, 4(sp)
54 ; RV32IZFINXZDINX-NEXT: lw a0, 0(sp)
55 ; RV32IZFINXZDINX-NEXT: lw a1, 4(sp)
56 ; RV32IZFINXZDINX-NEXT: lui a2, %hi(.LCPI1_0)
57 ; RV32IZFINXZDINX-NEXT: lw a3, %lo(.LCPI1_0+4)(a2)
58 ; RV32IZFINXZDINX-NEXT: lw a2, %lo(.LCPI1_0)(a2)
59 ; RV32IZFINXZDINX-NEXT: lui a4, %hi(.LCPI1_1)
60 ; RV32IZFINXZDINX-NEXT: lw a5, %lo(.LCPI1_1+4)(a4)
61 ; RV32IZFINXZDINX-NEXT: lw a4, %lo(.LCPI1_1)(a4)
62 ; RV32IZFINXZDINX-NEXT: flt.d a2, a0, a2
63 ; RV32IZFINXZDINX-NEXT: flt.d a0, a4, a0
64 ; RV32IZFINXZDINX-NEXT: or a0, a2, a0
65 ; RV32IZFINXZDINX-NEXT: beqz a0, .LBB1_2
66 ; RV32IZFINXZDINX-NEXT: # %bb.1: # %if.then
67 ; RV32IZFINXZDINX-NEXT: call abort@plt
68 ; RV32IZFINXZDINX-NEXT: .LBB1_2: # %if.end
69 ; RV32IZFINXZDINX-NEXT: call exit@plt
71 %call = call double @test(double 2.000000e+00)
72 %cmp = fcmp olt double %call, 2.400000e-01
73 %cmp2 = fcmp ogt double %call, 2.600000e-01
74 %or.cond = or i1 %cmp, %cmp2
75 br i1 %or.cond, label %if.then, label %if.end
82 call void @exit(i32 0)
88 declare void @exit(i32)