Stream: git-wasmtime

Topic: wasmtime / PR #5252 Cranelift(Aarch64): Optimize lowering...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2022 at 23:58):

fitzgen opened PR #5252 from optimize-comparisons-with-immediates-on-aarch64 to main:

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

(And similar for less-than-or-equals.)

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2022 at 23:58):

fitzgen requested elliottt for a review on PR #5252.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2022 at 23:59):

fitzgen created PR review comment:

I'm not sure why these changed here, but also I think it is benign since movz is zero-extending the value?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2022 at 23:59):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2022 at 00:46):

elliottt submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 16:36):

fitzgen updated PR #5252 from optimize-comparisons-with-immediates-on-aarch64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:17):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:17):

jameysharp created PR review comment:

Why is make_imm12_from_u64 separate from imm12_from_u64? They look identical to me.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:18):

fitzgen created PR review comment:

One is a pure constructor and the other is a fallible extractor. They are identical but can't replace one another in ISLE's type system.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:18):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:18):

fitzgen merged PR #5252.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:19):

elliottt created PR review comment:

Couldn't it be an infallible extractor? Then there'd be no Option in the return type, and the same rust function could be reused for the extractor and constructor in isle.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:19):

elliottt submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:20):

elliottt created PR review comment:

Scratch that -- I just realized that we're relying on the failure behavior in the extractor case :)

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:20):

elliottt submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:21):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:21):

fitzgen created PR review comment:

It can't be infallible because not all u64s can be represented with Imm12s

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:21):

fitzgen edited PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:29):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 15 2022 at 17:29):

jameysharp created PR review comment:

Ah, I see. But then you could have used the extractor instead of a constructor, right?

(if-let (imm12_from_u64 imm) (u64_sub b 1))


Last updated: Dec 23 2024 at 12:05 UTC