1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
4 ; https://bugs.llvm.org/show_bug.cgi?id=41668
6 define double @constant_fold_fdiv_by_zero(double* %p) {
7 ; CHECK-LABEL: constant_fold_fdiv_by_zero:
9 ; CHECK-NEXT: mov x8, #9218868437227405312
10 ; CHECK-NEXT: fmov d0, x8
12 %r = fdiv double 4.940660e-324, 0.0
18 define double @constant_fold_frem_by_zero(double* %p) {
19 ; CHECK-LABEL: constant_fold_frem_by_zero:
21 ; CHECK-NEXT: mov x8, #9221120237041090560
22 ; CHECK-NEXT: fmov d0, x8
24 %r = frem double 4.940660e-324, 0.0
30 define double @constant_fold_fmul_nan(double* %p) {
31 ; CHECK-LABEL: constant_fold_fmul_nan:
33 ; CHECK-NEXT: mov x8, #9221120237041090560
34 ; CHECK-NEXT: fmov d0, x8
36 %r = fmul double 0x7ff0000000000000, 0.0
42 define double @constant_fold_fadd_nan(double* %p) {
43 ; CHECK-LABEL: constant_fold_fadd_nan:
45 ; CHECK-NEXT: mov x8, #9221120237041090560
46 ; CHECK-NEXT: fmov d0, x8
48 %r = fadd double 0x7ff0000000000000, 0xfff0000000000000
54 define double @constant_fold_fsub_nan(double* %p) {
55 ; CHECK-LABEL: constant_fold_fsub_nan:
57 ; CHECK-NEXT: mov x8, #9221120237041090560
58 ; CHECK-NEXT: fmov d0, x8
60 %r = fsub double 0x7ff0000000000000, 0x7ff0000000000000
64 ; Inf * 0.0 + ? --> NaN
66 define double @constant_fold_fma_nan(double* %p) {
67 ; CHECK-LABEL: constant_fold_fma_nan:
69 ; CHECK-NEXT: mov x8, #9221120237041090560
70 ; CHECK-NEXT: fmov d0, x8
72 %r = call double @llvm.fma.f64(double 0x7ff0000000000000, double 0.0, double 42.0)
76 declare double @llvm.fma.f64(double, double, double)