This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Change the type of argument to clz and ctz from ZiZi/WiWi to iUZi/iUWi
ClosedPublic

Authored by Jim on Jun 18 2023, 6:42 PM.

Details

Summary

Input argument of clz and ctz should be unsigned type and return value
should be integer like builtin_clz and builtin_ctz defined in clang/include/clang/Basic/Builtins.def.

Diff Detail

Event Timeline

Jim created this revision.Jun 18 2023, 6:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 18 2023, 6:42 PM
Jim requested review of this revision.Jun 18 2023, 6:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 18 2023, 6:42 PM
craig.topper added inline comments.Jun 19 2023, 12:58 PM
clang/include/clang/Basic/BuiltinsRISCV.def
22

I'd prefer we use UWi instead of ULi. If we ever implement ilp32 on RV64, long will not be xlen bits.

Jim updated this revision to Diff 532790.Jun 19 2023, 10:30 PM

Address comment.

Jim retitled this revision from [RISCV] Change the type of argument to clz and ctz from ZiZi/WiWi to iUi/iULi to [RISCV] Change the type of argument to clz and ctz from ZiZi/WiWi to iUZi/iUWi.Jun 19 2023, 10:31 PM
Jim edited the summary of this revision. (Show Details)
Jim edited the summary of this revision. (Show Details)
Jim marked an inline comment as done.
This revision is now accepted and ready to land.Jun 20 2023, 9:14 AM
This revision was landed with ongoing or failed builds.Jun 25 2023, 10:16 PM
This revision was automatically updated to reflect the committed changes.