diff options
author | Bill Traynor <wmat@riscv.org> | 2023-08-03 11:04:48 -0400 |
---|---|---|
committer | Bill Traynor <wmat@riscv.org> | 2023-08-03 11:04:48 -0400 |
commit | 690902d1f3fd22f273255e1c3dad2d8c7dfaface (patch) | |
tree | 67dd5f902d75b179869f5d9d130840c4b4dcb1ce /src/b-st-ext.adoc | |
parent | 189980465013027ee4441ccacacf6551f9e11bf6 (diff) | |
download | riscv-isa-manual-690902d1f3fd22f273255e1c3dad2d8c7dfaface.zip riscv-isa-manual-690902d1f3fd22f273255e1c3dad2d8c7dfaface.tar.gz riscv-isa-manual-690902d1f3fd22f273255e1c3dad2d8c7dfaface.tar.bz2 |
Adding OR combine to bitmanip chapter.
Adding _OR_combine.adoc to bitmanip chapter.
Diffstat (limited to 'src/b-st-ext.adoc')
-rw-r--r-- | src/b-st-ext.adoc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/b-st-ext.adoc b/src/b-st-ext.adoc index 3d1a04a..99df2b9 100644 --- a/src/b-st-ext.adoc +++ b/src/b-st-ext.adoc @@ -727,3 +727,21 @@ The rotate instructions were included to replace a common four-instruction sequence to achieve the same effect (neg; sll/srl; srl/sll; or) =============================================================== +===== OR Combine + +*orc.b* sets the bits of each byte in the result _rd_ to all zeros if no bit within the respective byte of _rs_ is set, or to all ones if any bit within the respective byte of _rs_ is set. + +One use-case is string-processing functions, such as *strlen* and *strcpy*, which can use *orc.b* to test for the terminating zero byte by counting the set bits in leading non-zero bytes in a word. + +[%header,cols="^1,^1,4,8"] +|=== +|RV32 +|RV64 +|Mnemonic +|Instruction + +|✓ +|✓ +|orc.b _rd_, _rs_ +|<<#insns-orc_b>> +|=== |