This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline static s32 BITREV(s32 a) { | |
s32 ret; | |
asm __volatile__ ("bitrev %0, %1;" : "=r" (ret) : "r"(a)); | |
return ret; | |
} | |
inline static s32 CLZ(s32 a) { | |
s32 ret; | |
asm __volatile__ ("clz %0, %1" : "=r"(ret) : "r" (a)); | |
return ret; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline s32 lsbPosition(s32 a) { | |
s32 ret; | |
asm __volatile__("bitrev $0, %0; | |
clz %1, $0;" | |
: "=r"(ret) : "r"(a)); | |
return ret; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Name of the executable | |
TARGET = | |
#objects that go into the executable | |
OBJS = | |
CC = gcc | |
CFLAGS = -g -Wall | |
DEBUGGER = gdb |