This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Update emission of udivmodei5 to latest ABI changes
AbandonedPublic

Authored by mgehre-amd on Apr 7 2022, 11:52 PM.

Details

Reviewers
LuoYuanke
pengfei
Summary

This updates https://reviews.llvm.org/D120329 to the changed interface of
https://reviews.llvm.org/D120327.

In particular:

  • We call udivmodei5 / divmodei5 instead of divei4,udivei4,modei4,umodei4 to avoid requiring dynamic allocation
  • udivmodei5/divmodei5 take the number of words instead of number of bits as argument
  • The argument 'a' needs to hold on extra word to allow for implementations that need that scratch space

Diff Detail

Event Timeline

mgehre-amd created this revision.Apr 7 2022, 11:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 11:52 PM
mgehre-amd requested review of this revision.Apr 7 2022, 11:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 11:52 PM
LuoYuanke added inline comments.Apr 15 2022, 5:22 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
3927

What's the word size in bit? 16 or 32? Int looks double word size.

llvm/test/CodeGen/X86/udivmodei5.ll
1103

Why stack increase 80 for the new API? Doesn't it only increase 4 bytes for the extra space of a?

mgehre-amd abandoned this revision.Jul 19 2022, 4:38 AM

I'm abandoning this approach in favor of https://reviews.llvm.org/D130076

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
3927

I assumed that it would match the size of a C int on this target.