Skip to content

[Fuzzlyn] Incorrect T1 behavior around division #116125

Closed

Description

@tannergooding
// Generated by Fuzzlyn v3.1 on 2025-05-29 20:01:16
// Run on X64 Windows
// Seed: 14412340127944514498-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86avx512bw,x86avx512bwvl,x86avx512cd,x86avx512cdvl,x86avx512dq,x86avx512dqvl,x86avx512f,x86avx512fvl,x86avx512fx64,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 53.8 KiB to 0.7 KiB in 00:02:59
// Debug: Prints 1 line(s)
// Release: Prints 0 line(s)
using System;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class C0
{
    public ushort F0;
}

public struct S0
{
    public Vector256<int> F0;
}

public class C1
{
    public C0 F0;
    public C1(C0 f0)
    {
        F0 = f0;
    }
}

public class Program
{
    public static void Main()
    {
        var vr1 = new C1(new C0());
        M3(vr1);
    }

    public static void M3(C1 argThis)
    {
        if (0 >= (Bmi2.X64.ZeroHighBits(0, 0) / ((0UL & argThis.F0.F0) | 1)))
        {
            S0[] var1 = new S0[]
            {
                new S0()
            };
            System.Console.WriteLine(var1[0].F0);
        }
    }
}

Activity

  1. added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on May 30, 2025
  2. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    and removed
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on May 30, 2025
  3. added this to the 10.0.0 milestone on May 30, 2025
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on May 30, 2025
  5. dotnet-policy-service commented on May 30, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  6. self-assigned this
    on May 30, 2025
  7. EgorBo commented on May 30, 2025

    @EgorBo
    Member

    Doesn't look to be Bmi2 specific, reproduces on:

    public static void Main()
    {
        ushort y = 0;
        Test(0, ref y);
    }
    
    [MethodImpl(MethodImplOptions.NoInlining)]
    public static void Test(ulong x, ref ushort y)
    {
        if (0 >= x / ((0UL & y) | 1))
            Console.WriteLine("always taken");
    }
  8. changed the title [-][Fuzzlyn] Incorrect T1 behavior around Bmi2.X64.ZeroHighBits and division[/-] [+][Fuzzlyn] Incorrect T1 behavior around division[/+] on May 31, 2025
  9. locked and limited conversation to collaborators on Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions