function multi-versioning in GCC
https://lwn.net/Articles/691932/
https://gcc.gnu.org/wiki/FunctionMultiVersioning
why multi-versioning
This aim of this project is to make it really easy for the developer to specify multiple versions of a function, each catered to a specific target ISA feature. GCC then takes care of creating the dispatching code necessary to execute the right function version.
how this is implemented
When the front-end sees a call (pointer) to a function version, it generates a new dispatcher function decl and replaces the existing call (pointer) to be a call (pointer) to the dispatcher function. The body of the dispatcher function is later generated when building the call graph. The dispatcher function has the logic to determine the right function version at runtime. At run-time, calling the function version, either directly or indirectly, will invoke the dispatcher logic which will execute the right function version.
dispatcher function body
- at runtime, use CPU check built-ins to check CPU capability;
- IFUNC mechanism so the look up is only needed once.
IFUNC mechanism reuses existing support from compiler/linker as well as the dynamic linker at runtime. Although we can create a custom version of such indirection, like a function pointer initialized at runtime by checking CPU capabilities.
function multi-versioning in GCC的更多相关文章
- GCC的编译和安装 很好的资料
http://blog.csdn.net/yrj/article/details/492404 1.GCC的编译和安装2.预处理 #define 可以支持不定数量的参数. 例子如下: ...
- DiscuzX /source/function/function_core.php通用核心函数库文件分析
... <?php /** * [Discuz!] (C)2001-2099 Comsenz Inc. * This is NOT a freeware, use is subject to l ...
- C++ Standards Support in GCC - GCC 对 C++ 标准的支持
C++ Standards Support in GCC - 2019-2-20 GCC supports different dialects of C++, corresponding to th ...
- gcc __attribute__关键字举例之visibility【转】
转自:https://blog.csdn.net/starstarstone/article/details/7493144?utm_source=tuicool&utm_medium=ref ...
- GCC生成动态库
main.c #include <stdio.h> void hello(void); int main(int argc, char ** argv) { printf("Th ...
- GCC提供的几个內建函数
参考 https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Other-Builtins.html#Other-Builtins https://en.wikipe ...
- 〖C语言〗C语言一个函数传递无限制多参数(不确定参数函数)的方法
/* * ===================================================================================== * * Filen ...
- kbuild-(directory)
-INDEX - this file: info on the kernel build process kbuild.txt - developer information on kbuild kc ...
- 玩转JavaScript OOP[4]——实现继承的12种套路
概述 在之前的文章中,我们借助构造函数实现了"类",然后结合原型对象实现了"继承",并了解了JavaScript中原型链的概念. 理解这些内容,有助于我们更深入 ...
- Laravel 数据库读写分离
config/database.php ... 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localho ...
随机推荐
- CentOS6.5安装MySQL5.6 过程记录
刚开始,还不太懂,直接上了MySQL5.7版本的二进制安装,结果遇到了各种问题,从5.6到5.7还是做了很大改变的,比如mysql_install_db的文件位置变更到了/bin文件下等等,觉得现在用 ...
- 性能测试--Jmeter录制、回放
Jmeter录制.回放 在jmeter2.1版本之前,jmeter应该是不支持录制和回放功能的,那时候如果需要录制jmeter的性能测试脚本的话,就需要使用第三方工具——badboy.现在jmeter ...
- 2017-2018-1 20179209《Linux内核原理与分析》第四周作业
本周学习内容为<跟踪分析MenuOS简单linux系统的启动过程>和教材中的进程调度及内核数据结构. 一.跟踪分析Linux内核的启动过程 这个实验我是在实验楼环境中完成的,最初想在自己的 ...
- 【题解】 AT2134 Zigzag MST
[题解]AT2134 Zigzag MST 一道MST好题 \(Anson\)有云: 要么是减少边的数量. 要么是改变连接边的方式. 那么如何减少边的数量呢?很简单,把所有不可能对答案产生贡献的边去掉 ...
- 模拟登陆,selenium,线程池
一 . 模拟登陆案例(识别验证码) 1 . 打码平台 - 云打码 : www.yundama.com 使用步骤 : - 注册两个账户,普通用户和开发者用户 : - 登陆 普通用户查看余额 登陆开发 ...
- CodeForces - 540D Bad Luck Island —— 求概率
题目链接:https://vjudge.net/contest/226823#problem/D The Bad Luck Island is inhabited by three kinds of ...
- 【LeetCode】种花问题
假设你有一个很长的花坛,一部分地块种植了花,另一部分却没有.可是,花卉不能种植在相邻的地块上,它们会争夺水源,两者都会死去. 给定一个花坛(表示为一个数组包含0和1,其中0表示没种植花,1表示种植了花 ...
- NET LOCALGROUP命令详解(将用户添加到管理员组等)
NET LOCALGROUP [groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"tex ...
- CSS3实现3D木块旋转动画
CSS3实现3D木块旋转动画,css3特效,旋转动画,3D,立体效果,CSS3实现3D木块旋转动画是一款迷人的HTML5+CSS3实现的3D旋转动画. 代码下载:http://www.huiyi8.c ...
- BZOJ 1638 [Usaco2007 Mar]Cow Traffic 奶牛交通:记忆化搜索【图中边的经过次数】
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1638 题意: 给你一个有向图,n个点,m条有向边. 对于所有从入度为0的点到n的路径,找出 ...