[all-commits] [llvm/llvm-project] f8948d: [libclc] Move log/log2/log10 to CLC library (#128540)

Fraser Cormack via All-commits all-commits at lists.llvm.org
Tue Feb 25 03:45:22 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8948d3c4754e06cdd3e2903bfbfe74438f6b463
      https://github.com/llvm/llvm-project/commit/f8948d3c4754e06cdd3e2903bfbfe74438f6b463
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2025-02-25 (Tue, 25 Feb 2025)

  Changed paths:
    M libclc/clc/include/clc/float/definitions.h
    A libclc/clc/include/clc/math/clc_log.h
    A libclc/clc/include/clc/math/clc_log10.h
    A libclc/clc/include/clc/math/clc_log2.h
    M libclc/clc/lib/generic/SOURCES
    A libclc/clc/lib/generic/math/clc_log.cl
    A libclc/clc/lib/generic/math/clc_log10.cl
    A libclc/clc/lib/generic/math/clc_log2.cl
    A libclc/clc/lib/generic/math/clc_log_base.h
    M libclc/generic/include/clc/math/log10.h
    M libclc/generic/lib/math/log.cl
    M libclc/generic/lib/math/log10.cl
    M libclc/generic/lib/math/log2.cl
    R libclc/generic/lib/math/log_base.h

  Log Message:
  -----------
  [libclc] Move log/log2/log10 to CLC library (#128540)

This commit also enables fp16 log, which was previously missing.

Other than that, no changes to codegen for AMDGPU/Nvidia targets.

Note that for simplicity this commit doesn't try to refactor or optimize
the implementations. Notably, each log is only implementated for scalar
types; vector types are scalarized. It doesn't look too difficult to
make the implementations suitable for vector codegen, so I'll try that
in a future commit.

There's also an unused implementation of log in clc_log_base.h, whereas
the implementation currently used by libclc targets re-uses log2 with an
additional multiplication. That should also be cleaned up as on first
inspection it looks a more optimal implementation, though it would have
to be checked against the OpenCL CTS for good measure.



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