diff options
author | Craig Topper <craig.topper@sifive.com> | 2023-07-11 10:42:25 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2023-07-11 10:42:25 -0700 |
commit | 2df12f30551e0cb9ecfd49a0cacf929e785c15da (patch) | |
tree | 5308c7d505d9f0053faabd3b606344edd3f1800d /clang/lib | |
parent | 1d796b48e4d48bd0e4b29972a1b8d653493ee30c (diff) | |
download | llvm-2df12f30551e0cb9ecfd49a0cacf929e785c15da.zip llvm-2df12f30551e0cb9ecfd49a0cacf929e785c15da.tar.gz llvm-2df12f30551e0cb9ecfd49a0cacf929e785c15da.tar.bz2 |
[ARM][AArch64] Make ACLE __clzl/__clzll return unsigned int instead of unsigned long/uint64_t.
Use unsigned long in place of uint32_t for both clz and cls.
As far as I can tell this matches what ACLE defines and what gcc implements.
Noticed while investigating fixing https://github.com/llvm/llvm-project/issues/63113
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/D154910
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Headers/arm_acle.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Headers/arm_acle.h b/clang/lib/Headers/arm_acle.h index e086f1f..382487f 100644 --- a/clang/lib/Headers/arm_acle.h +++ b/clang/lib/Headers/arm_acle.h @@ -138,28 +138,28 @@ __rorl(unsigned long __x, uint32_t __y) { /* CLZ */ -static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__)) +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __clz(uint32_t __t) { - return (uint32_t)__builtin_clz(__t); + return (unsigned int)__builtin_clz(__t); } -static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__)) +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __clzl(unsigned long __t) { - return (unsigned long)__builtin_clzl(__t); + return (unsigned int)__builtin_clzl(__t); } -static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__)) +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __clzll(uint64_t __t) { - return (uint64_t)__builtin_clzll(__t); + return (unsigned int)__builtin_clzll(__t); } /* CLS */ -static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__)) +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __cls(uint32_t __t) { return __builtin_arm_cls(__t); } -static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__)) +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __clsl(unsigned long __t) { #if __SIZEOF_LONG__ == 4 return __builtin_arm_cls(__t); @@ -168,7 +168,7 @@ __clsl(unsigned long __t) { #endif } -static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__)) +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __clsll(uint64_t __t) { return __builtin_arm_cls64(__t); } |