This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add constant folding for AVX512 versions of scalar floating point to integer conversion intrinsics.
ClosedPublic

Authored by craig.topper on Aug 9 2018, 11:47 PM.

Details

Summary

We've supported constant folding for sse versions for many years. This patch adds support for the avx512 versions including unsigned with the default rounding mode. We could probably do more with other roundings modes and SAE in the future.

The test cases are largely based on the sse.ll test cases. But I did add some test cases to ensure the unsigned versions don't accept negative values. Also checked the bounds of f64->i32 conversions to make sure unsigned has a larger positive range than signed.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 9 2018, 11:47 PM

Add FIXME for other rounding modes

RKSimon accepted this revision.Aug 12 2018, 6:38 AM

LGTM

This revision is now accepted and ready to land.Aug 12 2018, 6:38 AM
This revision was automatically updated to reflect the committed changes.