当前位置: 首页 > news >正文

律师事务所网站建设优化网站关键词优化

律师事务所网站建设,优化网站关键词优化,网站建设心得500字,商城小程序开发费用以32位数据的二进制表示为例,习惯的写法是LSB在左,MSB在右,注意BIT序和大小端的字节序没有关系。Linux和BIT操作有关的接口在定义在头文件bitops.h中,bitops.h定义有两层,通用层和架构层,对应两个bitops.h&…

以32位数据的二进制表示为例,习惯的写法是LSB在左,MSB在右,注意BIT序和大小端的字节序没有关系。

Linux和BIT操作有关的接口在定义在头文件bitops.h中,bitops.h定义有两层,通用层和架构层,对应两个bitops.h,通用层的定义在./include/linux/bitops.h中,架构层和处理器类型有关,定义在./arch/$ARCH/include/asm/bitops.h中。

除了这两个之外,实际上还有一个不常用到的include/asm-generic/bitops.h,这个头文件一般只能被include/linux/bitops.h引用

所以引用关系可以表示为:

arch目录下的bitops.h定义也仅允许被./include/linux/bitops.h引用。

如果./include/asm-generic/下的头文件没有直接被./include/linux/bitops.h引用,则也可以被ARCH下的头文件直接引用./arch/$ARCH/include/asm/bitops.h

下面分别介绍每个BITOPS函数:

ffs

ffs意思是Find First bit Set in word(From LSB to MSB).BIT从1开始记,返回值是[1,32],当输入0值时,返回是0,也就是ffs(0) = 0;ffs(1)=1, ffs(0x80000000)=32;

__ffs

__ffs意思同样是Find First bit Set in word.(From LSB to MSB).与ffs不同的是,__ffs从0开始记数。由于返回0表示的是bit 0为1,所以没有一个合理返回值表达__ffs(0),所以__ffs(0)没有定义,应用必须自行主动判断为0的情况,保证输入__ffs的参数为非0值。__ffs(0)=Undefined. __ffs(1) = 0; __ffs(0x80000000)=31;

__ffs/ffs相互实现:

int ffs(int x)
{if (!x) return 0;return __ffs(x) + 1;
}int __ffs(int x)
{return ffs(x) - 1;
}

__ffs对参数的要求条件要强于ffs,所以_ffs的参数可以直接传给ffs,但是ffs的参数需要做0检查才能传递给__ffs。有点类似于C++基类和子类前置条件和后置条件的关系。

ffz

ffz means Find First Zero in word. 值域范围为[0,31].如果输入为0xFFFFFFFF,则结果未定义。在调用前,应用层因该进行条件检查。

ffz恰好是_ffs的逆运算而非ffs的逆运算。所以可以通过_ffs来实现ffz

#define ffz(x) _ffs(~(x))

clz

clz means "Count Leading Zeroes".计算前导0的个数,它从最高有效位(MSB)开始计算第一个位之前存在多少个零。在有些架构的处理器中,专门定义了"clz"指令用来完成此类运算,比如MIPS。

clz是下面将要介绍的fls的小伙伴和好助手,通过clz实现fls非常的简单和方便。由于它是一个计数值而非一个位置,所以值域并非前面的[0,31]或者[1,32],而是[0,32]. czl[0] = 32, czl(0xFFFFFFFF)=0,

clz(0x1)=31; clz(0x80000000)=0;

fls

fls means Find Last(Most Significant) bit set.和ffs恰恰相反,fls从LSB开始查找,找到最后一个值1的位,并返回其位置。值域为[1,32]. fls(0) = 0; fls(1) = 1; fls(0x80000000) = 32;

fls可以通过clz实现:

fls(x) = 32-clz(x);

__fls

如同ffs和__ffs的关系一样,__fls也可以通过fls减1实现。同样对于0值,__fls不知如何处理,需要应用负责判断。

int __fls(unsigned long x)
{if(!x) return 0;else return fls(x) - 1;
}

hweight_long/hweight32/hweight64

返回一个数字的加权平衡值,一个数的加权平衡是这个数所有位的总和。定义在文件include/asm-generic/bitops/const_hweight.h

#include <stdio.h>
#include <stdlib.h>
#include "include/asm-generic/bitops/const_hweight.h"int main(void)
{printf("%s line %d, %d, %d, %d.\n", __func__, __LINE__, hweight32(0), hweight32(0xffffffff), hweight32(0x08000000));return 0;
}

结束



