-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpreter: Implement floating point conversions #4884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! Some small nits below.
I ran this through the fuzzer and it picked up some issues:
`fcvt_to_uint.i128` traps with `IntegerOverflow`
test interpret
function %a_128(f32) -> i128 {
block0(v0: f32):
v1 = fcvt_to_uint.i128 v0
return v1
}
; run: %a_128(0.0) == 0
The equivalent test for i32
returns 0, so this should too right?
I'm going to let this run for a little bit, but I'll report back if I find anything.
As an aside fcvt_low_from_sint
allows for scalar values, but I think that is probably a mistake, since the docs explicitly state: "The result type will have half the number of vector lanes as the input."
Which doesn't make a lot of sense for scalar values. But that's probably something for a different PR.
Implemented the following opcodes for the interpreter: - `FcvtToUint` - `FcvtToSint` - `FcvtToUintSat` - `FcvtToSintSat` - `FcvtFromUint` - `FcvtFromSint` - `FcvtLowFromSint` - `FvpromoteLow` - `Fvdemote` Copyright (c) 2022 Arm Limited
Copyright (c) 2022 Arm Limited
7d99a4c
to
eb75fda
Compare
Copyright (c) 2022 Arm Limited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for implementing these, @dheaton-arm! And @afonso360, thanks for fuzzing and reviewing!
) * Interpreter: Implement floating point conversions Implemented the following opcodes for the interpreter: - `FcvtToUint` - `FcvtToSint` - `FcvtToUintSat` - `FcvtToSintSat` - `FcvtFromUint` - `FcvtFromSint` - `FcvtLowFromSint` - `FvpromoteLow` - `Fvdemote` Copyright (c) 2022 Arm Limited * Fix `I128` bounds checks for `FcvtTo{U,S}int{_,Sat}` Copyright (c) 2022 Arm Limited * Fix broken test Copyright (c) 2022 Arm Limited
Implemented the following opcodes for the interpreter:
FcvtToUint
FcvtToSint
FcvtToUintSat
FcvtToSintSat
FcvtFromUint
FcvtFromSint
FcvtLowFromSint
FvpromoteLow
Fvdemote
Copyright (c) 2022 Arm Limited