1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
3 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky -float-abi=hard -mattr=+hard-float -mattr=+2e3 -mattr=+fpuv2_sf -mattr=+fpuv2_df | FileCheck %s --check-prefix=CHECK-DF
4 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky -float-abi=hard -mattr=+hard-float -mattr=+2e3 -mattr=+fpuv3_sf -mattr=+fpuv3_df | FileCheck %s --check-prefix=CHECK-DF2
6 define double @load_I_d(ptr nocapture readonly %a) local_unnamed_addr #0 {
9 ; CHECK-DF-LABEL: load_I_d:
10 ; CHECK-DF: # %bb.0: # %entry
11 ; CHECK-DF-NEXT: fldd vr0, (a0, 24)
12 ; CHECK-DF-NEXT: rts16
14 ; CHECK-DF2-LABEL: load_I_d:
15 ; CHECK-DF2: # %bb.0: # %entry
16 ; CHECK-DF2-NEXT: fld.64 vr0, (a0, 24)
17 ; CHECK-DF2-NEXT: rts16
19 %arrayidx = getelementptr inbounds double, ptr %a, i64 3
20 %0 = load double, ptr %arrayidx, align 4
26 define double @load_R_d(ptr nocapture readonly %a, i32 %b) local_unnamed_addr #0 {
29 ; CHECK-DF-LABEL: load_R_d:
30 ; CHECK-DF: # %bb.0: # %entry
31 ; CHECK-DF-NEXT: fldrd vr0, (a0, a1 << 3)
32 ; CHECK-DF-NEXT: rts16
34 ; CHECK-DF2-LABEL: load_R_d:
35 ; CHECK-DF2: # %bb.0: # %entry
36 ; CHECK-DF2-NEXT: fldr.64 vr0, (a0, a1 << 3)
37 ; CHECK-DF2-NEXT: rts16
39 %idxprom = sext i32 %b to i64
40 %arrayidx = getelementptr inbounds double, ptr %a, i64 %idxprom
41 %0 = load double, ptr %arrayidx, align 4
45 define double @store_I_d(ptr %a, double %b) local_unnamed_addr #0 {
48 ; CHECK-DF-LABEL: store_I_d:
49 ; CHECK-DF: # %bb.0: # %entry
50 ; CHECK-DF-NEXT: fstd vr0, (a0, 24)
51 ; CHECK-DF-NEXT: grs32 a0, .LCPI2_0
52 ; CHECK-DF-NEXT: fldd vr0, (a0, 0)
53 ; CHECK-DF-NEXT: rts16
54 ; CHECK-DF-NEXT: .p2align 1
55 ; CHECK-DF-NEXT: # %bb.1:
56 ; CHECK-DF-NEXT: .p2align 2
57 ; CHECK-DF-NEXT: .LCPI2_0:
58 ; CHECK-DF-NEXT: .quad 0x0000000000000000 # double 0
60 ; CHECK-DF2-LABEL: store_I_d:
61 ; CHECK-DF2: # %bb.0: # %entry
62 ; CHECK-DF2-NEXT: fst.64 vr0, (a0, 24)
63 ; CHECK-DF2-NEXT: flrw.64 vr0, [.LCPI2_0]
64 ; CHECK-DF2-NEXT: rts16
65 ; CHECK-DF2-NEXT: .p2align 1
66 ; CHECK-DF2-NEXT: # %bb.1:
67 ; CHECK-DF2-NEXT: .p2align 2
68 ; CHECK-DF2-NEXT: .LCPI2_0:
69 ; CHECK-DF2-NEXT: .quad 0x0000000000000000 # double 0
71 %arrayidx = getelementptr inbounds double, ptr %a, i64 3
72 store double %b, ptr %arrayidx, align 4
76 define double @store_R_d(ptr %a, i32 %b, double %c) local_unnamed_addr #0 {
79 ; CHECK-DF-LABEL: store_R_d:
80 ; CHECK-DF: # %bb.0: # %entry
81 ; CHECK-DF-NEXT: fstrd vr0, (a0, a1 << 3)
82 ; CHECK-DF-NEXT: grs32 a0, .LCPI3_0
83 ; CHECK-DF-NEXT: fldd vr0, (a0, 0)
84 ; CHECK-DF-NEXT: rts16
85 ; CHECK-DF-NEXT: .p2align 1
86 ; CHECK-DF-NEXT: # %bb.1:
87 ; CHECK-DF-NEXT: .p2align 2
88 ; CHECK-DF-NEXT: .LCPI3_0:
89 ; CHECK-DF-NEXT: .quad 0x0000000000000000 # double 0
91 ; CHECK-DF2-LABEL: store_R_d:
92 ; CHECK-DF2: # %bb.0: # %entry
93 ; CHECK-DF2-NEXT: fstr.64 vr0, (a0, a1 << 3)
94 ; CHECK-DF2-NEXT: flrw.64 vr0, [.LCPI3_0]
95 ; CHECK-DF2-NEXT: rts16
96 ; CHECK-DF2-NEXT: .p2align 1
97 ; CHECK-DF2-NEXT: # %bb.1:
98 ; CHECK-DF2-NEXT: .p2align 2
99 ; CHECK-DF2-NEXT: .LCPI3_0:
100 ; CHECK-DF2-NEXT: .quad 0x0000000000000000 # double 0
102 %idxprom = sext i32 %b to i64
103 %arrayidx = getelementptr inbounds double, ptr %a, i64 %idxprom
104 store double %c, ptr %arrayidx, align 4