This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Builtin] Allowing __rlwnm to accept a variable as a shift parameter
ClosedPublic

Authored by kamaub on Oct 6 2021, 7:01 AM.

Details

Summary

The builtin __rlwnm is currently constrained to accept only constants
for the shift parameter but the instructions emitted for it have no such
constraint, this patch allows the builtins to accept variable shift.

Diff Detail

Event Timeline

kamaub created this revision.Oct 6 2021, 7:01 AM
kamaub requested review of this revision.Oct 6 2021, 7:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2021, 7:01 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NeHuang added inline comments.
clang/test/CodeGen/builtins-ppc-xlcompat-error.c
44–45

Please also remove __builtin_ppc_rlwnm(ui, shift, 7); in this test. We only keep cases trigger sema check errors.

kamaub updated this revision to Diff 379103.Oct 12 2021, 10:33 AM

Addressing review request to remove unnecessary testing line.

kamaub marked an inline comment as done.Oct 12 2021, 10:34 AM

Please check and add a test in clang/test/CodeGen/builtins-ppc-xlcompat-rotate.c with shift as a variable.

kamaub updated this revision to Diff 379149.Oct 12 2021, 12:50 PM

Adding shift variable test case to builtins-ppc-xlcompat-rotate.c as per
review comment request.

NeHuang accepted this revision as: NeHuang.Oct 12 2021, 1:11 PM

Thanks. LGTM. One minor can be addressed when commit it.

clang/test/CodeGen/builtins-ppc-xlcompat-rotate.c
71

please remove shift = 31, in the comment

This revision is now accepted and ready to land.Oct 12 2021, 1:11 PM
amyk accepted this revision as: amyk.Oct 12 2021, 3:10 PM
amyk added a subscriber: amyk.

Aside from the comment made by Victor, also LGTM.

kamaub marked an inline comment as done.Oct 13 2021, 7:44 AM