[PATCH] D62324: [ARM] Select fp16 fabs
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 26 03:49:12 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL361715: [ARM] Select fp16 fabs (authored by dmgreen, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D62324?vs=200986&id=201441#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62324/new/
https://reviews.llvm.org/D62324
Files:
llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
llvm/trunk/test/CodeGen/ARM/fp16-fullfp16.ll
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
@@ -312,13 +312,17 @@
; ret void
;}
-; FIXME
-;define void @test_fabs(half* %p) {
-; %a = load half, half* %p, align 2
-; %r = call half @llvm.fabs.f16(half %a)
-; store half %r, half* %p
-; ret void
-;}
+define void @test_fabs(half* %p) {
+; CHECK-LABEL: test_fabs:
+; CHECK: vldr.16 s0, [r0]
+; CHECK-NEXT: vabs.f16 s0, s0
+; CHECK-NEXT: vstr.16 s0, [r0]
+; CHECK-NEXT: bx lr
+ %a = load half, half* %p, align 2
+ %r = call half @llvm.fabs.f16(half %a)
+ store half %r, half* %p
+ ret void
+}
define void @test_minnum(half* %p, half* %q) {
; CHECK-LABEL: test_minnum:
Index: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
+++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
@@ -595,9 +595,9 @@
}
def VABSH : AHuI<0b11101, 0b11, 0b0000, 0b11, 0,
- (outs SPR:$Sd), (ins SPR:$Sm),
+ (outs HPR:$Sd), (ins HPR:$Sm),
IIC_fpUNA16, "vabs", ".f16\t$Sd, $Sm",
- []>;
+ [(set HPR:$Sd, (fabs (f16 HPR:$Sm)))]>;
let Defs = [FPSCR_NZCV] in {
def VCMPEZD : ADuI<0b11101, 0b11, 0b0101, 0b11, 0,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62324.201441.patch
Type: text/x-patch
Size: 1434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190526/e3ad3999/attachment.bin>
More information about the llvm-commits
mailing list