[all-commits] [llvm/llvm-project] d12a8d: [libclc] Move min/max/clamp into the CLC builtins ...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Thu Oct 31 09:45:59 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d12a8da1de1ce2c7d8fbf84306a2b6de5c85d707
      https://github.com/llvm/llvm-project/commit/d12a8da1de1ce2c7d8fbf84306a2b6de5c85d707
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2024-10-31 (Thu, 31 Oct 2024)

  Changed paths:
    M libclc/CMakeLists.txt
    M libclc/clc/include/clc/clcfunc.h
    A libclc/clc/include/clc/integer/gentype.inc
    A libclc/clc/include/clc/math/gentype.inc
    A libclc/clc/include/clc/shared/clc_clamp.h
    A libclc/clc/include/clc/shared/clc_clamp.inc
    A libclc/clc/include/clc/shared/clc_max.h
    A libclc/clc/include/clc/shared/clc_max.inc
    A libclc/clc/include/clc/shared/clc_min.h
    A libclc/clc/include/clc/shared/clc_min.inc
    M libclc/clc/lib/generic/SOURCES
    A libclc/clc/lib/generic/shared/clc_clamp.cl
    A libclc/clc/lib/generic/shared/clc_clamp.inc
    A libclc/clc/lib/generic/shared/clc_max.cl
    A libclc/clc/lib/generic/shared/clc_max.inc
    A libclc/clc/lib/generic/shared/clc_min.cl
    A libclc/clc/lib/generic/shared/clc_min.inc
    R libclc/generic/include/clc/integer/gentype.inc
    R libclc/generic/include/clc/math/gentype.inc
    M libclc/generic/include/config.h
    M libclc/generic/lib/common/smoothstep.cl
    M libclc/generic/lib/common/step.cl
    M libclc/generic/lib/math/clc_hypot.cl
    M libclc/generic/lib/math/clc_ldexp.cl
    M libclc/generic/lib/math/math.h
    M libclc/generic/lib/shared/clamp.cl
    M libclc/generic/lib/shared/clamp.inc
    M libclc/generic/lib/shared/max.cl
    M libclc/generic/lib/shared/max.inc
    M libclc/generic/lib/shared/min.cl
    M libclc/generic/lib/shared/min.inc

  Log Message:
  -----------
  [libclc] Move min/max/clamp into the CLC builtins library (#114386)

These functions are "shared" between integer and floating-point types,
hence the directory name. They are used in several CLC internal
functions such as __clc_ldexp.

Note that clspv and spirv targets don't want to define these functions,
so pre-processor macros replace calls to __clc_min with regular min, for
example. This means they can use as much of the generic CLC source files
as possible, but where CLC functions would usually call out to an
external __clc_min symbol, they call out to an external min symbol. Then
they opt out of defining __clc_min itself in their CLC builtins library.

Preprocessor definitions for these targets have also been changed
somewhat: what used to be CLC_SPIRV (the 32-bit target) is now
CLC_SPIRV32, and CLC_SPIRV now represents either CLC_SPIRV32 or
CLC_SPIRV64. Same goes for CLC_CLSPV.

There are no differences (measured with llvm-diff) in any of the final
builtins libraries for nvptx, amdgpu, or clspv. Neither are there
differences in the SPIR-V targets' LLVM IR before it's actually lowered
to SPIR-V.



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