This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Casting boolean to an integer vector in OpenCL should set all bits if boolean is true
ClosedPublic

Authored by neil.hickey on Oct 1 2015, 8:29 AM.

Details

Summary

Changing behaviour of casting a true boolean to an integer vector for OpenCL. The spec (6.2.2) states that if the boolean is true, every bit in the result vector should be set. This change will treat the i1 value as signed for the purposes of performing the cast to integer, and therefore sign extend into the result.

Diff Detail

Event Timeline

neil.hickey updated this revision to Diff 36247.Oct 1 2015, 8:29 AM
neil.hickey retitled this revision from to Casting boolean to an integer vector in OpenCL should set all bits if boolean is true.
neil.hickey updated this object.
neil.hickey added a reviewer: cfe-commits.
neil.hickey retitled this revision from Casting boolean to an integer vector in OpenCL should set all bits if boolean is true to [OpenCL] Casting boolean to an integer vector in OpenCL should set all bits if boolean is true.Oct 1 2015, 8:56 AM
pekka.jaaskelainen added inline comments.
lib/CodeGen/CGExprScalar.cpp
820

Too long line here.

This revision is now accepted and ready to land.Oct 2 2015, 2:31 AM
neil.hickey updated this revision to Diff 36348.Oct 2 2015, 5:27 AM
neil.hickey edited edge metadata.

Fixing formatting problems.

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL249301.