This is an archive of the discontinued LLVM Phabricator instance.

[clang,MveEmitter] Fix sign/zero extension in range limits.
ClosedPublic

Authored by simon_tatham on Nov 4 2019, 1:50 AM.

Details

Summary

In the code that generates Sema range checks on constant arguments, I
had a piece of code that checks the bounds specified in the Tablegen
intrinsic description against the range of the integer type being
tested. If the bounds are large enough to permit any value of the
integer type, you can omit the compile-time range check. (This case is
expected to come up in some of the bitwise operation intrinsics.)

But somehow I got my signed/unsigned check backwards (asking for the
signed min/max of an unsigned type and vice versa), and also made a
sign extension error in which a signed negative value gets
zero-extended. Now rewritten more sensibly, and it should get its
first sensible test from the next batch of intrinsics I'm planning to
add in D69791.

Diff Detail

Event Timeline

simon_tatham created this revision.Nov 4 2019, 1:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2019, 1:50 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dmgreen accepted this revision.Nov 4 2019, 4:21 AM

LGTM

This revision is now accepted and ready to land.Nov 4 2019, 4:21 AM
This revision was automatically updated to reflect the committed changes.