This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp][NFC] Add tests for __fp16
ClosedPublic

Authored by tbaeder on Mar 20 2023, 9:48 AM.

Details

Summary

This should already work just fine since our Floating just wraps an APFloat with the appropriate semantics.

Diff Detail

Event Timeline

tbaeder created this revision.Mar 20 2023, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 9:48 AM
tbaeder requested review of this revision.Mar 20 2023, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 9:48 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman added inline comments.Mar 20 2023, 12:30 PM
clang/test/AST/Interp/floats.cpp
110–111

This gets rejected before we even get to the constant expression interpreter, right?

120–121

I'm curious to see what the bot farm thinks of tests like this -- they're constant expression tests, but constant expressions are supposed to follow the target floating-point model where this might be inexact.

tbaeder updated this revision to Diff 506701.Mar 20 2023, 1:43 PM
tbaeder added inline comments.
clang/test/AST/Interp/floats.cpp
110–111

Yep, exactly. (Changed this to use a f16 suffix instead).

This revision is now accepted and ready to land.Mar 21 2023, 11:42 AM
This revision was automatically updated to reflect the committed changes.

Meh, is __fp16 something I need to check support for?