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