[PATCH] D35911: ARM: Add missing selection patterns for vnmla

Gergö Barany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 13:32:06 PDT 2017


gergo- created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

(This is my first patch to LLVM. Let me know if there's anything I could improve.)

For the following function:

  double fn1(double d0, double d1, double d2) {
    double a = -d0 - d1 * d2;
    return a;
  }

on ARM, LLVM generates code along the lines of

  	vneg.f64	d0, d0
  	vmls.f64	d0, d1, d2

i.e., a negate and a multiply-subtract. The attached patch adds instruction selection patterns to allow it to generate the single instruction

  	vnmla.f64	d0, d1, d2

(multiply-add with negation) instead, like GCC does.


https://reviews.llvm.org/D35911

Files:
  lib/Target/ARM/ARMInstrVFP.td
  test/CodeGen/ARM/fnmscs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35911.108349.patch
Type: text/x-patch
Size: 3421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170726/64c524cb/attachment.bin>


More information about the llvm-commits mailing list