==*Logical Operations with immediate value also sign extends the imm - source==

Immediate value

  • 12-bit value represents constant
  • Typically extended into 32 bits or 64 bits before used as an input of ALU

How to make 32-bit constants

lui x19, 0x003D0 
addi x19, x19, 0x500 
  1. Load upper immediate & Sign extend
  2. Add lower 12 bits to the loaded value (12bit left shifted)