[Lldb-commits] [PATCH] D144366: [RISCV]Add more pattern for fma ins

Feng Wang via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Feb 19 23:47:41 PST 2023


wf520gg created this revision.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
wf520gg requested review of this revision.
Herald added subscribers: llvm-commits, lldb-commits, pcwang-thead, eopXD, MaskRay.
Herald added projects: LLDB, LLVM.

Consider the following test cases:

double fma_1(double rs1, double rs2, double rs3)
{

  return  -(rs1 * rs2) - rs3;

}
double fma_2(double rs1, double rs2, double rs3)
{

  return  -(rs1 * rs2) + rs3;

}
The compiled assembly code with command --target=riscv64-unknown-elf
-march=rv64g is:
fma_1:
fneg.d	ft0, fa0
fmul.d	ft0, ft0, fa1
fsub.d	fa0, ft0, fa2
ret
fma_2:
fmul.d	ft0, fa0, fa1
fsub.d	fa0, fa2, ft0
ret
Compare with the gcc compiled result:
fma_1:
fnmadd.d  fa0,fa0,fa1,fa2
fma_2:
fnmsub.d  fa0,fa0,fa1,fa2
So I add new patterns for these two scenarios.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144366

Files:
  lldb/include/lldb/Target/Target.h
  lldb/source/API/SBExpressionOptions.cpp
  lldb/source/Breakpoint/BreakpointLocation.cpp
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Expression/UserExpression.cpp
  lldb/test/API/commands/expression/po_persistent_result/Makefile
  lldb/test/API/commands/expression/po_persistent_result/TestPoPersistentResult.py
  lldb/test/API/commands/expression/po_persistent_result/main.m
  llvm/lib/Target/RISCV/RISCVInstrInfoD.td
  llvm/lib/Target/RISCV/RISCVInstrInfoF.td
  llvm/test/CodeGen/RISCV/double-arith.ll
  llvm/test/CodeGen/RISCV/float-arith.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144366.498738.patch
Type: text/x-patch
Size: 11455 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230220/058f9837/attachment-0001.bin>


More information about the lldb-commits mailing list