[PATCH] D60259: [AArch64] Add lowering pattern for llvm.aarch64.neon.vcvtfxs2fp.f16.i64

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 04:11:40 PDT 2019


dnsampaio created this revision.
dnsampaio added reviewers: pbarrio, DavidSpickett, LukeGeeson.
Herald added subscribers: llvm-commits, kristof.beyls, javed.absar.
Herald added a project: LLVM.

Add lowering pattern for llvm.aarch64.neon.vcvtfxs2fp.f16.i64


Repository:
  rL LLVM

https://reviews.llvm.org/D60259

Files:
  lib/Target/AArch64/AArch64InstrInfo.td
  test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll


Index: test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
===================================================================
--- test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
+++ test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
@@ -342,3 +342,13 @@
   %0 = trunc i32 %facg to i16
   ret i16 %0
 }
+
+define dso_local half @vcvth_n_f16_s64_test(i64 %a) {
+; CHECK-LABEL: vcvth_n_f16_s64_test:
+; CHECK:       fmov    d0, x0
+; CHECK-NEXT:  scvtf   h0, h0, #16
+; CHECK-NEXT:  ret
+entry:
+  %vcvth_n_f16_s64 = tail call half @llvm.aarch64.neon.vcvtfxs2fp.f16.i64(i64 %a, i32 16)
+  ret half %vcvth_n_f16_s64
+}
Index: lib/Target/AArch64/AArch64InstrInfo.td
===================================================================
--- lib/Target/AArch64/AArch64InstrInfo.td
+++ lib/Target/AArch64/AArch64InstrInfo.td
@@ -5327,6 +5327,8 @@
           (SCVTFh (EXTRACT_SUBREG FPR32:$Rn, hsub), vecshiftR16:$imm)>;
 def : Pat<(f16 (int_aarch64_neon_vcvtfxs2fp (i32 FPR32:$Rn), vecshiftR16:$imm)),
           (SCVTFh (EXTRACT_SUBREG FPR32:$Rn, hsub), vecshiftR16:$imm)>;
+def : Pat<(f16 (int_aarch64_neon_vcvtfxs2fp (i64 FPR64:$Rn), vecshiftR16:$imm)),
+          (SCVTFh (EXTRACT_SUBREG FPR64:$Rn, hsub), vecshiftR16:$imm)>;
 def : Pat<(f16 (int_aarch64_neon_vcvtfxu2fp
             (and FPR32:$Rn, (i32 65535)),
             vecshiftR16:$imm)),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60259.193687.patch
Type: text/x-patch
Size: 1341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190404/5ca4543d/attachment.bin>


More information about the llvm-commits mailing list