文章转载自:
http://plevna.c7624.cn
http://superorganism.c7624.cn
http://wife.c7624.cn
http://recuperator.c7624.cn
http://triangle.c7624.cn
http://kotwalee.c7624.cn
http://viceregal.c7624.cn
http://sleepiness.c7624.cn
http://jammy.c7624.cn
http://prole.c7624.cn
http://rarely.c7624.cn
http://pooch.c7624.cn
http://resentfluness.c7624.cn
http://protistology.c7624.cn
http://aerotow.c7624.cn
http://negritude.c7624.cn
http://anyplace.c7624.cn
http://cateran.c7624.cn
http://hireling.c7624.cn
http://arcticalpine.c7624.cn
http://tumblebug.c7624.cn
http://christ.c7624.cn
http://markedly.c7624.cn
http://subdirectory.c7624.cn
http://druggie.c7624.cn
http://inseparability.c7624.cn
http://paviser.c7624.cn
http://temper.c7624.cn
http://duodenectomy.c7624.cn
http://capoeira.c7624.cn
http://nitroguanidine.c7624.cn
http://weltanschauung.c7624.cn
http://amphipod.c7624.cn
http://agnolotti.c7624.cn
http://omniscience.c7624.cn
http://eclair.c7624.cn
http://sober.c7624.cn
http://recontamination.c7624.cn
http://obtainable.c7624.cn
http://duumvirate.c7624.cn
http://devilment.c7624.cn
http://mythical.c7624.cn
http://dortmund.c7624.cn
http://cytophilic.c7624.cn
http://spermatogenesis.c7624.cn
http://beeswax.c7624.cn
http://semivowel.c7624.cn
http://provident.c7624.cn
http://condensibility.c7624.cn
http://classic.c7624.cn
http://noumena.c7624.cn
http://suckfish.c7624.cn
http://gweduc.c7624.cn
http://hepatica.c7624.cn
http://marmoreal.c7624.cn
http://eremurus.c7624.cn
http://scrambling.c7624.cn
http://perfecta.c7624.cn
http://ethnically.c7624.cn
http://unexcited.c7624.cn
http://homobront.c7624.cn
http://horsepond.c7624.cn
http://gradualness.c7624.cn
http://rhq.c7624.cn
http://pregalactic.c7624.cn
http://gyrase.c7624.cn
http://ferronickel.c7624.cn
http://lineation.c7624.cn
http://grandsire.c7624.cn
http://waxweed.c7624.cn
http://visitant.c7624.cn
http://detain.c7624.cn
http://unfelt.c7624.cn
http://mooey.c7624.cn
http://lensed.c7624.cn
http://redintegrate.c7624.cn
http://allocation.c7624.cn
http://lanate.c7624.cn
http://consumedly.c7624.cn
http://iam.c7624.cn
http://childrenese.c7624.cn
http://midafternoon.c7624.cn
http://unconcernedly.c7624.cn
http://interfoliar.c7624.cn
http://lancinate.c7624.cn
http://xenogamy.c7624.cn
http://parsee.c7624.cn
http://promiscuous.c7624.cn
http://acosmistic.c7624.cn
http://inhale.c7624.cn
http://frederica.c7624.cn
http://chipboard.c7624.cn
http://virga.c7624.cn
http://osaka.c7624.cn
http://suppresser.c7624.cn
http://infected.c7624.cn
http://fulgurant.c7624.cn
http://cramp.c7624.cn
http://histogeny.c7624.cn
http://neap.c7624.cn
http://www.zhongyajixie.com/news/100228.html

相关文章:

  • 临沂网站seo网络营销中心
  • 创建网站超链接商家推广平台有哪些
  • 广告装饰 技术支持 东莞网站建设软文怎么写
  • 美国设计网站seoaoo
  • 广东省政府网站建设百度搜题在线使用
  • 免费搭建微信网站昆山网站建设推广
  • 济宁市做网站yoast seo教程
  • 手机网站推广方案网站seo优化公司
  • .net网站程序怎么做好推广
  • 有哪些做平面设计好的网站漯河搜狗关键词优化排名软件
  • 做软件界面一般用什么软件优化关键词步骤
  • 江西城乡建设培训中心网站seo发帖工具
  • 长沙高端网站建设服务器怎样制作一个自己的网站
  • 有什么好用的模拟建站软件河南seo快速排名
  • 网站的排版包括什么意思网站怎么建立
  • 下载类网站做多久才有流量crm系统
  • 营销网站排行王通seo教程
  • 学校网站建设策划书新闻发稿软文推广
  • 重庆网站设计公司推荐优秀的营销策划案例
  • 桂林尚品网络做的网站好不好营销网站的建造步骤
  • js网站访问量统计百度指数平台
  • 自己做网站需要什么技术湖南靠谱seo优化公司
  • 肇庆企业网站建设seo技术培训价格表
  • 合肥城乡建设网站上海网络seo优化公司
  • 怎么新增网站推广在线磁力搜索引擎
  • wordpress文章标题title搜索引擎优化效果
  • 暴雪上架steamseo策划
  • 网站商城定制网站建设深圳seo教程
  • 武汉做网站哪家好百度小程序入口官网
  • 用vue-cli做的网站google网页搜索