[all-commits] [llvm/llvm-project] 95c683: [libclc] Move logb/ilogb to CLC library; optimize ...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Tue May 13 03:47:58 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95c683fc1b8cd4f008b3dddaadfa7b5edb1e25e9
      https://github.com/llvm/llvm-project/commit/95c683fc1b8cd4f008b3dddaadfa7b5edb1e25e9
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    A libclc/clc/include/clc/math/clc_ilogb.h
    A libclc/clc/include/clc/math/clc_logb.h
    M libclc/clc/include/clc/math/math.h
    A libclc/clc/include/clc/math/unary_decl_with_int_return.inc
    A libclc/clc/include/clc/math/unary_def_with_int_return.inc
    M libclc/clc/lib/generic/SOURCES
    A libclc/clc/lib/generic/math/clc_ilogb.cl
    A libclc/clc/lib/generic/math/clc_ilogb.inc
    A libclc/clc/lib/generic/math/clc_logb.cl
    A libclc/clc/lib/generic/math/clc_logb.inc
    M libclc/generic/include/clc/math/ilogb.h
    R libclc/generic/include/clc/math/ilogb.inc
    M libclc/generic/lib/math/ilogb.cl
    M libclc/generic/lib/math/logb.cl

  Log Message:
  -----------
  [libclc] Move logb/ilogb to CLC library; optimize (#128028)

This commit moves the logb and ilogb builtins to the CLC library.

It simultaneously optimizes them both for vector types and for half
types. Vector types were being scalarized in some cases. Half types were
previously promoting to float, whereas this commit provides them a
native implementation.

Everything passes the OpenCL-CTS.

I had to intuit some magic numbers used by these implementations in
order to generate the half variants. I gave them clearer definitions
derived from what I believe are their actual component numbers, but
named them 'magic' to convey that they weren't derived from first
principles.



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