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位

相关推荐
JCBP_9 小时前
QT(4)
开发语言·汇编·c++·qt·算法
sheepwjl1 天前
《嵌入式硬件(十二):基于IMX6ULL的时钟操作》
汇编·arm开发·单片机·嵌入式硬件·时钟·.s编译
DebugKitty2 天前
硬件开发2-ARM裸机开发1-I.MX6ULL - 汇编点灯
汇编·makefile·imax6ull·gpio·电路复用
我菜就多练2 天前
ARM-汇编的基础知识
汇编·arm开发
(Charon)2 天前
函数之间跳转的实现方式详解:setjmp/longjmp、ucontext 与汇编
汇编
起个昵称吧3 天前
立即数、栈、汇编与C函数的调用
c语言·开发语言·汇编
mysla4 天前
嵌入式学习day46-硬件—汇编
汇编·学习
zgc12453674 天前
汇编基础2
汇编
出门吃三碗饭5 天前
编译器构造:从零手写汇编与反汇编程序(一)
android·汇编
JCBP_5 天前
QT(3)
开发语言·汇编·c++·qt·算法