Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

fix Matrix4x4 + and - operator bugs - #39838

Merged
danmoseley merged 2 commits into
dotnet:masterfrom
saucecontrol:matrix4x4fix
Jul 29, 2019
Merged

fix Matrix4x4 + and - operator bugs#39838
danmoseley merged 2 commits into
dotnet:masterfrom
saucecontrol:matrix4x4fix

Conversation

@saucecontrol

Copy link
Copy Markdown
Member

The new SSE versions of the operators add/subtract value1 to/from itself. The tests were set up with the same value for both arguments, so they didn't catch the issue. Fixed both.

@danmoseley

Copy link
Copy Markdown

@tannergooding

@stephentoub stephentoub added this to the 3.0 milestone Jul 29, 2019
@stephentoub

Copy link
Copy Markdown
Member

This is a big functional regression, introduced in #31779 for 3.0 (cc: @EgorBo). This needs to be fixed for 3.0.

Example:

using System;
using System.Numerics;

class Program
{
    static void Main()
    {
        var m0 = new Matrix4x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        var m1 = new Matrix4x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
        Console.WriteLine(m0 + m1);
    }
}

On netcoreapp2.1:

{ {M11:1 M12:1 M13:1 M14:1} {M21:1 M22:1 M23:1 M24:1} {M31:1 M32:1 M33:1 M34:1} {M41:1 M42:1 M43:1 M44:1} }

On netcoreapp3.0:

{ {M11:0 M12:0 M13:0 M14:0} {M21:0 M22:0 M23:0 M24:0} {M31:0 M32:0 M33:0 M34:0} {M41:0 M42:0 M43:0 M44:0} }

@danmoseley
danmoseley requested a review from tannergooding July 29, 2019 15:54
@danmoseley
danmoseley merged commit b5e9310 into dotnet:master Jul 29, 2019
@tannergooding

Copy link
Copy Markdown
Member

@danmosemsft, do you want me to backport to release/3.0?

@danmoseley

Copy link
Copy Markdown

Yes, it sounds like it deserves it. Please include the usual tempalte in the PR https://gist.github.com/danmosemsft/348cbe83ccd7ae0e87c5598223be1380 and tag ask-mode.

@karelz

karelz commented Aug 3, 2019

Copy link
Copy Markdown
Member

This PR went into master - fixing milestone to 5.0.
It will be ported into release/3.0 branch in PR #39889.

wtgodbe pushed a commit that referenced this pull request Aug 7, 2019
* fix Matrix4x4 + and - operator bugs

* fix Add() and Subtract() tests
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* fix Matrix4x4 + and - operator bugs

* fix Add() and Subtract() tests


Commit migrated from dotnet/corefx@b5e9310
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants