diff options
author | Mark Mendell <mark.p.mendell@intel.com> | 2015-05-06 10:55:34 -0400 |
---|---|---|
committer | Mark Mendell <mark.p.mendell@intel.com> | 2015-05-13 16:20:48 -0400 |
commit | e82549b14c7def0a45461183964f7e6a34cbb70c (patch) | |
tree | 9293e5bf58657883923fe08ff1964e92e81e8851 /compiler/optimizing/code_generator.h | |
parent | c3912c8a2db109a15603554fd456f56cd0a69ad0 (diff) |
[optimizing] Fold HTypeConversion of constants
While looking into optimizing long shifts on x86, I found that the
compiler wasn't folding HTypeConversion of constants. Add simple
conversions of constants, taking care of float/double values
with NaNs and small/large values, ensuring Java conversion semantics.
Add checker cases to see that constant folding of HTypeConversion is
done.
Ensure 422-type-conversion type conversion routiness don't get
inlined to avoid compile time folding.
Change-Id: I5a4eb376b64bc4e41bf908af5875bed312efb228
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r-- | compiler/optimizing/code_generator.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index bdbd571133..fcfedab9bb 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -34,10 +34,15 @@ static int64_t constexpr k2Pow32EncodingForDouble = INT64_C(0x41F0000000000000); // Binary encoding of 2^31 for type double. static int64_t constexpr k2Pow31EncodingForDouble = INT64_C(0x41E0000000000000); +// Minimum value for a primitive integer. +static int32_t constexpr kPrimIntMin = 0x80000000; +// Minimum value for a primitive long. +static int64_t constexpr kPrimLongMin = INT64_C(0x8000000000000000); + // Maximum value for a primitive integer. static int32_t constexpr kPrimIntMax = 0x7fffffff; // Maximum value for a primitive long. -static int64_t constexpr kPrimLongMax = 0x7fffffffffffffff; +static int64_t constexpr kPrimLongMax = INT64_C(0x7fffffffffffffff); class Assembler; class CodeGenerator; |