What does “extend immediate to 32 bits” mean in MIPS?

后端 未结 2 1771
半阙折子戏
半阙折子戏 2020-12-12 06:14

I\'m reading about the Instruction Decode (ID) phase in the MIPS datapath, and I\'ve got the following quote: \"Once operands are known, read the actual data (from registers

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 06:42

    On a 32-bit CPU, most of the operations you do (like adding, subtracting, dereferencing a pointer) are done with 32-bit numbers. When you have a number with fewer bits, you need to somehow decide what those other bits are going to be when you want to use that number in one of those operations. The act of deciding what those new high bits are is called "extending".

    Assuming you are just doing a standard zero extension or sign extension, extending is very cheap. However, it does require some circuitry, so it makes sense that a description of the MIPS datapath would mention it.

提交回复
热议问题