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 | FileCheck %s --check-prefix=CHECK-SF
4 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky -float-abi=hard -mattr=+hard-float -mattr=+2e3 -mattr=+fpuv3_sf | FileCheck %s --check-prefix=CHECK-SF2
6 define float @load_I_w(ptr nocapture readonly %a) local_unnamed_addr #0 {
8 ; CHECK-SF-LABEL: load_I_w:
9 ; CHECK-SF: # %bb.0: # %entry
10 ; CHECK-SF-NEXT: flds vr0, (a0, 12)
11 ; CHECK-SF-NEXT: rts16
13 ; CHECK-SF2-LABEL: load_I_w:
14 ; CHECK-SF2: # %bb.0: # %entry
15 ; CHECK-SF2-NEXT: fld.32 vr0, (a0, 12)
16 ; CHECK-SF2-NEXT: rts16
18 %arrayidx = getelementptr inbounds float, ptr %a, i64 3
19 %0 = load float, ptr %arrayidx, align 4
23 define float @load_R_w(ptr nocapture readonly %a, i32 %b) local_unnamed_addr #0 {
25 ; CHECK-SF-LABEL: load_R_w:
26 ; CHECK-SF: # %bb.0: # %entry
27 ; CHECK-SF-NEXT: fldrs vr0, (a0, a1 << 2)
28 ; CHECK-SF-NEXT: rts16
30 ; CHECK-SF2-LABEL: load_R_w:
31 ; CHECK-SF2: # %bb.0: # %entry
32 ; CHECK-SF2-NEXT: fldr.32 vr0, (a0, a1 << 2)
33 ; CHECK-SF2-NEXT: rts16
35 %idxprom = sext i32 %b to i64
36 %arrayidx = getelementptr inbounds float, ptr %a, i64 %idxprom
37 %0 = load float, ptr %arrayidx, align 4
42 define float @store_I_w(ptr %a, float %b) local_unnamed_addr #0 {
44 ; CHECK-SF-LABEL: store_I_w:
45 ; CHECK-SF: # %bb.0: # %entry
46 ; CHECK-SF-NEXT: fsts vr0, (a0, 12)
47 ; CHECK-SF-NEXT: movi16 a0, 0
48 ; CHECK-SF-NEXT: fmtvrl vr0, a0
49 ; CHECK-SF-NEXT: rts16
51 ; CHECK-SF2-LABEL: store_I_w:
52 ; CHECK-SF2: # %bb.0: # %entry
53 ; CHECK-SF2-NEXT: fst.32 vr0, (a0, 12)
54 ; CHECK-SF2-NEXT: movi16 a0, 0
55 ; CHECK-SF2-NEXT: fmtvr.32.1 vr0, a0
56 ; CHECK-SF2-NEXT: rts16
58 %arrayidx = getelementptr inbounds float, ptr %a, i64 3
59 store float %b, ptr %arrayidx, align 4
63 define float @store_R_w(ptr %a, i32 %b, float %c) local_unnamed_addr #0 {
65 ; CHECK-SF-LABEL: store_R_w:
66 ; CHECK-SF: # %bb.0: # %entry
67 ; CHECK-SF-NEXT: fstrs vr0, (a0, a1 << 2)
68 ; CHECK-SF-NEXT: movi16 a0, 0
69 ; CHECK-SF-NEXT: fmtvrl vr0, a0
70 ; CHECK-SF-NEXT: rts16
72 ; CHECK-SF2-LABEL: store_R_w:
73 ; CHECK-SF2: # %bb.0: # %entry
74 ; CHECK-SF2-NEXT: fstr.32 vr0, (a0, a1 << 2)
75 ; CHECK-SF2-NEXT: movi16 a0, 0
76 ; CHECK-SF2-NEXT: fmtvr.32.1 vr0, a0
77 ; CHECK-SF2-NEXT: rts16
79 %idxprom = sext i32 %b to i64
80 %arrayidx = getelementptr inbounds float, ptr %a, i64 %idxprom
81 store float %c, ptr %arrayidx, align 4