diff options
author | YenHaoChen <howard25336284@gmail.com> | 2022-10-20 16:02:12 +0800 |
---|---|---|
committer | Andrew Waterman <aswaterman@gmail.com> | 2022-10-20 01:27:41 -0700 |
commit | e8340aedc84cc9daee1f66e718a4b4a887cb8749 (patch) | |
tree | 6d021fbd8aeecbd2d4ba7b470258f025537c3b67 /riscv/processor.h | |
parent | 2e12d7251e00778c50552d53dd0d61edb990ab3b (diff) | |
download | riscv-isa-sim-e8340aedc84cc9daee1f66e718a4b4a887cb8749.zip riscv-isa-sim-e8340aedc84cc9daee1f66e718a4b4a887cb8749.tar.gz riscv-isa-sim-e8340aedc84cc9daee1f66e718a4b4a887cb8749.tar.bz2 |
move fucntion cto() from processor.h to arith.h
Only triggers.cc uses the arithmetic function cto(). Instead of putting
the cto() in processor.h, putting it in arith.h with other arithmetic
functions, e.g., ctz() and clz(), makes more sense.
Diffstat (limited to 'riscv/processor.h')
-rw-r--r-- | riscv/processor.h | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/riscv/processor.h b/riscv/processor.h index 7d5552b..95043ea 100644 --- a/riscv/processor.h +++ b/riscv/processor.h @@ -219,15 +219,6 @@ struct state_t #endif }; -// Count number of contiguous 1 bits starting from the LSB. -static inline int cto(reg_t val) -{ - int res = 0; - while ((val & 1) == 1) - val >>= 1, res++; - return res; -} - // this class represents one processor in a RISC-V machine. class processor_t : public abstract_device_t { |