llvm-project/llvm/test/CodeGen/AArch64/fast-isel-const-float.ll
zhongyunde 2b3becb41d [AArch64][GlobalISel] Add new MOVI pattern for fp constants
GlobalISel is used in option -O0, so add MOVI pattern for it,
which is done similar in gcc.(https://godbolt.org/z/8j6fzG3h6)

Fix https://github.com/llvm/llvm-project/issues/53651

Reviewed By: dmgreen, paquette

Differential Revision: https://reviews.llvm.org/D122559
2022-03-29 10:57:22 +08:00

22 lines
799 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -verify-machineinstrs < %s | FileCheck %s --check-prefix=GISEL
; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -verify-machineinstrs < %s | FileCheck %s --check-prefix=FISEL
; float foo(void) { return float(2147483648); }
define float @select_fp_const() {
; CHECK-LABEL: select_opt4
; CHECK: movi v0.2s, #79, lsl #24
; GISEL-LABEL: select_fp_const:
; GISEL: // %bb.0: // %entry
; GISEL-NEXT: movi v0.2s, #79, lsl #24
; GISEL-NEXT: ret
;
; FISEL-LABEL: select_fp_const:
; FISEL: // %bb.0: // %entry
; FISEL-NEXT: adrp x8, .LCPI0_0
; FISEL-NEXT: ldr s0, [x8, :lo12:.LCPI0_0]
; FISEL-NEXT: ret
entry:
ret float 0x41E0000000000000
}