Skip to content

JIT: Potential bad codegen for bit extractions #105466

Closed
@jakobbotsch

Description

@jakobbotsch
// Generated by Fuzzlyn v1.7 on 2024-07-25 11:19:02
// Run on X64 Windows
// Seed: 16543153111255778542-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 144.6 KiB to 0.7 KiB in 00:01:20
// Debug: Outputs 0
// Release: Outputs 1
using System;
using System.Runtime.CompilerServices;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static ulong s_19;
    public static Vector128<long> s_26;
    public static Vector128<sbyte> s_28;
    public static void Main()
    {
        var vr11 = Vector128.Create<long>(1);
        var vr12 = Sse41.X64.Extract(s_26, (byte)Bmi2.X64.ParallelBitExtract(s_19, M27(1, vr11)));
        System.Console.WriteLine(vr12);
    }

    public static byte M27(sbyte arg3, Vector128<long> arg6)
    {
        var vr4 = Vector128.Create<sbyte>(arg3);
        var vr3 = Sse2.Subtract(vr4, s_28);
        return (byte)Sse2.MoveMask(vr3);
    }
}

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