riscv / riscv-bitmanip

Working draft of the proposed RISC-V Bitmanipulation extension
https://jira.riscv.org/browse/RVG-122
Creative Commons Attribution 4.0 International
204 stars 66 forks source link

strlen: Replace PTRLOG with explicit 3 #182

Closed jones-drew closed 6 months ago

jones-drew commented 1 year ago

The shift immediate should be 3, even for rv32, since we want log(bits-per-byte), not log(bytes-per-word). PTRLOG implies log(bytes-per-word), so replace it with an explicit 3 as is used elsewhere in the example when log(bits-per-byte) is needed.