clzw
riscv_unified_db)RV32 / RV64 (Ratified & Standard Extensions)
main
userZbbSummary
Counts the number of 0's before the first 1 starting at bit 31 and progressing to bit 0. Accordingly, if the least-significant word is 0, the output is 32, and if the most-significant bit of the word (_i.e._, bit 31) is a 1, the output is 0.
Syntax / Encoding
clzw xd, xs1 | 011000000000xxxxx001xxxxx0011011 (mask=0xfff0707f match=0x6000101b)
Cross-Chip Latency & Throughput (11 cores)
| Microarchitecture | Latency (cycles) | Recip. TP | uops | Ports | Source |
|---|---|---|---|---|---|
| SiFive P670 / P600 | 1 | 0.25 | 1 | SiFiveP600IntArith | llvm_sched_models |
| SiFive P870 / P800 | 1 | 0.25 | 1 | SiFiveP800IntArith | llvm_sched_models |
| SpacemiT X100 | 1 | 0.25 | 1 | SMTX100_IQ | llvm_sched_models |
| SpacemiT X60 (K1) | 1 | 0.5 | 1 | SMX60_IEU | llvm_sched_models |
| Syntacore SCR7 | 1 | 1 | 1 | BMU | llvm_sched_models |
| Tenstorrent Ascalon-X | 1 | 1 | 1 | AscalonFX | llvm_sched_models |
| MIPS P8700 (RISC-V) | 2 | 1 | 1 | p8700IssueAL2 | llvm_sched_models |
| Andes 45-Series | 3 | 0.5 | 1 | Andes45ALU | llvm_sched_models |
| SiFive 7-Series (U74) | 3 | 1 | 1 | PipeB | llvm_sched_models |
| XiangShan KunMingHu | 3 | 0.5 | 1 | XSPipeGroupBKU | llvm_sched_models |
| XiangShan NanHu | 3 | 0.5 | 1 | XS2MDU | llvm_sched_models |
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | RV | 011000000000xxxxx001xxxxx0011011 | 0xfff0707f / 0x6000101b |
Operands
| Name | Description |
|---|---|
xs1 | bits [19:15] |
xd | bits [11:7] |
Reference Notes
Counts the number of 0's before the first 1 starting at bit 31 and progressing to bit 0. Accordingly, if the least-significant word is 0, the output is 32, and if the most-significant bit of the word (_i.e._, bit 31) is a 1, the output is 0.