This is an archive of the discontinued LLVM Phabricator instance.

APFloat: Add some missing function declarations
ClosedPublic

Authored by tstellar on Jul 8 2023, 5:18 AM.

Details

Summary

Theses functions were added in fd1e5aa8dffa8b26e59fb340668b264b9ac80382
without a declaration.

Diff Detail

Event Timeline

tstellar created this revision.Jul 8 2023, 5:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2023, 5:18 AM
tstellar requested review of this revision.Jul 8 2023, 5:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2023, 5:18 AM

There were friend function declarations added for these functions to the DoubleAPFloat class, but no actual declarations.

nikic added a subscriber: nikic.Jul 10 2023, 11:41 AM

Are these functions used anywhere? If not, I think we should just remove them.

arsenm added a subscriber: arsenm.Jul 10 2023, 11:42 AM

These should be used for constant folding of ldexp and frexp

These should be used for constant folding of ldexp and frexp

We probably don't support constant folding for pcc_fp128. Or at least I don't see how it would work without the declarations.

These should be used for constant folding of ldexp and frexp

We probably don't support constant folding for pcc_fp128. Or at least I don't see how it would work without the declarations.

D149587 introduces the constant folding of ldexp. I haven't gotten around to posting the frexp patch yet

These should be used for constant folding of ldexp and frexp

We probably don't support constant folding for pcc_fp128. Or at least I don't see how it would work without the declarations.

D149587 introduces the constant folding of ldexp. I haven't gotten around to posting the frexp patch yet

This is working on APFloat though, not on DoubleAPFloat.

These should be used for constant folding of ldexp and frexp

We probably don't support constant folding for pcc_fp128. Or at least I don't see how it would work without the declarations.

D149587 introduces the constant folding of ldexp. I haven't gotten around to posting the frexp patch yet

This is working on APFloat though, not on DoubleAPFloat.

There's supposed to be a APFLOAT_DISPATCH_ON_SEMANTICS wrapper around ~everything

These should be used for constant folding of ldexp and frexp

We probably don't support constant folding for pcc_fp128. Or at least I don't see how it would work without the declarations.

D149587 introduces the constant folding of ldexp. I haven't gotten around to posting the frexp patch yet

This is working on APFloat though, not on DoubleAPFloat.

There's supposed to be a APFLOAT_DISPATCH_ON_SEMANTICS wrapper around ~everything

Which we already have so now I'm confused

Oh, I see. I think the reason this works is ADL, which also finds friend declarations even if not declared at namespace level.

llvm/include/llvm/ADT/APFloat.h
1459

These declarations should probably be next to hash_code hash_value(const DoubleAPFloat &Arg); above, rather than these definitions.

tstellar updated this revision to Diff 538815.Jul 10 2023, 1:58 PM
tstellar marked an inline comment as done.

Move declarations up to be next to the hash_value declaration.

nikic accepted this revision.Jul 10 2023, 2:22 PM

LGTM

This revision is now accepted and ready to land.Jul 10 2023, 2:22 PM
This revision was landed with ongoing or failed builds.Nov 7 2023, 8:52 AM
This revision was automatically updated to reflect the committed changes.