Skip to content

Incorrect llvm.minimum/llvm.maximum to fmin/fmax ExtInst mapping wrt NaN handling #3282

@svenvh

Description

@svenvh

In SPIRVWriter.cpp, it's incorrect to map minimum to OpenCLLIB::Fmin due to differences in NaN behaviour:

llvm.minimum:

If either operand is a NaN, returns NaN.

fmin:

If one operand is a NaN, fmin returns the other argument. If both arguments are NaNs, fmin returns a NaN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions