Another one, sorry.
I don't quite understand why the eq implementation for DataValue (and by extension the bitwise_equal method) does not consider signed and unsigned types to ever be able to equal each other. Is there a reason for this?
I'm asking because I'm now getting test results such as
Failed test: run: %usubof_i64(0, 0) == 0, actual: 0
and in my case, where i do an unsigned operation on values, I'm confused whether I should check the data values are signed before I do my operation and then cast the result back to being signed after finishing or not since that seems to affect the test cases.
The IR does not seem to differentiate between signed and unsigned values so I'm unsure why the interpreter seems to be doing that.
Thanks for any help
:wave: Hey,
why the eq implementation for DataValue (and by extension the bitwise_equal method) does not consider signed and unsigned types to ever be able to equal each other. Is there a reason for this?
That seems to be by accident, at least for the bitwise_eq. More recently I've been trying to ensure that we always return signed values from all interpreter operations, and only cast to unsigned on intermediate operations. However it is possible that some other operations do not follow this rule.
The IR does not seem to differentiate between signed and unsigned values so I'm unsure why the interpreter seems to be doing that.
Yeah, having the split between unsigned and signed in the interpreter is something that I'm not really happy with. I've been thinking about changing it so that It's closer to the IR representation of a value.
This sounds like a "good first issue" to me; want to write up a quick issue and label it that way? I know at least one person is looking for more of these to work on in Cranelift.
Sure! I'll open an issue for that
Here it is: https://github.com/bytecodealliance/wasmtime/issues/5398
I'm looking at this issue, I'm wondering whether ToUnsigned
and ToSigned
should also be removed?
Last updated: Nov 22 2024 at 17:03 UTC