Stream: git-wasmtime

Topic: wasmtime / issue #6958 Cranelift: Use `Uimm64` for `Unary...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2023 at 21:53):

timjrd edited issue #6958:

Feature

Use Uimm64 for UnaryImm::imm instead of Imm64, since UnaryImm::imm is now always encoding an unsigned integer; following #6850 & #3059.

Benefit

Make it clear that UnaryImm::imm must be interpreted as an unsigned integer; or that it should be reinterpreted as a signed integer if necessary, taking into account the actual bit-length of the encoded value. For example, since #6850, the immediate of iconst.i32 -2 is encoded in UnaryImm::imm as 0xffff_fffe, and not -2, despite being stored in a signed 64-bit integer.

Implementation

Change the type, listen to the complaints of the compiler, and address tests breakage.

I would like to try to address this issue, if it's suitable for a compiler beginner with limited time resource.

Alternatives

Keep using Imm64 since the verifier is already rejecting incorrect encodings.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2023 at 22:05):

timjrd commented on issue #6958:

:wave: might be of interest for @bjorn3 and @jameysharp

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2023 at 08:50):

timjrd edited issue #6958:

Feature

Use Uimm64 for UnaryImm::imm instead of Imm64, since UnaryImm::imm is now always encoding an unsigned integer; following #6850 & #3059.

Benefit

Make it clear that UnaryImm::imm must be interpreted as an unsigned integer; or that it should be reinterpreted as a signed integer, taking into account the actual bit-length of the encoded value. For example, since #6850, the immediate of iconst.i32 -2 is encoded in UnaryImm::imm as 0xffff_fffe, and not -2, despite being stored in a signed 64-bit integer.

Implementation

Change the type, listen to the complaints of the compiler, and address tests breakage.

I would like to try to address this issue, if it's suitable for a compiler beginner with limited time resource.

Alternatives

Keep using Imm64 since the verifier is already rejecting incorrect encodings.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2023 at 08:57):

timjrd edited issue #6958:

Feature

Use Uimm64 for UnaryImm::imm instead of Imm64, since UnaryImm::imm is now always encoding an unsigned integer; following #6850 & #3059.

Benefit

Make it clear that UnaryImm::imm must be interpreted as an unsigned integer; or that it should be reinterpreted as a signed integer, taking into account the actual bit-length of the encoded value. For example, since #6850, the immediate of iconst.i32 -2 is encoded in UnaryImm::imm as 0xffff_fffe, and not -2, despite being stored in a signed 64-bit integer.

Implementation

Change the type, listen to the complaints of the type checker, and address tests breakage.

I would like to try to address this issue, if it's suitable for a compiler beginner with limited time resource.

Alternatives

Keep using Imm64 since the verifier is already rejecting incorrect encodings.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2023 at 09:08):

timjrd edited issue #6958:

Feature

Use Uimm64 for UnaryImm::imm instead of Imm64, since UnaryImm::imm is now always encoding an unsigned integer; following #6850 & #3059.

Benefit

Make it clear that UnaryImm::imm must be interpreted as an unsigned integer; or that it should be reinterpreted as a signed integer with respect to the actual bit-length of the encoded value. For example, since #6850, the immediate of iconst.i32 -2 is encoded in UnaryImm::imm as 0xffff_fffe, and not -2, despite being stored in a signed 64-bit integer.

Implementation

Change the type, listen to the complaints of the type checker, and address tests breakage.

I would like to try to address this issue, if it's suitable for a compiler beginner with limited time resource.

Alternatives

Keep using Imm64 since the verifier is already rejecting incorrect encodings.


Last updated: Dec 23 2024 at 13:07 UTC