A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Generic find_first_set_bit can use __builtin_ctz instead of __builtin_ffs

The former gives 0-based indexes, which is what our implementation returns,
making the "- 1" unnecessary.

Change-Id: I172ab5e06695be62e4a18d4fd0415b8314f5dc26

+4 -3
+4 -3
firmware/asm/ffs.c
··· 35 35 if (val == 0) 36 36 return 32; 37 37 38 - /* __builtin_ffs(l(l)): Returns one plus the index of the least significant 39 - 1-bit of x, or if x is zero, returns zero. */ 40 - return __builtin_ffs(val) - 1; 38 + /* __builtin_ctz[l[l]]: Returns the number of trailing 0-bits in x, 39 + * starting at the least significant bit position. If x is 0, the result 40 + * is undefined. */ 41 + return __builtin_ctz(val); 41 42 }