This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Add BCD add/sub/cmp builtins
ClosedPublic

Authored by nemanjai on Nov 17 2021, 6:58 AM.

Details

Reviewers
bmahjour
saghir
Group Reviewers
Restricted Project
Commits
rGc933c2eb3346: [PowerPC] Add BCD add/sub/cmp builtins
Summary

Support for builtins that use bcdadd./bcdsub. to add/subtract Binary Coded Decimal values as well as to determine validity and compare BCD values.

Diff Detail

Event Timeline

nemanjai created this revision.Nov 17 2021, 6:58 AM
nemanjai requested review of this revision.Nov 17 2021, 6:58 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 17 2021, 6:58 AM
saghir accepted this revision.Nov 17 2021, 9:50 AM
saghir added a subscriber: saghir.

LGTM.

This revision is now accepted and ready to land.Nov 17 2021, 9:50 AM
clang/lib/Headers/altivec.h
19050 ↗(On Diff #387933)

Do we need to add a case for "__CR6_SO_REV"? It is defined in line 25 but not used.

llvm/lib/Target/PowerPC/P10InstrResources.td
2078

nit: unrelated change

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
5096

can we remove this as default is 0?

5100

ditto

nemanjai added inline comments.Nov 22 2021, 9:36 AM
clang/lib/Headers/altivec.h
19050 ↗(On Diff #387933)

I added it for completeness, but there is currently no need to use it for any builtin.

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
5096

Sounds good.

This revision was automatically updated to reflect the committed changes.

@nemanjai how come the changes in altivec.h and clang/test/CodeGen/builtins-ppc-p8vector.c have been removed in the latest diff and the commit above?