This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Properly support the half FP type with non-native operations (-fallow-half-args-and-returns)
ClosedPublic

Authored by ab on Mar 16 2015, 3:33 PM.

Details

Summary

The previous behavior was tantamount to saying LangOpts.NativeHalfType was implied by LangOpts.HalfArgsAndReturns, which AFAICT isn't true, especially given the latter is enabled by default on AArch64.
Instead, teach the various parts of CodeGen that already know about half (using the intrinsics or not) about the weird in-between case, where the "half" type is legal, but any operation on it (other than conversion from/to float and storage) isn't.

This is a smaller intermediate step to the end-goal of removing the intrinsic, always using "half", and letting the backend do the legalization.

Depends on D4602.

-Ahmed

Diff Detail

Repository
rL LLVM

Event Timeline

ab updated this revision to Diff 22058.Mar 16 2015, 3:33 PM
ab retitled this revision from to [CodeGen] Properly support the half FP type with non-native operations (-fallow-half-args-and-returns).
ab updated this object.
ab edited the test plan for this revision. (Show Details)
ab added a reviewer: olista01.
ab added subscribers: t.p.northover, joey, Unknown Object (MLST).
olista01 edited edge metadata.Mar 17 2015, 4:02 AM

You have marked this as depending on D4602, but this patch includes all of the changes from D4602, is this intentional?

This patch changes the behaviour for half<->int conversions, but I only see a test the for half->int direction. Could you add some more?

ab updated this revision to Diff 22401.Mar 20 2015, 6:19 PM
ab edited edge metadata.
  • Add missing int->half testcase
ab added a comment.Mar 20 2015, 6:21 PM

You have marked this as depending on D4602, but this patch includes all of the changes from D4602, is this intentional?

Yeah, I'm not sure it makes sense to do this in two parts, so let's say it supersedes D4602. If you want I can isolate the f64 changes back.

This patch changes the behaviour for half<->int conversions, but I only see a test the for half->int direction. Could you add some more?

Added, thanks!

-Ahmed

olista01 accepted this revision.Mar 23 2015, 9:59 AM
olista01 edited edge metadata.

Thanks, LGTM.

This revision is now accepted and ready to land.Mar 23 2015, 9:59 AM
This revision was automatically updated to reflect the committed changes.
ab added a comment.Mar 23 2015, 10:58 AM

Thanks Oliver!

I did commit them separately after all: r232968, r232971.

-Ahmed