llvm-project/llvm/test/CodeGen/AArch64/fp-const-fold.ll

26 lines
744 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
; https://bugs.llvm.org/show_bug.cgi?id=41668
define double @constant_fold_fdiv_by_zero(double* %p) {
; CHECK-LABEL: constant_fold_fdiv_by_zero:
; CHECK: // %bb.0:
; CHECK-NEXT: mov x8, #9218868437227405312
; CHECK-NEXT: fmov d0, x8
; CHECK-NEXT: ret
%r = fdiv double 4.940660e-324, 0.0
ret double %r
}
define double @constant_fold_frem_by_zero(double* %p) {
; CHECK-LABEL: constant_fold_frem_by_zero:
; CHECK: // %bb.0:
; CHECK-NEXT: mov x8, #1
; CHECK-NEXT: fmov d1, xzr
; CHECK-NEXT: fmov d0, x8
; CHECK-NEXT: b fmod
%r = frem double 4.940660e-324, 0.0
ret double %r
}