Skip to content

Commit 9068de3

Browse files
committed
opt: add peephole recipe for new normalized boolean
The routine .code.__LEI16 already returns a normalized [0, 1] boolean.
1 parent 8d22b6f commit 9068de3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
;; core.LEI16 returns the bool result of Byte(a) <= Byte(b)
2+
;; and is already normalized. The sequence
3+
;; sub 1
4+
;; sbc a, a
5+
;; inc a
6+
;; can be removed
7+
8+
OLEVEL: 1
9+
OFLAG: 14
10+
11+
REPLACE {{
12+
call .core.__LEI16
13+
sub 1
14+
sbc a, a
15+
inc a
16+
}}
17+
18+
WITH {{
19+
call .core.__LEI16
20+
}}

0 commit comments

Comments
 (0)