diff options
author | Scott Michel <scottm@aero.org> | 2008-02-15 23:05:48 +0000 |
---|---|---|
committer | Scott Michel <scottm@aero.org> | 2008-02-15 23:05:48 +0000 |
commit | ac7091cb9cc8672cb11befc1a333f79752be0fc6 (patch) | |
tree | 16f995f13d3b186a0d2c18e0893cfed8258413b9 /projects | |
parent | 3db8f776a4658beee52af12aa9275ad0282b1cdd (diff) | |
download | external_llvm-ac7091cb9cc8672cb11befc1a333f79752be0fc6.zip external_llvm-ac7091cb9cc8672cb11befc1a333f79752be0fc6.tar.gz external_llvm-ac7091cb9cc8672cb11befc1a333f79752be0fc6.tar.bz2 |
Make tblgen a little smarter about constants smaller than i32. Currently,
tblgen will complain if a sign-extended constant does not fit into a
data type smaller than i32, e.g., i16. This causes a problem when certain
hex constants are used, such as 0xff for byte masks or immediate xor
values.
tblgen will try the sign-extended value first and, if the sign extended
value would overflow, it tries to see if the unsigned value will fit.
Consequently, a software developer can now safely incant:
(XORHIr16 R16C:$rA, 0xffff)
which is somewhat clearer and more informative than incanting:
(XORHIr16 R16C:$rA, (i16 -1))
even if the two are bitwise equivalent.
Tblgen also outputs the 64-bit unsigned constant in the generated ISel code
when getTargetConstant() is invoked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'projects')
0 files changed, 0 insertions, 0 deletions