1 ; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -mtriple=aarch64-apple-darwin -code-model=large -verify-machineinstrs < %s | FileCheck %s --check-prefixes=LARGE
3 ; RUN: llc -mtriple=aarch64 -code-model=tiny -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=aarch64-linux-gnu -global-isel -verify-machineinstrs < %s | FileCheck %s
6 @varf32 = global float 0.0
7 @varf64 = global double 0.0
9 define void @check_float() {
10 ; CHECK-LABEL: check_float:
12 %val = load float, ptr @varf32
13 %newval1 = fadd float %val, 8.5
14 store volatile float %newval1, ptr @varf32
15 ; CHECK-DAG: fmov {{s[0-9]+}}, #8.5
17 %newval2 = fadd float %val, 128.0
18 store volatile float %newval2, ptr @varf32
19 ; CHECK-DAG: movi [[REG:v[0-9s]+]].2s, #67, lsl #24
25 define void @check_double() {
26 ; CHECK-LABEL: check_double:
28 %val = load double, ptr @varf64
29 %newval1 = fadd double %val, 8.5
30 store volatile double %newval1, ptr @varf64
31 ; CHECK-DAG: fmov {{d[0-9]+}}, #8.5
33 %newval2 = fadd double %val, 128.0
34 store volatile double %newval2, ptr @varf64
35 ; CHECK-DAG: mov [[X128:x[0-9]+]], #4638707616191610880
36 ; CHECK-DAG: fmov {{d[0-9]+}}, [[X128]]
38 ; 64-bit ORR followed by MOVK.
39 ; CHECK-DAG: mov [[XFP0:x[0-9]+]], #1082331758844
40 ; CHECK-DAG: movk [[XFP0]], #64764, lsl #16
41 ; CHECk-DAG: fmov {{d[0-9]+}}, [[XFP0]]
42 %newval3 = fadd double %val, 0xFCFCFC00FC
43 store volatile double %newval3, ptr @varf64
49 ; CHECK-LABEL: check_float2
50 ; CHECK: mov [[REG:w[0-9]+]], #4059
51 ; CHECK-NEXT: movk [[REG]], #16457, lsl #16
52 ; CHECK-NEXT: fmov {{s[0-9]+}}, [[REG]]
53 define float @check_float2() {
54 ret float 3.14159274101257324218750
57 ; LARGE-LABEL: check_double2
58 ; LARGE: mov [[REG:x[0-9]+]], #11544
59 ; LARGE-NEXT: movk [[REG]], #21572, lsl #16
60 ; LARGE-NEXT: movk [[REG]], #8699, lsl #32
61 ; LARGE-NEXT: movk [[REG]], #16393, lsl #48
62 ; LARGE-NEXT: fmov {{d[0-9]+}}, [[REG]]
63 define double @check_double2() {
64 ret double 3.1415926535897931159979634685441851615905761718750