Repository: dotnet/runtime
File: src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs (C#)

Code before:
                //   | m n o |
                //
                // Cost of operation
                // 17 adds and 28 muls.
                //
                // add: 6 + 8 + 3 = 17
                // mul: 12 + 16 = 28

                if (Sse.IsSupported)
                {
                    Vector128<float> w = W.AsVector128();
                    Vector128<float> x = X.AsVector128();
                    Vector128<float> y = Y.AsVector128();
                    Vector128<float> z = Z.AsVector128();

                    Vector128<float> z_kjji = Sse.Shuffle(z, z, 0b00010110);
                    Vector128<float> z_iiij = Sse.Shuffle(z, z, 0b01000000);
                    Vector128<float> w_ppop = Sse.Shuffle(w, w, 0b11101111);
                    Vector128<float> w_onpo = Sse.Shuffle(w, w, 0b10110110);
                    Vector128<float> z_llkl = Sse.Shuffle(z, z, 0b11101111);
                    Vector128<float> z_kjlk = Sse.Shuffle(z, z, 0b10110110);
                    Vector128<float> w_onnm = Sse.Shuffle(w, w, 0b00010110);
                    Vector128<float> w_mmmn = Sse.Shuffle(w, w, 0b01000000);
                    Vector128<float> y_feee = Sse.Shuffle(y, y, 0b00000001);
                    Vector128<float> y_ggff = Sse.Shuffle(y, y, 0b01011010);
                    Vector128<float> y_hhhg = Sse.Shuffle(y, y, 0b10111111);

                    // tmp1[0] = kp_lo
                    // tmp1[1] = jp_ln
                    // tmp1[2] = jo_kn
                    // tmp1[3] = ip_lm
                    Vector128<float> tmp1 = z_kjji * w_ppop - z_llkl * w_onnm;

                    // tmp2[0] = io_km
                    // tmp2[1] = in_jm
                    // tmp2[2] = ip_lm
                    // tmp2[3] = jo_kn
                    Vector128<float> tmp2 = z_iiij * w_onpo - z_kjlk * w_mmmn;

                    // tmp3[0] = kp_lo
                    // tmp3[1] = kp_lo
                    // tmp3[2] = jp_ln
                    // tmp3[3] = jo_kn
                    Vector128<float> tmp3 = Sse.Shuffle(tmp1, tmp1, 0b10010000);

                    // tmp4[0] = jp_ln
                    // tmp4[1] = ip_lm
                    // tmp4[2] = ip_lm
                    // tmp4[3] = io_km
                    Vector128<float> tmp4 = Sse.Shuffle(tmp1, tmp2, 0b00101101);


Review comment (suggestion):
nit: All of these could use `Vector128.Shuffle` instead and it can be a fully xplat implementation. This notably also allows it to implicitly lightup and use things like `Avx.Permute` or other alternative instructions where feasible.
```suggestion
                    Vector128<float> z_kjji = Vector128.Create.Shuffle(z, Vector128.Create(2, 1, 1, 0));
                    Vector128<float> z_iiij = Vector128.Create.Shuffle(z, Vector128.Create(0, 0, 0, 1));
                    Vector128<float> w_ppop = Vector128.Create.Shuffle(w, Vector128.Create(3, 3, 2, 3));
                    Vector128<float> w_onpo = Vector128.Create.Shuffle(w, Vector128.Create(2, 1, 3, 2));
                    Vector128<float> z_llkl = Vector128.Create.Shuffle(z, Vector128.Create(3, 3, 2, 3));
                    Vector128<float> z_kjlk = Vector128.Create.Shuffle(z, Vector128.Create(2, 1, 3, 2));
                    Vector128<float> w_onnm = Vector128.Create.Shuffle(w, Vector128.Create(2, 1, 1, 0));
                    Vector128<float> w_mmmn = Vector128.Create.Shuffle(w, Vector128.Create(0, 0, 0, 1));
                    Vector128<float> y_feee = Vector128.Create.Shuffle(y, Vector128.Create(1, 0, 0, 0));
                    Vector128<float> y_ggff = Vector128.Create.Shuffle(y, Vector128.Create(2, 2, 1, 1));
                    Vector128<float> y_hhhg = Vector128.Create.Shuffle(y, Vector128.Create(3, 3, 3, 2));
```

Code after:
                //   | m n o |
                //
                // Cost of operation
                // 17 adds and 28 muls.
                //
                // add: 6 + 8 + 3 = 17
                // mul: 12 + 16 = 28

                if (Vector128.IsHardwareAccelerated)
                {
                    Vector128<float> w = W.AsVector128();
                    Vector128<float> x = X.AsVector128();
                    Vector128<float> y = Y.AsVector128();
                    Vector128<float> z = Z.AsVector128();

                    Vector128<float> z_kjji = Vector128.Shuffle(z, Vector128.Create(2, 1, 1, 0));
                    Vector128<float> z_iiij = Vector128.Shuffle(z, Vector128.Create(0, 0, 0, 1));
                    Vector128<float> w_ppop = Vector128.Shuffle(w, Vector128.Create(3, 3, 2, 3));
                    Vector128<float> w_onpo = Vector128.Shuffle(w, Vector128.Create(2, 1, 3, 2));
                    Vector128<float> z_llkl = Vector128.Shuffle(z, Vector128.Create(3, 3, 2, 3));
                    Vector128<float> z_kjlk = Vector128.Shuffle(z, Vector128.Create(2, 1, 3, 2));
                    Vector128<float> w_onnm = Vector128.Shuffle(w, Vector128.Create(2, 1, 1, 0));
                    Vector128<float> w_mmmn = Vector128.Shuffle(w, Vector128.Create(0, 0, 0, 1));
                    Vector128<float> y_feee = Vector128.Shuffle(y, Vector128.Create(1, 0, 0, 0));
                    Vector128<float> y_ggff = Vector128.Shuffle(y, Vector128.Create(2, 2, 1, 1));
                    Vector128<float> y_hhhg = Vector128.Shuffle(y, Vector128.Create(3, 3, 3, 2));

                    // tmp1[0] = kp_lo
                    // tmp1[1] = jp_ln
                    // tmp1[2] = jo_kn
                    // tmp1[3] = ip_lm
                    Vector128<float> tmp1 = z_kjji * w_ppop - z_llkl * w_onnm;

                    // tmp2[0] = io_km
                    // tmp2[1] = in_jm
                    // tmp2[2] = ip_lm
                    // tmp2[3] = jo_kn
                    Vector128<float> tmp2 = z_iiij * w_onpo - z_kjlk * w_mmmn;

                    // tmp3[0] = kp_lo
                    // tmp3[1] = kp_lo
                    // tmp3[2] = jp_ln
                    // tmp3[3] = jo_kn
                    Vector128<float> tmp3 = Vector128.Shuffle(tmp1, Vector128.Create(0, 0, 1, 2));

                    // tmp4[0] = jp_ln
                    // tmp4[1] = ip_lm
                    // tmp4[2] = ip_lm
                    // tmp4[3] = io_km
                    Vector128<float> tmp4;
                    if (Sse.IsSupported)