add reminder by a power of two peephole rule
This commit is contained in:
@@ -191,3 +191,8 @@
|
||||
(=> (when (udiv_imm $C $x)
|
||||
(is-power-of-two $C))
|
||||
(ushr_imm $(log2 $C) $x))
|
||||
|
||||
;; Reminder by a power of two -> bitwise and with decreased by one constant.
|
||||
(=> (when (urem_imm $C $x)
|
||||
(is-power-of-two $C))
|
||||
(band_imm $(iadd -1 $C) $x))
|
||||
Binary file not shown.
Reference in New Issue
Block a user