[clang,MveEmitter] Fix sign/zero extension in range limits.
authorSimon Tatham <simon.tatham@arm.com>
Thu, 31 Oct 2019 17:02:42 +0000 (17:02 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Wed, 6 Nov 2019 09:01:42 +0000 (09:01 +0000)
commit26bc7cb05edd6bea4b9a1593baf0fbe9e45f54e4
tree4e20d10fa507b2ce83b36cdf7c1372dbe5ed2703
parent38f016520f6edbfa7d059b60ac54e80dd955ada5
[clang,MveEmitter] Fix sign/zero extension in range limits.

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.

Reviewers: dmgreen

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69789
clang/utils/TableGen/MveEmitter.cpp