[PATCH] D67595: [PowerPC] Add missing pattern for VSX Scalar Negative Multiply-Subtract Single Precision

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 03:18:34 PDT 2019


steven.zhang accepted this revision.
steven.zhang added a comment.
This revision is now accepted and ready to land.

LGTM with some minor comments. Thank you for the fix.



================
Comment at: llvm/lib/Target/PowerPC/PPCInstrVSX.td:1508
 
+  // Additional fnmsub patterns: -a*c + b == -(a*c - b)
+  def : Pat<(fma (fneg f32:$A), f32:$C, f32:$B),
----------------
minor comments. It would be better to write it as follows to align with "-(a*c-b); 
  def : Pat<(fma (fneg f32:$A), f32:$C, f32:$B),
            (XSNMSUBASP $B, $A, $C)>;


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrVSX.td:1508
 
+  // Additional fnmsub patterns: -a*c + b == -(a*c - b)
+  def : Pat<(fma (fneg f32:$A), f32:$C, f32:$B),
----------------
steven.zhang wrote:
> minor comments. It would be better to write it as follows to align with "-(a*c-b); 
>   def : Pat<(fma (fneg f32:$A), f32:$C, f32:$B),
>             (XSNMSUBASP $B, $A, $C)>;
Additional **XSNMSUBASP** patterns ...

And It would be more clear to write it as:
XSNMSUBASP $B, **$A, $C**


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67595





More information about the llvm-commits mailing list