Encoding:

MSA

011110

0001111110

cs

rd

ELM

011001

6

10

5

5

6

Format:

CFCMSA 

GPR Copy from MSA Control Register

CFCMSA rd,cs

MSA

GPR Copy from MSA Control Register

Purpose:

GPR Copy from MSA Control Register

GPR value copied from MSA control register.

Description:

rd = signed(cs)

The sign extended content of MSA control register cs is copied to GPR rd.

Restrictions:

The read operation returns ZERO if cs specifies a reserved register or a register that does not exist.

Operation:

if cs = 0 then
   GPR[rd] = sign_extend(MSAIR, 64)
elseif cs = 1 then
   GPR[rd] = sign_extend(MSACSR, 64)
elseif MSAIRWRP = 1 then
   if cs = 2 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAAccess, 64)
   elseif cs = 3 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSASave, 64)
   elseif cs = 4 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAModify, 64)
   elseif cs = 5 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSARequest, 64)
   elseif cs = 6 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAMap, 64)
   elseif cs = 7 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAUnmap, 64)
   else
      GPR[rd] = 0
   endif
else
   GPR[rd] = 0
endif

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception. Coprocessor 0 Unusable Exception.