Sitelet https://github.com/gpuweb/gpuweb/issues/706
Skip to content

Add unordered float compares #706

Description

@dneto0

Part of #667

E.g. see https://llvm.org/docs/LangRef.html#fcmp-instruction

The ordinary comparisons like ==, <, >=, etc. should be the ordered comparisons.
That is, they should yield false if either operand is a NaN.

The unordered operations are corresponding operations, but where the result is true if either operand is a NaN. These are interesting and useful because they make it easy to push inversions through:

 ! ( a < b)     

is the same as

(  a  unordered>= b)

(I think I got that right)

I'd like to have a standard way to express these unordered comparisons. It's fine if they are builtin functions with long names.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions