[PATCH] D91527: [PowerPC][FP128] Fix the incorrect calling convention for IEEE long double on Power8

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 03:21:52 PST 2020


steven.zhang created this revision.
steven.zhang added reviewers: nemanjai, lei, qiucf, jsji, PowerPC.
Herald added subscribers: shchenz, kbarton, hiraditya.
Herald added a project: LLVM.
steven.zhang requested review of this revision.

For now, we are using the GPR to pass the arguments/return value for fp128 on Power8, which is incorrect. It should be VSR. The reason why we do it this way is that, we are setting the fp128 as illegal which make LLVM try to emulate it with i128 on Power8. So, we need to correct it as legal.

If the type is illegal, LLVM tries to soften the type with libcall. However, if the type is legal, we have to convert it into libcall inside LegalizeOp() which is a complete different code path with old implementation. I see quite a lot of cases failures due to different reason(some might be PowerPC target issue, some are legalizer issue). So, I added a temp option and guard the fix under that option and fix these issues with several patches.  The temp option will re moved if all the issues fixed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91527

Files:
  llvm/lib/Target/PowerPC/PPCCallingConv.td
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/PowerPC/PPCInstrAltivec.td
  llvm/test/CodeGen/PowerPC/f128-arith.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91527.305448.patch
Type: text/x-patch
Size: 18238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201116/51553c8a/attachment.bin>


More information about the llvm-commits mailing list