This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add sub_with_borrow to builtin_wrapper.h
ClosedPublic

Authored by lntue on Nov 16 2022, 9:59 PM.

Details

Summary

Add sub_with_borrow to builtin_wrapper.h to be used in UInt.

Diff Detail

Event Timeline

lntue created this revision.Nov 16 2022, 9:59 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 16 2022, 9:59 PM
lntue requested review of this revision.Nov 16 2022, 9:59 PM
sivachandra added inline comments.Nov 17 2022, 3:03 PM
libc/src/__support/builtin_wrappers.h
127

Why not use number_pair for the return value?

lntue added inline comments.Nov 17 2022, 3:42 PM
libc/src/__support/builtin_wrappers.h
127

Since these are kind of built-in wrappers, I want to kind of preserve how the builtins are defined. Also the number_pair for subtraction is actually a bit odd, since then the carry/borrow/high part is actually of negative sign, while the result/low part is of positive sign.

lntue updated this revision to Diff 476520.Nov 18 2022, 10:05 AM

Add DEFINE_NAMED_PAIR_TEMPLATE and update return values for builtins wrappers.

sivachandra accepted this revision.Nov 18 2022, 10:48 PM

Thanks for cleaning up other places also.

This revision is now accepted and ready to land.Nov 18 2022, 10:48 PM
This revision was automatically updated to reflect the committed changes.