Encoding:

MSA

011110

011

df/m

ws

wd

BIT

001010

6

3

7

5

5

6

Format:

SRLRI.df 

Immediate Shift Right Logical Rounded

SRLRI.B wd,ws,m

MSA

Immediate Shift Right Logical Rounded

SRLRI.H wd,ws,m

MSA

Immediate Shift Right Logical Rounded

SRLRI.W wd,ws,m

MSA

Immediate Shift Right Logical Rounded

SRLRI.D wd,ws,m

MSA

Immediate Shift Right Logical Rounded

Purpose:

Immediate Shift Right Logical Rounded

Immediate bit count shift right logical with rounding

Description:

wd[i] = ws[i] >>(rounded) m

The elements in vector ws are shifted right logical by m bits. The most significant discarded bit is added to the shifted value (for rounding) and the result is written to vector wd.

The operands and results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRLRI.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = srlr(WR[ws]8i+7..8i, m, 8)
   endfor
SRLRI.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = srlr(WR[ws]16i+15..16i, m, 16)
   endfor
SRLRI.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = srlr(WR[ws]32i+31..32i, m, 32)
   endfor
SRLRI.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = srlr(WR[ws]64i+63..64i, m, 64)
   endfor
function srlr(ts, n, b)
   if n = 0 then
      return ts
   else
      return (0n || tsb-1..n) + tsn-1
   endif
endfunction srlr

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.