Stream: git-wasmtime

Topic: wasmtime / PR #6186 Clarify `instructions.rs` documentati...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2023 at 19:35):

avanhatt opened PR #6186 from avanhatt:docs_shift_masking to bytecodealliance:main:

The documentation strings for Clif operations in instructions.rs for ushr/ashr use language that I suspect is stale: masking to size of the register. Update to match the doc string for ishl, which species masking to the size of x (which better describes what is done for i8/i16).

For example, here the amount is masked based on i8, yielding 0:

function %f(i8) -> i8 {
block0(v0: i8):
    v1 = iconst.i8 8
    v2 = ushr v0, v1
    return v2
}

; run: %f(0xFF) == 0xFF

This is a documentation-only change.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2023 at 19:35):

avanhatt requested jameysharp for a review on PR #6186.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2023 at 19:35):

avanhatt requested wasmtime-compiler-reviewers for a review on PR #6186.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2023 at 19:36):

avanhatt edited PR #6186:

The documentation strings for Clif operations in instructions.rs for ushr/sshr use language that I suspect is stale: masking to size of the register. Update to match the doc string for ishl, which species masking to the size of x (which better describes what is done for i8/i16).

For example, here the amount is masked based on i8, yielding 0:

function %f(i8) -> i8 {
block0(v0: i8):
    v1 = iconst.i8 8
    v2 = ushr v0, v1
    return v2
}

; run: %f(0xFF) == 0xFF

This is a documentation-only change.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2023 at 20:01):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2023 at 22:30):

cfallin merged PR #6186.


Last updated: Oct 23 2024 at 20:03 UTC