Skip to content

Commit

Permalink
Undefine __builtin_clz/ctz from clzdi2/ctzdi2 if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Aug 10, 2024
1 parent 2cf5ef4 commit 9cdf93a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clzdi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ COMPILER_RT_ABI int __clzdi2(di_int a) {
return clzsi((x.s.high & ~f) | (x.s.low & f)) +
(f & ((si_int)(sizeof(si_int) * CHAR_BIT)));
}

#ifdef __builtin_clz
#undef __builtin_clz
#endif
4 changes: 4 additions & 0 deletions ctzdi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ COMPILER_RT_ABI int __ctzdi2(di_int a) {
return ctzsi((x.s.high & f) | (x.s.low & ~f)) +
(f & ((si_int)(sizeof(si_int) * CHAR_BIT)));
}

#ifdef __builtin_ctz
#undef __builtin_ctz
#endif

0 comments on commit 9cdf93a

Please sign in to comment.