BFE : Bit Field Extract

Format:

SPA 5.0:
        {@{!}Pg}   BFE{.fmt}{.BREV}   Rd{.CC},Ra,Sb   {&req_6}   {?sched}   ;   

 .fmt:      {.U32,.S32*}
            Zero extend (U32) or sign extend (S32) extracted field into destination register 

 .BREV      Bit reverse all the bits in Ra before the shift operation

 .CC:       Write condition codes

BFE allows the following source Sb:
    Sb(register)
    Sb(constant with immediate address)
    Sb(#IMM20)

Description:

Bit Field Extract. Extract and zero/sign extend a bit field from Ra.

Sb contains:

   bits[07:00]: start position of bit field to be extracted
   bits[15:08]: size of bit field to be extracted

Special cases (in priority order):

  1. If extract field size is 0, 0 is returned
  2. If signed & extract field MSB exceeds Ra size, Ra[31:31] is used for the sign bit for extension
  3. If signed & extract start position is 32+, replicated sign bit is returned (0x0000_0000 or 0xffff_ffff)

Examples:

BFE R0,R1,R2;

Back to Index of Instructions