Skip to content

JIT: Generate v{min/max}ss for a > b ? a : b pattern instead of cmp + jmp #116802

Closed as not planned
@BoyBaykiller

Description

@BoyBaykiller

https://godbolt.org/z/1W83cYox1

float Max(float a, float b)
{
    return a > b ? a : b;
}
Program:Max(float,float):float:this (FullOpts):
-       vucomiss xmm1, xmm2
-       jbe      SHORT G_M57467_IG05
-       vmovaps  xmm0, xmm1
-       ret      
-G_M57467_IG05:  ;; offset=0x000B
-       vmovaps  xmm0, xmm2
+       vmaxss   xmm0, xmm1, xmm2
        ret    

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions