[PATCH] D62322: [ARM] Select fp16 fsqrt

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 26 03:40:10 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL361714: [ARM] Select fp16 fsqrt (authored by dmgreen, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62322?vs=200985&id=201440#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62322/new/

https://reviews.llvm.org/D62322

Files:
  llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
  llvm/trunk/test/CodeGen/ARM/fp16-fullfp16.ll


Index: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
+++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
@@ -1023,9 +1023,9 @@
              Sched<[WriteFPSQRT32]>;
 
 def VSQRTH : AHuI<0b11101, 0b11, 0b0001, 0b11, 0,
-                  (outs SPR:$Sd), (ins SPR:$Sm),
+                  (outs HPR:$Sd), (ins HPR:$Sm),
                   IIC_fpSQRT16, "vsqrt", ".f16\t$Sd, $Sm",
-                  []>;
+                  [(set HPR:$Sd, (fsqrt (f16 HPR:$Sm)))]>;
 
 let hasSideEffects = 0 in {
 let isMoveReg = 1 in {
Index: llvm/trunk/test/CodeGen/ARM/fp16-fullfp16.ll
===================================================================
--- llvm/trunk/test/CodeGen/ARM/fp16-fullfp16.ll
+++ llvm/trunk/test/CodeGen/ARM/fp16-fullfp16.ll
@@ -217,13 +217,17 @@
   ret void
 }
 
-; FIXME
-;define void @test_sqrt(half* %p) {
-;  %a = load half, half* %p, align 2
-;  %r = call half @llvm.sqrt.f16(half %a)
-;  store half %r, half* %p
-;  ret void
-;}
+define void @test_sqrt(half* %p) {
+; CHECK-LABEL: test_sqrt:
+; CHECK:         vldr.16 s0, [r0]
+; CHECK-NEXT:    vsqrt.f16 s0, s0
+; CHECK-NEXT:    vstr.16 s0, [r0]
+; CHECK-NEXT:    bx lr
+  %a = load half, half* %p, align 2
+  %r = call half @llvm.sqrt.f16(half %a)
+  store half %r, half* %p
+  ret void
+}
 
 ; FIXME
 ;define void @test_fpowi(half* %p, i32 %b) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62322.201440.patch
Type: text/x-patch
Size: 1417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190526/74aef0a8/attachment.bin>


More information about the llvm-commits mailing list