Skip to content

JIT: float.{Min/Max}Native generates cmp + jump instead of v{min/max}ss #116803

Closed
@BoyBaykiller

Description

@BoyBaykiller

https://godbolt.org/z/17Gea6cjM

float Max(float a, float b)
{
    return float.MaxNative(a, b);
}
Program:Max(float,float):float:this (FullOpts):
-       vucomiss xmm1, xmm2
-       jbe      SHORT G_M57467_IG04
-       jmp      SHORT G_M57467_IG05
-G_M57467_IG04:  ;; offset=0x0008
-       vmovaps  xmm1, xmm2
-G_M57467_IG05:  ;; offset=0x000C
-       vmovaps  xmm0, xmm1
+       vmaxss   xmm0, xmm1, xmm2
       ret      

Related: #116802

@TechPizzaDev
@tannergooding

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

Relationships

None yet

Development

No branches or pull requests

Issue actions