2014-05-24 20:50:23 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-linux-gnu -mcpu=cyclone | FileCheck %s
|
|
|
|
; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-linux-gnu -code-model=large -mcpu=cyclone | FileCheck --check-prefix=CHECK-LARGE %s
|
2018-08-22 19:31:39 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-none-eabi -code-model=tiny -mcpu=cyclone | FileCheck --check-prefix=CHECK-TINY %s
|
2014-05-24 20:50:23 +08:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP %s
|
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -code-model=large -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP-LARGE %s
|
2018-08-22 19:31:39 +08:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-none-eabi -code-model=tiny -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP-TINY %s
|
2014-04-15 22:00:29 +08:00
|
|
|
|
|
|
|
@varfloat = global float 0.0
|
|
|
|
@vardouble = global double 0.0
|
|
|
|
|
|
|
|
define void @floating_lits() {
|
|
|
|
; CHECK-LABEL: floating_lits:
|
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%floatval = load float, float* @varfloat
|
2014-04-15 22:00:29 +08:00
|
|
|
%newfloat = fadd float %floatval, 128.0
|
2019-02-01 20:26:06 +08:00
|
|
|
; CHECK: mov [[W128:w[0-9]+]], #1124073472
|
|
|
|
; CHECK: fmov [[LIT128:s[0-9]+]], [[W128]]
|
2014-04-15 22:00:29 +08:00
|
|
|
; CHECK-NOFP-NOT: ldr {{s[0-9]+}},
|
|
|
|
|
2019-02-01 20:26:06 +08:00
|
|
|
; CHECK-TINY: mov [[W128:w[0-9]+]], #1124073472
|
|
|
|
; CHECK-TINE: fmov [[LIT128:s[0-9]+]], [[W128]]
|
2018-08-22 19:31:39 +08:00
|
|
|
; CHECK-NOFP-TINY-NOT: ldr {{s[0-9]+}},
|
|
|
|
|
2019-02-01 20:26:06 +08:00
|
|
|
; CHECK-LARGE: mov [[W128:w[0-9]+]], #1124073472
|
|
|
|
; CHECK-LARGE: fmov [[LIT128:s[0-9]+]], [[W128]]
|
2014-04-15 22:00:29 +08:00
|
|
|
; CHECK-LARGE: fadd
|
|
|
|
; CHECK-NOFP-LARGE-NOT: ldr {{s[0-9]+}},
|
|
|
|
; CHECK-NOFP-LARGE-NOT: fadd
|
|
|
|
|
|
|
|
store float %newfloat, float* @varfloat
|
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%doubleval = load double, double* @vardouble
|
2014-04-15 22:00:29 +08:00
|
|
|
%newdouble = fadd double %doubleval, 129.0
|
|
|
|
; CHECK-NOFP-NOT: ldr {{d[0-9]+}},
|
2019-03-19 02:45:57 +08:00
|
|
|
; CHECK: mov [[W129:x[0-9]+]], #35184372088832
|
|
|
|
; CHECK: movk [[W129]], #16480, lsl #48
|
|
|
|
; CHECK: fmov {{d[0-9]+}}, [[W129]]
|
2014-04-15 22:00:29 +08:00
|
|
|
; CHECK-NOFP-NOT: fadd
|
|
|
|
|
2019-03-19 02:45:57 +08:00
|
|
|
; CHECK-TINY: mov [[W129:x[0-9]+]], #35184372088832
|
|
|
|
; CHECK-TINY: movk [[W129]], #16480, lsl #48
|
|
|
|
; CHECK-TINY: fmov {{d[0-9]+}}, [[W129]]
|
2018-08-22 19:31:39 +08:00
|
|
|
; CHECK-NOFP-TINY-NOT: ldr {{d[0-9]+}},
|
|
|
|
; CHECK-NOFP-TINY-NOT: fadd
|
|
|
|
|
2019-03-19 02:45:57 +08:00
|
|
|
; CHECK-LARGE: movz x[[LITADDR:[0-9]+]], #:abs_g0_nc:[[CURLIT:vardouble]]
|
2014-04-15 22:00:29 +08:00
|
|
|
; CHECK-LARGE: movk x[[LITADDR]], #:abs_g1_nc:[[CURLIT]]
|
2017-01-19 02:57:08 +08:00
|
|
|
; CHECK-LARGE: movk x[[LITADDR]], #:abs_g2_nc:[[CURLIT]]
|
|
|
|
; CHECK-LARGE: movk x[[LITADDR]], #:abs_g3:[[CURLIT]]
|
2014-04-15 22:00:29 +08:00
|
|
|
; CHECK-LARGE: ldr {{d[0-9]+}}, [x[[LITADDR]]]
|
|
|
|
; CHECK-NOFP-LARGE-NOT: ldr {{d[0-9]+}},
|
|
|
|
|
|
|
|
store double %newdouble, double* @vardouble
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|