[PATCH] D134553: [ARM] Support fp16/bf16 using t constraint
Sam Elliott via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 28 06:49:09 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGff4027d152d0: [ARM] Support fp16/bf16 using t constraint (authored by lenary).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134553/new/
https://reviews.llvm.org/D134553
Files:
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/inlineasm-fp-half.ll
Index: llvm/test/CodeGen/ARM/inlineasm-fp-half.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/ARM/inlineasm-fp-half.ll
@@ -0,0 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=arm -mattr=+armv8.2-a,+fp-armv8,+fullfp16,+bf16,-neon %s -o - | FileCheck %s
+; RUN: llc -mtriple=thumb -mattr=+armv8.2-a,+fp-armv8,+fullfp16,+bf16,-neon %s -o - | FileCheck %s
+
+
+define arm_aapcscc half @f(half %x) nounwind {
+; CHECK-LABEL: f:
+; CHECK: @ %bb.0: @ %entry
+; CHECK-NEXT: vmov.f16 s0, r0
+; CHECK-NEXT: @APP
+; CHECK-NEXT: vsqrt.f16 s0, s0
+; CHECK-NEXT: @NO_APP
+; CHECK-NEXT: vmov r0, s0
+; CHECK-NEXT: bx lr
+entry:
+ %0 = tail call half asm "vsqrt.f16 $0, $1", "=t,t"(half %x)
+ ret half %0
+}
+
+define arm_aapcscc bfloat @h(bfloat %x) nounwind {
+; CHECK-LABEL: h:
+; CHECK: @ %bb.0: @ %entry
+; CHECK-NEXT: vmov.f16 s0, r0
+; CHECK-NEXT: @APP
+; CHECK-NEXT: vmov.f32 s0, s0
+; CHECK-NEXT: @NO_APP
+; CHECK-NEXT: vmov.f16 r0, s0
+; CHECK-NEXT: bx lr
+entry:
+ %0 = tail call bfloat asm "vmov.f32 $0, $1", "=t,t"(bfloat %x)
+ ret bfloat %0
+}
Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -20163,6 +20163,8 @@
case 't':
if (VT == MVT::Other)
break;
+ if (VT == MVT::f16 || VT == MVT::bf16)
+ return RCPair(0U, &ARM::HPRRegClass);
if (VT == MVT::f32 || VT == MVT::i32)
return RCPair(0U, &ARM::SPRRegClass);
if (VT.getSizeInBits() == 64)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134553.463533.patch
Type: text/x-patch
Size: 1724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220928/3fb33812/attachment.bin>
More information about the llvm-commits
mailing list