afonso360 opened PR #8596 from afonso360:riscv-fma-v3
to bytecodealliance:main
:
This commit reworks our FMA pattern matching to be slightly less verbose. It additionally adds the
(fma x (splat y) z)
pattern for vectors, which can be proven to be equivalent to(splat x)
.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
afonso360 requested fitzgen for a review on PR #8596.
afonso360 requested wasmtime-compiler-reviewers for a review on PR #8596.
afonso360 edited PR #8596:
:wave: Hey,
This PR reworks our FMA pattern matching to be slightly less verbose using the suggestions provided by @jameysharp on https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2103773727.
It additionally adds the
(fma x (splat y) z)
pattern for vectors, which can be proven to be equivalent to(splat x)
. See https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2105622411. I've only added ISA tests for these patterns since it turns out they are already present in the SIMD FMA runtests.I think all of the patterns matched here are sound although I can't formally prove all of them. This comment https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2105622411 describes most of the validations that I did.
afonso360 edited PR #8596:
:wave: Hey,
This PR reworks our FMA pattern matching to be slightly less verbose using the suggestions provided by @jameysharp on https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2103773727.
It additionally adds the
(fma x (splat y) z)
pattern for vectors, which can be proven to be equivalent to(fma (splat x) y z)
. See https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2105622411. I've only added ISA tests for these patterns since it turns out they are already present in the SIMD FMA runtests.I think all of the patterns matched here are sound although I can't formally prove all of them. This comment https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2105622411 describes most of the validations that I did.
afonso360 edited PR #8596:
:wave: Hey,
This PR reworks our FMA pattern matching to be slightly less verbose using the suggestions provided by @jameysharp on https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2103773727.
It additionally adds the
(fma x (splat y) z)
pattern for vectors, which can be proven to be equivalent to(fma y (splat x) z)
. See https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2105622411. I've only added ISA tests for these patterns since it turns out they are already present in the SIMD FMA runtests.I think all of the patterns matched here are sound although I can't formally prove all of them. This comment https://github.com/bytecodealliance/wasmtime/pull/8588#issuecomment-2105622411 describes most of the validations that I did.
afonso360 edited PR #8596.
fitzgen requested jameysharp for a review on PR #8596.
fitzgen commented on PR #8596:
Redirecting to @jameysharp since it seems like he has more context here.
jameysharp submitted PR review:
Fantastic, I love that this worked out, and I really appreciate the effort you put into using Alive2 to check which of my guesses were correct. Too bad about signed zeroes…
By the way, this motivated me to write up #8599, which would make this kind of pattern easier to write someday.
jameysharp submitted PR review:
Fantastic, I love that this worked out, and I really appreciate the effort you put into using Alive2 to check which of my guesses were correct. Too bad about signed zeroes…
By the way, this motivated me to write up #8599, which would make this kind of pattern easier to write someday.
jameysharp created PR review comment:
Interesting, why does this rule need a priority?
afonso360 submitted PR review.
afonso360 created PR review comment:
Oops, it shouldn't. I was debugging some stuff and forgot to remove it.
afonso360 updated PR #8596.
afonso360 has enabled auto merge for PR #8596.
afonso360 merged PR #8596.
Last updated: Dec 23 2024 at 13:07 UTC