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位

相关推荐
fengye2071611 天前
板凳----------(枯藤 )vs2026+win10(第六章-4)
汇编
-曾牛1 天前
【汇编语言入门】从第一个加法程序吃透汇编核心基础
汇编·单片机·嵌入式硬件·汇编语言·病毒分析·lcx·逆向开发
切糕师学AI1 天前
ARM 汇编指令:ROR(循环右移)
汇编·arm开发
切糕师学AI1 天前
ARM 汇编指令:LSL(逻辑左移) 和 LSR(逻辑右移)
汇编·arm开发
草莓熊Lotso2 天前
Python 库使用全攻略:从标准库到第三方库(附实战案例)
运维·服务器·汇编·人工智能·经验分享·git·python
山峰哥3 天前
SQL优化中的索引策略与Explain分析实战
大数据·汇编·数据库·sql·编辑器
山峰哥4 天前
SQL调优实战指南:从索引设计到高并发场景优化全链路解析
大数据·汇编·数据库·sql·编辑器·区块链
fengye2071615 天前
板凳----------(枯藤 )vs2026+win10(第六章-2)
汇编
2501_918126916 天前
用Python开发一个三进制程序开发工具
开发语言·汇编·python·个人开发
黎雁·泠崖6 天前
Java底层探秘进阶:JIT汇编逐行拆解!Java方法栈帧与C语言深度对标
java·c语言·汇编