• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -O0 -fast-isel-abort=1 -verify-machineinstrs -mtriple=arm64-apple-darwin < %s | FileCheck %s
2
3; Materialize using fmov
4define float @fmov_float1() {
5; CHECK-LABEL: fmov_float1
6; CHECK:       fmov s0, #1.25000000
7  ret float 1.250000e+00
8}
9
10define float @fmov_float2() {
11; CHECK-LABEL: fmov_float2
12; CHECK:       fmov s0, wzr
13  ret float 0.0e+00
14}
15
16define double @fmov_double1() {
17; CHECK-LABEL: fmov_double1
18; CHECK:       fmov d0, #1.25000000
19  ret double 1.250000e+00
20}
21
22define double @fmov_double2() {
23; CHECK-LABEL: fmov_double2
24; CHECK:       fmov d0, xzr
25  ret double 0.0e+00
26}
27
28; Materialize from constant pool
29define float @cp_float() {
30; CHECK-LABEL: cp_float
31; CHECK:       adrp [[REG:x[0-9]+]], {{lCPI[0-9]+_0}}@PAGE
32; CHECK-NEXT:  ldr s0, {{\[}}[[REG]], {{lCPI[0-9]+_0}}@PAGEOFF{{\]}}
33  ret float 0x400921FB60000000
34}
35
36define double @cp_double() {
37; CHECK-LABEL: cp_double
38; CHECK:       adrp [[REG:x[0-9]+]], {{lCPI[0-9]+_0}}@PAGE
39; CHECK-NEXT:  ldr d0, {{\[}}[[REG]], {{lCPI[0-9]+_0}}@PAGEOFF{{\]}}
40  ret double 0x400921FB54442D18
41}
42