This is an archive of the discontinued LLVM Phabricator instance.

Fix VectorLegalizer::ExpandUINT_TO_FLOAT -- wrong results for v*f64
Needs ReviewPublic

Authored by Rutt on Feb 16 2018, 12:05 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This code inadvertently does a 32 bit calculation whose result must be 64 bits, resulting in incorrect floating point conversions.

When the underlying components of the vector are f64, BW is 64 and the shift:

1 << (BW/2) results in an undefined result when BW >= 31.

We need to write as lL << (BW/2) in order to do the shift in 64 bits with a 64 bit result

Diff Detail

Event Timeline

Rutt created this revision.Feb 16 2018, 12:05 PM