Stream: git-wasmtime

Topic: wasmtime / PR #6095 [WIP] ISLE: rewrite `and`/`or` of `icmp`


view this post on Zulip Wasmtime GitHub notifications bot (Mar 23 2023 at 19:39):

Kmeakin opened PR #6095 from icmp-and-or to main:

Adds ISLE rewrites for logical combinations of icmp

(band ty (icmp ty cc1 x y) (icmp ty cc2 x y)):
| band | eq | ne | ult | ule | ugt | uge | slt | sle | sgt | sge |
| ---- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| eq | eq | false | false | eq | false | eq | false | eq | false | eq |
| ne | false | ne | ult | ult | ugt | ugt | slt | slt | sgt | sgt |
| ult | false | ult | ult | ult | false | false | N/A | N/A | N/A | N/A |
| ule | eq | ult | ult | ule | false | eq | N/A | N/A | N/A | N/A |
| ugt | false | ugt | false | false | ugt | ugt | N/A | N/A | N/A | N/A |
| uge | eq | uge | false | eq | ugt | uge | N/A | N/A | N/A | N/A |
| slt | false | slt | N/A | N/A | N/A | N/A | slt | slt | false | false |
| sle | eq | slt | N/A | N/A | N/A | N/A | slt | sle | false | eq |
| sgt | false | sgt | N/A | N/A | N/A | N/A | false | false | sgt | sgt |
| sge | eq | sgt | N/A | N/A | N/A | N/A | false | eq | sgt | sge |

(bor ty (icmp ty cc1 x y) (icmp ty cc2 x y)):
| bor | eq | ne | ult | ule | ugt | uge | slt | sle | sgt | sge |
| --- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| eq | eq | true | ule | ule | uge | uge | sle | sle | sge | sge |
| ne | true | ne | ne | true | ne | true | ne | true | ne | true |
| ult | ule | ne | ult | ule | ne | true | N/A | N/A | N/A | N/A |
| ule | ule | true | ule | ule | true | true | N/A | N/A | N/A | N/A |
| ugt | uge | ne | ne | true | ugt | uge | N/A | N/A | N/A | N/A |
| uge | uge | true | true | true | uge | uge | N/A | N/A | N/A | N/A |
| slt | sle | ne | N/A | N/A | N/A | N/A | slt | sle | ne | true |
| sle | sle | true | N/A | N/A | N/A | N/A | sle | sle | true | true |
| sgt | sge | ne | N/A | N/A | N/A | N/A | ne | true | sgt | sge |
| sge | sge | true | N/A | N/A | N/A | N/A | true | true | sge | sge |

view this post on Zulip Wasmtime GitHub notifications bot (Mar 23 2023 at 19:40):

Kmeakin edited PR #6095 from icmp-and-or to main:

Adds ISLE rewrites for logical combinations of icmp

(band ty (icmp ty cc1 x y) (icmp ty cc2 x y)):
| band | eq | ne | ult | ule | ugt | uge | slt | sle | sgt | sge |
| ---- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| eq | eq | false | false | eq | false | eq | false | eq | false | eq |
| ne | false | ne | ult | ult | ugt | ugt | slt | slt | sgt | sgt |
| ult | false | ult | ult | ult | false | false | N/A | N/A | N/A | N/A |
| ule | eq | ult | ult | ule | false | eq | N/A | N/A | N/A | N/A |
| ugt | false | ugt | false | false | ugt | ugt | N/A | N/A | N/A | N/A |
| uge | eq | uge | false | eq | ugt | uge | N/A | N/A | N/A | N/A |
| slt | false | slt | N/A | N/A | N/A | N/A | slt | slt | false | false |
| sle | eq | slt | N/A | N/A | N/A | N/A | slt | sle | false | eq |
| sgt | false | sgt | N/A | N/A | N/A | N/A | false | false | sgt | sgt |
| sge | eq | sgt | N/A | N/A | N/A | N/A | false | eq | sgt | sge |

(bor ty (icmp ty cc1 x y) (icmp ty cc2 x y)):
| bor | eq | ne | ult | ule | ugt | uge | slt | sle | sgt | sge |
| --- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| eq | eq | true | ule | ule | uge | uge | sle | sle | sge | sge |
| ne | true | ne | ne | true | ne | true | ne | true | ne | true |
| ult | ule | ne | ult | ule | ne | true | N/A | N/A | N/A | N/A |
| ule | ule | true | ule | ule | true | true | N/A | N/A | N/A | N/A |
| ugt | uge | ne | ne | true | ugt | uge | N/A | N/A | N/A | N/A |
| uge | uge | true | true | true | uge | uge | N/A | N/A | N/A | N/A |
| slt | sle | ne | N/A | N/A | N/A | N/A | slt | sle | ne | true |
| sle | sle | true | N/A | N/A | N/A | N/A | sle | sle | true | true |
| sgt | sge | ne | N/A | N/A | N/A | N/A | ne | true | sgt | sge |
| sge | sge | true | N/A | N/A | N/A | N/A | true | true | sge | sge |

Typing out all these rules by hand is a lot of effort. Could or-patterns help?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 23 2023 at 20:21):

Kmeakin updated PR #6095 from icmp-and-or to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 23 2023 at 20:21):

Kmeakin has marked PR #6095 as ready for review.


Last updated: Dec 23 2024 at 13:07 UTC