[all-commits] [llvm/llvm-project] c8eb86: [libclc] Move mad to the CLC library (#123607)

Fraser Cormack via All-commits all-commits at lists.llvm.org
Mon Jan 20 08:28:13 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8eb865747ea0006470a0ab130056293fcb536cb
      https://github.com/llvm/llvm-project/commit/c8eb865747ea0006470a0ab130056293fcb536cb
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M libclc/clc/include/clc/clcmacro.h
    A libclc/clc/include/clc/math/clc_mad.h
    A libclc/clc/include/clc/math/ternary_decl.inc
    M libclc/clc/lib/clspv/SOURCES
    M libclc/clc/lib/generic/SOURCES
    A libclc/clc/lib/generic/math/clc_mad.cl
    A libclc/clc/lib/generic/math/clc_mad.inc
    M libclc/clc/lib/spirv/SOURCES
    M libclc/clc/lib/spirv64/SOURCES
    R libclc/generic/include/clc/math/ternary_decl.inc
    M libclc/generic/lib/common/mix.cl
    M libclc/generic/lib/common/mix.inc
    M libclc/generic/lib/math/clc_exp10.cl
    M libclc/generic/lib/math/clc_hypot.cl
    M libclc/generic/lib/math/clc_pow.cl
    M libclc/generic/lib/math/clc_pown.cl
    M libclc/generic/lib/math/clc_powr.cl
    M libclc/generic/lib/math/clc_rootn.cl
    M libclc/generic/lib/math/mad.cl
    R libclc/generic/lib/math/mad.inc
    M libclc/generic/lib/math/sincos_helpers.cl
    M libclc/generic/lib/math/sincospiF_piby4.h

  Log Message:
  -----------
  [libclc] Move mad to the CLC library (#123607)

All targets build `__clc_mad` -- even SPIR-V targets -- since it
compiles to the optimal `llvm.fmuladd` intrinsic. There is no change to
the bytecode generated for non-SPIR-V targets.

The `mix` builtin, which is implemented as a wrapper around `mad`, is
left as an OpenCL-layer wrapper of `__clc_mad`. I don't know if it's
worth having a specific CLC version of `mix`.

The changes to the other CLC files/functions are moving uses of `mad` to
`__clc_mad`, and reformatting. There is an additional instance of
`trunc` becoming `__clc_trunc`, which was missed before.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list