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=CHECK,LARGE
3 ; RUN: llc -mtriple=aarch64-none-eabi -code-model=tiny -verify-machineinstrs < %s | FileCheck %s
5 @varf32 = global float 0.0
6 @varf64 = global double 0.0
8 define void @check_float() {
9 ; CHECK-LABEL: check_float:
11 %val = load float, float* @varf32
12 %newval1 = fadd float %val, 8.5
13 store volatile float %newval1, float* @varf32
14 ; CHECK-DAG: fmov {{s[0-9]+}}, #8.5
16 %newval2 = fadd float %val, 128.0
17 store volatile float %newval2, float* @varf32
18 ; CHECK-DAG: mov [[W128:w[0-9]+]], #1124073472
19 ; CHECK-DAG: fmov {{s[0-9]+}}, [[W128]]
25 define void @check_double() {
26 ; CHECK-LABEL: check_double:
28 %val = load double, double* @varf64
29 %newval1 = fadd double %val, 8.5
30 store volatile double %newval1, double* @varf64
31 ; CHECK-DAG: fmov {{d[0-9]+}}, #8.5
33 %newval2 = fadd double %val, 128.0
34 store volatile double %newval2, double* @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, double* @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