[all-commits] [llvm/llvm-project] f6e11a: [ARM][AArch64] Implement __cls, __clsl and __clsl...

Victor Campos via All-commits all-commits at lists.llvm.org
Mon Oct 28 04:07:03 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f6e11a36c49c065cd71e9c54e4fba917da5bbf2e
      https://github.com/llvm/llvm-project/commit/f6e11a36c49c065cd71e9c54e4fba917da5bbf2e
  Author: vhscampos <Victor.Campos at arm.com>
  Date:   2019-10-28 (Mon, 28 Oct 2019)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsAArch64.def
    M clang/include/clang/Basic/BuiltinsARM.def
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Headers/arm_acle.h
    M clang/test/CodeGen/arm_acle.c
    M clang/test/CodeGen/builtins-arm.c
    M clang/test/CodeGen/builtins-arm64.c
    M llvm/include/llvm/IR/IntrinsicsAArch64.td
    M llvm/include/llvm/IR/IntrinsicsARM.td
    M llvm/lib/Target/AArch64/AArch64InstrInfo.td
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    A llvm/test/CodeGen/AArch64/cls.ll
    A llvm/test/CodeGen/ARM/cls.ll

  Log Message:
  -----------
  [ARM][AArch64] Implement __cls,  __clsl and __clsll intrinsics from ACLE

Summary:
Writing support for three ACLE functions:
  unsigned int __cls(uint32_t x)
  unsigned int __clsl(unsigned long x)
  unsigned int __clsll(uint64_t x)

CLS stands for "Count number of leading sign bits".

In AArch64, these two intrinsics can be translated into the 'cls'
instruction directly. In AArch32, on the other hand, this functionality
is achieved by implementing it in terms of clz (count number of leading
zeros).

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69250




More information about the All-commits mailing list