ARM base instruction -- cls

Count Leading Sign bits counts the number of leading bits of the source register that have the same value as the most significant bit of the register, and writes the result to the destination register. This count does not include the most significant bit of the source register.

计数前导符号位对源寄存器中与寄存器最高有效位具有相同值的前导位数进行计数,并将结果写入目标寄存器。此计数不包括源寄存器的最高有效位。

32-bit variant

Applies when sf == 0.

CLS <Wd>, <Wn>

64-bit variant

Applies when sf == 1.

CLS <Xd>, <Xn>

Decode for all variants of this encoding

integer d = UInt(Rd);

integer n = UInt(Rn);

integer datasize = if sf == '1' then 64 else 32;

Operation

integer result;

bits(datasize) operand1 = X[n];

result = CountLeadingSignBits(operand1);

X[d] = result<datasize-1:0>;

integer CountLeadingSignBits(bits(N) x)

return CountLeadingZeroBits(x<N-1:1> EOR x<N-2:0>);

integer CountLeadingZeroBits(bits(N) x)

return N - (HighestSetBit(x) + 1);

integer HighestSetBit(bits(N) x)

for i = N-1 downto 0

if x<i> == '1' then return i;

return -1;

相关推荐
资料,小偿15 小时前
4.29.3五种波形发生器8086波形发生器,锯齿波脉冲波正弦波三角波直流信号含调试视频➕18页5000字原创报告软件流程图proteus8.9近期原创的,
汇编·proteus
T.Ree.19 小时前
汇编_读写内存
开发语言·汇编·c#
量子炒饭大师2 天前
【一天一个计算机知识】—— 【编程百度】翻译环境与运行环境
c语言·汇编·c++·gitee·机器翻译
资料,小偿3 天前
4.98基于8086倒车测距8086测距ACD0809proteus8.9仿真,汇编语言源程序
汇编·proteus
万象.4 天前
GNU汇编语法和Cortex-A7常用汇编指令
服务器·汇编·gnu
资料,小偿4 天前
4.95基于8086流水灯霓虹彩灯控制器,8086彩灯控制器proteus8.9仿真文件+源码功能四个开关对应四种模式。
汇编·proteus
YeGop5 天前
51单片机定时器函数分享(8051汇编)
汇编·嵌入式硬件·51单片机
YeGop5 天前
51单片机汇编实现DHT11读取温湿度
汇编·嵌入式硬件·51单片机
资料,小偿5 天前
8086汇编语言定制,8086仿真proteus8086定制,emu8086汇编语言
汇编
花阴偷移6 天前
逆向基础--汇编基础(段的分类) (07)
汇编