[libc-commits] [PATCH] D152923: [libc] Add support for FMA in the GPU utilities

Matt Arsenault via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jun 14 09:44:22 PDT 2023


arsenm added a comment.

In D152923#4421674 <https://reviews.llvm.org/D152923#4421674>, @lntue wrote:

> I would assume that the fma instructions on GPU will be more performant than normal multiply + add.  Do you want to let generic math functions use fma's for GPUs?
>
> https://github.com/llvm/llvm-project/blob/main/libc/src/__support/macros/properties/cpu_features.h#L39
> https://github.com/llvm/llvm-project/blob/main/libc/src/__support/FPUtil/multiply_add.h#L30

This is trying to resolve the problem the fmuladd intrinsic solves. The target macros should be dropped and you should simply implement multiply_add with FP_CONTRACT on and let the backend decide


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152923



More information about the libc-commits mailing list