当前位置:网站首页>glibc 源码分析
glibc 源码分析
2022-07-22 09:03:00 【zhixingheyi_tian】
获取source
git clone https://sourceware.org/git/glibc.git
cd glibc
git checkout release/2.17/master
git checkout release/2.20/master
libc-2.20 分析
./sysdeps/x86_64/multiarch/memset.S
/* Define multiple versions only for the definition in lib. */
# ifndef NOT_IN_libc
ENTRY(memset)
.type memset, @gnu_indirect_function
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
1: leaq __memset_sse2(%rip), %rax
testl $bit_AVX2_Usable, __cpu_features+FEATURE_OFFSET+index_AVX2_Usable(%rip)
jz 2f
leaq __memset_avx2(%rip), %rax
2: ret
END(memset)
# endif
./sysdeps/x86_64/multiarch/memcpy.S
/* Define multiple versions only for the definition in lib and for
DSO. In static binaries we need memcpy before the initialization
happened. */
#if defined SHARED && !defined NOT_IN_libc
.text
ENTRY(__new_memcpy)
.type __new_memcpy, @gnu_indirect_function
cmpl $0, KIND_OFFSET+__cpu_features(%rip)
jne 1f
call __init_cpu_features
1: leaq __memcpy_avx_unaligned(%rip), %rax
testl $bit_AVX_Fast_Unaligned_Load, __cpu_features+FEATURE_OFFSET+index_AVX_Fast_Unaligned_Load(%rip)
jz 1f
ret
1: leaq __memcpy_sse2(%rip), %rax
testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
jnz 2f
leaq __memcpy_sse2_unaligned(%rip), %rax
ret
2: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
jz 3f
leaq __memcpy_ssse3(%rip), %rax
3: ret
END(__new_memcpy)
边栏推荐
猜你喜欢
"Review of software engineering in Wuhan University of technology" Chapter 7 | software testing
Lesson 12 MySQL high availability component MHA
数组的简介
文件描述符的复制
2.树莓派系统备份
Simplify the complexity and talk about the abstraction of replication state machine system architecture
SQL设计教学管理库
Fcntl function
批量查分爬虫
腾讯持久化框架MMKV原理探究
随机推荐
力扣解法汇总1252-奇数值单元格的数目
Reentrant function
主动降噪耳机排行榜10强,主动降噪耳机十大品牌
在ubuntu中使用pypyodbc无法连接sql server
Js高级-对象的理解
[标准规范] 低代码的概念和定义到底是什么?无代码是否属于低代码?
力扣解法汇总1108-IP 地址无效化
MySQL修改密码不成功(无效)的解决办法
Visual studio debugging shortcut key
Applet sorted by an element of the structure (fishing_3)
Microsoft SQL Server数据库语言及功能使用(十二)
H5 no scaling on the mobile terminal
文件描述符的复制
Female guest registration
2、 Notes
"Review of software engineering in Wuhan University of technology" Chapter 6 | coding specification
力扣解法汇总515-在每个树行中找最大值
A survey of network defense decision-making methods based on attack defense game
Rocky basic exercise -shell SCRIPT-1
Shell script uses expect automatic interactive login to remote host for batch shutdown