riscv64: Improve ctz/clz/cls codegen (#5854)
* cranelift: Add extra runtests for `clz`/`ctz` * riscv64: Restrict lowering rules for `ctz`/`clz` * cranelift: Add `u64` isle helpers * riscv64: Improve `ctz` codegen * riscv64: Improve `clz` codegen * riscv64: Improve `cls` codegen * riscv64: Improve `clz.i128` codegen Instead of checking if we have 64 zeros in the top half. Check if it *is* 0, that way we avoid loading the `64` constant. * riscv64: Improve `ctz.i128` codegen Instead of checking if we have 64 zeros in the bottom half. Check if it *is* 0, that way we avoid loading the `64` constant. * riscv64: Use extended value in `lower_cls` * riscv64: Use pattern matches on `bseti`
This commit is contained in:
@@ -38,6 +38,11 @@ macro_rules! isle_common_prelude_methods {
|
||||
x as u64
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn u64_as_i32(&mut self, x: u64) -> i32 {
|
||||
x as i32
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn i64_neg(&mut self, x: i64) -> i64 {
|
||||
x.wrapping_neg()
|
||||
|
||||
Reference in New Issue
Block a user