Cranelift AArch64: Improve the Popcnt implementation

Now the backend uses the CNT instruction, which results into a major
simplification.

Copyright (c) 2021, Arm Limited.
This commit is contained in:
Anton Kirilov
2021-01-11 18:23:03 +00:00
parent c7de8f5efb
commit 043a8434d2
6 changed files with 106 additions and 182 deletions

View File

@@ -331,6 +331,8 @@ pub enum VecMisc2 {
Frintm,
/// Floating point round to integral, rounding towards plus infinity
Frintp,
/// Population count per byte
Cnt,
}
/// A Vector narrowing operation with two registers.
@@ -3752,6 +3754,7 @@ impl Inst {
VecMisc2::Frintz => ("frintz", size),
VecMisc2::Frintm => ("frintm", size),
VecMisc2::Frintp => ("frintp", size),
VecMisc2::Cnt => ("cnt", size),
};
let rd_size = if is_shll { size.widen() } else { size };