Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 866 Bytes

rev.adoc

File metadata and controls

48 lines (39 loc) · 866 Bytes

th.rev

Synopsis

Reverse the byte order.

Mnemonic

th.rev rd, rs1

Encoding
{reg:[
    { bits:  7, name: 0xb, attr: ['custom-0, 32 bit'] },
    { bits:  5, name: 'rd' },
    { bits:  3, name: 0x1, attr: ['Arithmetic'] },
    { bits:  5, name: 'rs1' },
    { bits:  5, name: 0x0 },
    { bits:  2, name: 0x1 },
    { bits:  5, name: 0x10 },
]}
Description

This operation reverses the byte order of the value in rs1 and stores the result in rd.

Operation
for i=0..(xlen/8-1):
  j := xlen/8 - 1 - i
  tmp[i] := reg[rs1][j]
reg[rd] := tmp
Permission

This instruction can be executed in all privilege levels.

Exceptions

This instruction does not trigger any exceptions.

Included in
Extension

XTheadBb ([xtheadbb])