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 | a3cefeaf0c43d558eac879b799cf037748c00b98 (patch) | |
| tree | 357871d0717cd36b41a7c206cba5a5a7ea561007 /clang/CodeGen/ModuleBuilder.cpp | |
| parent | 0c46309b021af63abd4d41ad7d18a6f8acc50f98 (diff) | |
| download | bcm5719-llvm-a3cefeaf0c43d558eac879b799cf037748c00b98.tar.gz bcm5719-llvm-a3cefeaf0c43d558eac879b799cf037748c00b98.zip | |
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.
llvm-svn: 47188
Diffstat (limited to 'clang/CodeGen/ModuleBuilder.cpp')
0 files changed, 0 insertions, 0 deletions

