Skip to content

JIT: Wrong constant folding with -0.0f/-0.0d #105627

Closed
@jakobbotsch

Description

@jakobbotsch
// Run on Arm64 Linux
// Seed: 10489942769529190437-vectort,vector64,vector128,armadvsimd,armadvsimdarm64,armaes,armarmbase,armarmbasearm64,armcrc32,armcrc32arm64,armdp,armrdm,armrdmarm64,armsha1,armsha256
// Reduced from 58.9 KiB to 0.4 KiB in 00:00:28
// Debug: Outputs [9223372036854775808, 9223372036854775808]
// Release: Outputs [0, 0]
using System;
using System.Runtime.CompilerServices;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;

public class Program
{
    public static Vector128<double> s_9;
    public static void Main()
    {
        var vr1 = Vector128.CreateScalar(0d);
        s_9 = AdvSimd.Arm64.Negate(vr1);
        System.Console.WriteLine(s_9.AsUInt64());
    }
}

(DOTNET_TieredCompilation=1 is not enough to repro the debug result, it needs DOTNET_JITMinOpts=1 in this case)

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