Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AlignVector128.cs « Sse2 « X86 « HardwareIntrinsics « JIT « tests « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5ebe1d151f06b184902e09975900de0fe17a80dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//

using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using Xunit;

namespace IntelHardwareIntrinsicTest.SSE2;

partial class Program
{
    [Fact]
    public static void AlignVector128()
    {
        s_f = default; // avoid helper in Foo below
        Console.WriteLine(Foo(default, default));
    }

    private static Vector128<int> s_f;
    // The JIT was picking a simple rsp-based frame for this function and then
    // believed the second vector is 16-byte aligned when it is not.
    [MethodImpl(MethodImplOptions.NoInlining)]
    private static long Foo(S24 a, Vector128<int> looksAligned)
    {
        s_f = looksAligned;
        return 0;
    }

    private struct S24
    {
        public long A, B, C;
    }
}