ARM base instruction -- bfi

Bitfield Insert copies a bitfield of <width> bits from the least significant bits of the source register to bit position <lsb> of the destination register, leaving the other destination bits unchanged.

位域插入将<width>位的位域从源寄存器的最低有效位复制到目标寄存器的位位置<lsb>,保持其他目标位不变。

32-bit variant

Applies when sf == 0 && N == 0.

BFI <Wd>, <Wn>, #<lsb>, #<width>

is equivalent to

BFM <Wd>, <Wn>, #(-<lsb> MOD 32), #(<width>-1)

and is the preferred disassembly when UInt(imms) < UInt(immr).

64-bit variant

Applies when sf == 1 && N == 1.

BFI <Xd>, <Xn>, #<lsb>, #<width>

is equivalent to

BFM <Xd>, <Xn>, #(-<lsb> MOD 64), #(<width>-1)

and is the preferred disassembly when UInt(imms) < UInt(immr).

4005a0: d2800000 mov x0, #0x0 // #0

4005a4: b94023e1 ldr w1, [sp, #32]

4005a8: b3407c20 bfxil x0, x1, #0, #32

4005ac: b94027e1 ldr w1, [sp, #36]

4005b0: b3607c20 bfi x0, x1, #32, #32 // x0=取x1的高32位

相关推荐
techdashen15 小时前
Rust 1.88 终于稳定了裸函数:写汇编不再需要那堆样板代码
汇编·rust
So_shine2 天前
stm32f103汇编-1:LED点灯
汇编·stm32·单片机·led
北漂Zachary3 天前
四大编程语言终极对决:汇编/C#/Go/Java谁更强
汇编·golang·c#
达帮主4 天前
25.C语言 递归函数
c语言·开发语言·汇编
aq55356006 天前
Laravel2.x:被遗忘的PHP框架遗珠
开发语言·汇编·c#
lhbian6 天前
C# vs 汇编:编程世界的两极对比
开发语言·汇编·c#
zopple6 天前
汇编、C、C++和Java核心技术对比
c语言·汇编·c++
aq55356008 天前
Laravel7.x重磅升级:十大新特性解析
开发语言·汇编·c#·html
aq553560010 天前
三大编程语言深度对比:C# vs 易语言 vs 汇编
开发语言·汇编·c#
aq553560010 天前
编程语言对比:从汇编到PHP的四大层级解析
开发语言·汇编·php