1; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-linux-gnu -mcpu=cyclone | FileCheck %s
2; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-linux-gnu -code-model=large -mcpu=cyclone | FileCheck --check-prefix=CHECK-LARGE %s
3; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-none-eabi -code-model=tiny -mcpu=cyclone | FileCheck --check-prefix=CHECK-TINY %s
4; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP %s
5; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -code-model=large -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP-LARGE %s
6; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-none-eabi -code-model=tiny -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP-TINY %s
7
8@varfloat = global float 0.0
9@vardouble = global double 0.0
10
11define void @floating_lits() {
12; CHECK-LABEL: floating_lits:
13
14  %floatval = load float, float* @varfloat
15  %newfloat = fadd float %floatval, 128.0
16; CHECK: mov [[W128:w[0-9]+]], #1124073472
17; CHECK: fmov [[LIT128:s[0-9]+]], [[W128]]
18; CHECK-NOFP-NOT: ldr {{s[0-9]+}},
19
20; CHECK-TINY: mov [[W128:w[0-9]+]], #1124073472
21; CHECK-TINE: fmov [[LIT128:s[0-9]+]], [[W128]]
22; CHECK-NOFP-TINY-NOT: ldr {{s[0-9]+}},
23
24; CHECK-LARGE: mov [[W128:w[0-9]+]], #1124073472
25; CHECK-LARGE: fmov [[LIT128:s[0-9]+]], [[W128]]
26; CHECK-LARGE: fadd
27; CHECK-NOFP-LARGE-NOT: ldr {{s[0-9]+}},
28; CHECK-NOFP-LARGE-NOT: fadd
29
30  store float %newfloat, float* @varfloat
31
32  %doubleval = load double, double* @vardouble
33  %newdouble = fadd double %doubleval, 129.0
34; CHECK-NOFP-NOT: ldr {{d[0-9]+}},
35; CHECK: mov  [[W129:x[0-9]+]], #35184372088832
36; CHECK: movk [[W129]], #16480, lsl #48
37; CHECK: fmov {{d[0-9]+}}, [[W129]]
38; CHECK-NOFP-NOT: fadd
39
40; CHECK-TINY: mov  [[W129:x[0-9]+]], #35184372088832
41; CHECK-TINY: movk [[W129]], #16480, lsl #48
42; CHECK-TINY: fmov {{d[0-9]+}}, [[W129]]
43; CHECK-NOFP-TINY-NOT: ldr {{d[0-9]+}},
44; CHECK-NOFP-TINY-NOT: fadd
45
46; CHECK-LARGE: movz x[[LITADDR:[0-9]+]], #:abs_g0_nc:[[CURLIT:vardouble]]
47; CHECK-LARGE: movk x[[LITADDR]], #:abs_g1_nc:[[CURLIT]]
48; CHECK-LARGE: movk x[[LITADDR]], #:abs_g2_nc:[[CURLIT]]
49; CHECK-LARGE: movk x[[LITADDR]], #:abs_g3:[[CURLIT]]
50; CHECK-LARGE: ldr {{d[0-9]+}}, [x[[LITADDR]]]
51; CHECK-NOFP-LARGE-NOT: ldr {{d[0-9]+}},
52
53  store double %newdouble, double* @vardouble
54
55  ret void
56}
57