diff options
author | Jacob Bramley <jacob.bramley@arm.com> | 2018-06-07 13:47:16 +0100 |
---|---|---|
committer | Jacob Bramley <jacob.bramley@arm.com> | 2018-06-07 16:01:45 +0100 |
commit | 1ea48ea5783f53409531258758848b670c311e69 (patch) | |
tree | 5ec9803ffd27e3c8dbd7113f170271aab6c5c38b | |
parent | 69203a5c036e37087261d0a9771e5334d8af709d (diff) |
Fix some implementation-defined initialisers.
Change-Id: I9c256b7fe89aae817f9e235e397aa70c104dc9dd
-rw-r--r-- | src/aarch64/instructions-aarch64.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/aarch64/instructions-aarch64.h b/src/aarch64/instructions-aarch64.h index 389b54cb..66ddf624 100644 --- a/src/aarch64/instructions-aarch64.h +++ b/src/aarch64/instructions-aarch64.h @@ -90,10 +90,12 @@ const uint64_t kHalfWordMask = UINT64_C(0xffff); const uint64_t kWordMask = UINT64_C(0xffffffff); const uint64_t kXMaxUInt = UINT64_C(0xffffffffffffffff); const uint64_t kWMaxUInt = UINT64_C(0xffffffff); +// Define k*MinInt with "-k*MaxInt - 1", because the hexadecimal representation +// (e.g. "INT32_C(0x80000000)") has implementation-defined behaviour. const int64_t kXMaxInt = INT64_C(0x7fffffffffffffff); -const int64_t kXMinInt = INT64_C(0x8000000000000000); +const int64_t kXMinInt = -kXMaxInt - 1; const int32_t kWMaxInt = INT32_C(0x7fffffff); -const int32_t kWMinInt = INT32_C(0x80000000); +const int32_t kWMinInt = -kWMaxInt - 1; const unsigned kFpRegCode = 29; const unsigned kLinkRegCode = 30; const unsigned kSpRegCode = 31; |