Cranelift(Aarch64): Optimize lowering of icmps with immediates (#5252)
We can encode more constants into 12-bit immediates if we do the following
rewrite for comparisons with odd constants:
A >= B + 1
==> A - 1 >= B
==> A > B
This commit is contained in:
@@ -137,6 +137,9 @@
|
||||
(decl u64_nonzero (u64) u64)
|
||||
(extractor (u64_nonzero x) (and (u64_is_zero $false) x))
|
||||
|
||||
(decl pure u64_is_odd (u64) bool)
|
||||
(extern constructor u64_is_odd u64_is_odd)
|
||||
|
||||
;;;; `cranelift_codegen::ir::Type` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(extern const $I8 Type)
|
||||
|
||||
Reference in New Issue
Block a user