[PATCH] D75998: [ARM,MVE] Add intrinsics and isel for MVE fused multiply-add.

Simon Tatham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 11 09:04:42 PDT 2020


simon_tatham created this revision.
simon_tatham added reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard.
Herald added subscribers: llvm-commits, cfe-commits, danielkiss, hiraditya, kristof.beyls.
Herald added projects: clang, LLVM.
simon_tatham updated this revision to Diff 249641.
simon_tatham added a comment.

Update test results following a last-minute correctness fix. (I updated one of the two test files but not the other.)


This adds the ACLE intrinsic family for the VFMA and VFMS
instructions, which perform fused multiply-add on vectors of floats.

I've represented the unpredicated versions in IR using the cross-
platform `@llvm.fma` IR intrinsic. We already had isel rules to
convert one of those into a vector VFMA in the simplest possible way;
but we didn't have rules to detect a negated argument and turn it into
VFMS, or rules to detect a splat argument and turn it into one of the
two vector/scalar forms of the instruction. Now we have all of those.

The predicated form uses a target-specific intrinsic as usual, but
I've stuck to just one, for a predicated FMA. The subtraction and
splat versions are code-generated by passing an fneg or a splat as one
of its operands, the same way as the unpredicated version.

In arm_mve_defs.h, I've had to introduce a tiny extra piece of
infrastructure: a record `id` for use in codegen dags which implements
the identity function. (Just because you can't declare a Tablegen
value of type dag which is //only// a `$varname`: you have to wrap it
in something. Now I can write `(id $varname)` to get the same effect.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75998

Files:
  clang/include/clang/Basic/arm_mve.td
  clang/include/clang/Basic/arm_mve_defs.td
  clang/test/CodeGen/arm-mve-intrinsics/ternary.c
  llvm/include/llvm/IR/IntrinsicsARM.td
  llvm/lib/Target/ARM/ARMInstrMVE.td
  llvm/test/CodeGen/Thumb2/mve-fmas.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/ternary.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75998.249641.patch
Type: text/x-patch
Size: 33619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200311/a60f6437/attachment-0001.bin>


More information about the cfe-commits mailing list