What's the meaning of W suffix for thumb-2 instruction?

前端 未结 3 984
盖世英雄少女心
盖世英雄少女心 2021-01-20 20:12

There is a w suffix for thumb-2 instruction as below, how does it change the semantic of the instruction without it? The search result is very noisy and I didn\'t get the an

3条回答
  •  时光说笑
    2021-01-20 21:16

    Simply enough, W means "wide". It is the 32-bit version of the instruction, whereas most Thumb instructions are 16 bits wide. The wide instructions often have bigger immediates or can address more registers.

    Edit: Some of the comments seem confused about the difference between addw and add.w. The only essential difference is how the immediate is encoded.

    add.w:  imm32 = ThumbExpandImm(i:imm3:imm8);
    addw:   imm32 = ZeroExtend(i:imm3:imm8, 32);
    

提交回复
热议问题