[PATCH] D127041: [LLVM] Add the support for fmax and fmin in atomicrmw instruction

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 18:32:05 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/docs/LangRef.rst:10336-10337
 - fsub: ``*ptr = *ptr - val`` (using floating point arithmetic)
+-  fmax: ``*ptr = *ptr > val ? *ptr : val`` (using floating point comparison)
+-  fmin: ``*ptr = *ptr < val ? *ptr : val`` (using floating point comparison)
 
----------------
This is *not* what fmin/fmax do and ignores nan handling, and canonicalization

We plausibly need to have 3 different pairs:
  - The libm behavior for fmin/fmax (which matches the misnamed llvm.minnum/maxnum intrinsics)
  - The IEEE-754 2008 minnum/maxnum behavior which has different signaling nan behavior
  - The IEEE-754 2019 minnum/maxnum behavior which inverts the nan behavior


This absolutely needs to state which one it is if it's just one




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127041/new/

https://reviews.llvm.org/D127041



More information about the llvm-commits mailing list