From cf305dbb7f3e3be7c4e6c71174e1183eb489ec03 Mon Sep 17 00:00:00 2001 From: Jerry Ge Date: Mon, 6 Mar 2023 13:07:36 -0800 Subject: Refactor 1L to INT64_C() Signed-off-by: Jerry Ge Change-Id: If3f8c5a1f2dffac36448101959557f86b6ab6c7f --- reference_model/src/arith_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'reference_model/src/arith_util.h') diff --git a/reference_model/src/arith_util.h b/reference_model/src/arith_util.h index 9c84a03..59bdf44 100644 --- a/reference_model/src/arith_util.h +++ b/reference_model/src/arith_util.h @@ -1,5 +1,5 @@ -// Copyright (c) 2020, ARM Limited. +// Copyright (c) 2020-2023, ARM Limited. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ inline size_t _count_leading_ones(T val) #define DIV_CEIL(a, b) ((a) % (b) ? ((a) / (b) + 1) : ((a) / (b))) // Returns a mask of 1's of this size -#define ONES_MASK(SIZE) ((uint64_t)((SIZE) >= 64 ? 0xffffffffffffffffULL : ((uint64_t)(1) << (SIZE)) - 1)) +#define ONES_MASK(SIZE) ((uint64_t)((SIZE) >= 64 ? UINT64_C(0xffffffffffffffff) : (UINT64_C(1) << (SIZE)) - 1)) // Returns a field of bits from HIGH_BIT to LOW_BIT, right-shifted // include both side, equivalent VAL[LOW_BIT:HIGH_BIT] in verilog -- cgit v1.2.1