2020-08-28 16:31:11 +08:00
|
|
|
; RUN: llc < %s -asm-verbose=0 -mtriple=arm64-eabi -mattr=+bf16 | FileCheck %s
|
|
|
|
; RUN: llc < %s -asm-verbose=0 -mtriple=aarch64-eabi -mattr=+bf16 | FileCheck %s
|
[AArch64][BFloat] add BFloat instruction support for AArch64
Summary:
Add support for lowering various BFloat related SelDAG nodes:
- load/store (ldrh/strh)
- concat
- dup/duplane
- bitconvert/bitcast
- insert_subvector/insert_subreg
This patch is part of a series implementing the Bfloat16 extension of the
Armv8.6-a architecture, as detailed here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
The bfloat type, and its properties are specified in the Arm Architecture
Reference Manual:
https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile
Reviewers: ab, t.p.northover, john.brawn, fpetrogalli, sdesmalen, LukeGeeson
Reviewed By: fpetrogalli
Subscribers: LukeGeeson, pbarrio, kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79712
2020-05-27 22:27:47 +08:00
|
|
|
|
|
|
|
; test argument passing and simple load/store
|
|
|
|
|
|
|
|
define bfloat @test_load(bfloat* %p) nounwind {
|
|
|
|
; CHECK-LABEL: test_load:
|
|
|
|
; CHECK-NEXT: ldr h0, [x0]
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
%tmp1 = load bfloat, bfloat* %p, align 16
|
|
|
|
ret bfloat %tmp1
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x bfloat> @test_vec_load(<4 x bfloat>* %p) nounwind {
|
|
|
|
; CHECK-LABEL: test_vec_load:
|
|
|
|
; CHECK-NEXT: ldr d0, [x0]
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
%tmp1 = load <4 x bfloat>, <4 x bfloat>* %p, align 16
|
|
|
|
ret <4 x bfloat> %tmp1
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_store(bfloat* %a, bfloat %b) nounwind {
|
|
|
|
; CHECK-LABEL: test_store:
|
|
|
|
; CHECK-NEXT: str h0, [x0]
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
store bfloat %b, bfloat* %a, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Simple store of v4bf16
|
|
|
|
define void @test_vec_store(<4 x bfloat>* %a, <4 x bfloat> %b) nounwind {
|
|
|
|
; CHECK-LABEL: test_vec_store:
|
|
|
|
; CHECK-NEXT: str d0, [x0]
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
entry:
|
|
|
|
store <4 x bfloat> %b, <4 x bfloat>* %a, align 16
|
|
|
|
ret void
|
|
|
|
}
|