[all-commits] [llvm/llvm-project] 7a001a: [PowerPC] Require nsz flag for c-a*b to FNMSUB

Qiu Chaofan via All-commits all-commits at lists.llvm.org
Thu Jun 4 01:41:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7a001a2d92a777de196eaaa070a4bfc23f40fd87
      https://github.com/llvm/llvm-project/commit/7a001a2d92a777de196eaaa070a4bfc23f40fd87
  Author: Qiu Chaofan <qiucofan at cn.ibm.com>
  Date:   2020-06-04 (Thu, 04 Jun 2020)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.h
    M llvm/lib/Target/PowerPC/PPCInstrInfo.td
    M llvm/lib/Target/PowerPC/PPCInstrVSX.td
    M llvm/test/CodeGen/PowerPC/combine-fneg.ll
    M llvm/test/CodeGen/PowerPC/f128-fma.ll
    M llvm/test/CodeGen/PowerPC/fdiv.ll
    M llvm/test/CodeGen/PowerPC/fma-assoc.ll
    M llvm/test/CodeGen/PowerPC/fma-combine.ll
    M llvm/test/CodeGen/PowerPC/fma-ext.ll
    M llvm/test/CodeGen/PowerPC/fma-negate.ll
    M llvm/test/CodeGen/PowerPC/fma-precision.ll
    M llvm/test/CodeGen/PowerPC/fma.ll
    M llvm/test/CodeGen/PowerPC/recipest.ll
    M llvm/test/CodeGen/PowerPC/repeated-fp-divisors.ll

  Log Message:
  -----------
  [PowerPC] Require nsz flag for c-a*b to FNMSUB

On PowerPC, FNMSUB (both VSX and non-VSX version) means -(a*b-c). But
the backend used to generate these instructions regardless whether nsz
flag exists or not. If a*b-c==0, such transformation changes sign of
zero.

This patch introduces PPC specific FNMSUB ISD opcode, which may help
improving combined FMA code sequence.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D76585




More information about the All-commits mailing list