Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 975 Bytes

tstnbz.adoc

File metadata and controls

51 lines (42 loc) · 975 Bytes

th.tstnbz

Synopsis

Test for NUL bytes.

Mnemonic

th.tstnbz rd, rs1

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

Tests each byte in register rs1 for equality with 0. If a byte is 0, then the corresponding byte in register rd will be set to 0xff. Otherwise, the corresponding byte in register rd will be set to 0.

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

This instruction can be executed in all privilege levels.

Exceptions

This instruction does not trigger any exceptions.

Included in
Extension

XTheadBb ([xtheadbb])