Patch add idr (#56)

* 增加了idr模块

* 增加了IDR模块,并尝试覆盖上一个错误版本.

* 增加了IDR模块

* 修改了test-idr.c文件

* 进一步完善函数注释

* 更新idr文档同时修改了test-idr的错误


* 将lz4库改为使用系统的clz函数

* idr和test-idr O1

* bugfix: 修复测试用例中的移位问题

* 修正问题

Signed-off-by: guanjinquan <1666320330@qq.com>
Co-authored-by: fslongjin <longjin@RinGoTek.cn>
This commit is contained in:
guanjinquan
2022-10-23 16:07:28 +08:00
committed by GitHub
parent d328bfce6b
commit d53ddde95d
8 changed files with 886 additions and 175 deletions

View File

@ -52,4 +52,18 @@ static __always_inline int __clzll(unsigned long long x)
: "a"(x)
: "memory");
return res;
}
}
static __always_inline int __ctz(uint32_t x)
{
asm volatile("tzcnt %%eax, %%eax":"=a"(x):"a"(x):"memory");
return x;
}
static __always_inline int __ctzl(unsigned long x)
{
asm volatile("tzcnt %%rax, %%rax":"=a"(x):"a"(x):"memory");
return x;
}
#define __ctzll __ctzl