This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Improve Math(F).FusedMultiplyAdd codegen#27060
Merged
sandreenko merged 23 commits intodotnet:masterfrom Nov 6, 2019
Merged
Conversation
Member
Author
|
This PR doesn't improve: float t = MathF.FusedMultiplyAdd(x, y, y);It's expected to be vfmadd213ss xmm0 xmm1 xmm1but it emits a redundant mov: vmovaps xmm2, xmm1
vfmadd213ss xmm0, xmm2, xmm1The goal was to make this func: static float Lerp(float v0, float v1, float t) =>
MathF.FusedMultiplyAdd(t, v1, MathF.FusedMultiplyAdd(-t, v0, v0));to have a perfect codegen |
EgorBo
commented
Oct 7, 2019
|
PTAL @dotnet/jit-contrib |
EgorBo
commented
Oct 11, 2019
sandreenko
approved these changes
Oct 25, 2019
sandreenko
left a comment
There was a problem hiding this comment.
LGTM, nice improvement, thank you.
|
Could you please add your test cases to https://github.com/dotnet/coreclr/tree/master/tests/src/JIT/HardwareIntrinsics/X86? |
mikedn
reviewed
Oct 25, 2019
mikedn
reviewed
Oct 25, 2019
sandreenko
reviewed
Oct 25, 2019
tannergooding
approved these changes
Nov 4, 2019
sandreenko
reviewed
Nov 4, 2019
|
/azp run coreclr-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
sandreenko
approved these changes
Nov 5, 2019
sandreenko
left a comment
There was a problem hiding this comment.
LGTM, ADO shows no failures (1 queued job is a github glitch, it has passed already), so I am going to merge that soon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/dotnet/coreclr/issues/25829 (currently
Math(F).FusedMultiplyAddalways emitsvfmadd213ss\dandxors if there are negations)Test cases:
Was:
Now:
Diff.
/cc @tannergooding