Changeset View
Changeset View
Standalone View
Standalone View
test/CodeGen/AArch64/f16-imm.ll
- This file was added.
; RUN: llc < %s -mtriple=aarch64-none-eabi -mattr=+fullfp16 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ILEGAL | |||||
; RUN: llc < %s -mtriple=aarch64-none-eabi -mattr=-fullfp16 | FileCheck %s --check-prefix=CHECK-NOFP16 --check-prefix=CHECK-ILEGAL | |||||
samparker: A pedantic native speaker may point out that's its 'illegal'... ;) | |||||
; Here we test fp literal 1.25f16, which is a legal f16 immediate when | |||||
; when FP16 is supported, and ilegal without FP16 enabled. | |||||
define half @fmovi() { | |||||
entry: | |||||
ret half 0xH3D00 | |||||
} | |||||
; CHECK-LABEL: fmovi: | |||||
; CHECK: fmov h0, #1.25000000 | |||||
; CHECK-NOFP16: .[[LBL125:LCPI[0-9]_[0-9]]]: | |||||
; CHECK-NOFP16-NEXT: .hword 15616 // half 1.25 | |||||
; CHECK-NOFP16-LABEL: fmovi: | |||||
; CHECK-NOFP16: adrp x[[NUM:[0-9]+]], .[[LBL125]] | |||||
; CHECK-NOFP16-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL125]]] | |||||
; Here we test fp literal 32.0f16, which is not a legal f16 immediate even | |||||
samparkerUnsubmitted Not Done ReplyInline ActionsI think it would be a good idea to add the tests that cover the edge cases too, so that the minimal and maximum values are shown to be accepted correctly. samparker: I think it would be a good idea to add the tests that cover the edge cases too, so that the… | |||||
; when FP16 is enabled | |||||
define half @IlegalF16Imm() { | |||||
entry: | |||||
ret half 0xH5000 | |||||
} | |||||
; CHECK-ILEGAL: .[[LBL32:LCPI[0-9]_[0-9]]]: | |||||
; CHECK-ILEGAL-NEXT: .hword 20480 // half 32 | |||||
; CHECK-ILEGAL-LABEL: IlegalF16Imm: | |||||
; CHECK-ILEGAL: adrp x[[NUM:[0-9]+]], .[[LBL32]] | |||||
; CHECK-ILEGAL-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL32]]] |
A pedantic native speaker may point out that's its 'illegal'... ;)