[all-commits] [llvm/llvm-project] 58f6b1: [compiler-rt][builtins][RISCV] Always include __mu...

Luís Marques via All-commits all-commits at lists.llvm.org
Wed Oct 21 01:50:01 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 58f6b16c4981f91c49f6878ac342562a7a29d385
      https://github.com/llvm/llvm-project/commit/58f6b16c4981f91c49f6878ac342562a7a29d385
  Author: Luís Marques <luismarques at lowrisc.org>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M compiler-rt/lib/builtins/riscv/int_mul_impl.inc
    M compiler-rt/test/builtins/Unit/muldi3_test.c
    A compiler-rt/test/builtins/Unit/mulsi3_test.c
    R compiler-rt/test/builtins/Unit/riscv/mulsi3_test.c

  Log Message:
  -----------
  [compiler-rt][builtins][RISCV] Always include __mul[sd]i3 builtin definitions

The RISC-V implementations of the `__mulsi3`, `__muldi3` builtins were
conditionally compiling the actual function definitions depending on whether
the M extension was present or not. This caused Compiler-RT testing failures
for RISC-V targets with the M extension, as when these sources were included
the `librt_has_mul*i3` features were still being defined. These `librt_has_*`
definitions are used to conditionally run the respective tests. Since the
actual functions were not being compiled-in, the generic test for `__muldi3`
would fail. This patch makes these implementations follow the normal
Compiler-RT convention of always including the definition, and conditionally
running the respective tests by using the lit conditional
`REQUIRES: librt_has_*`.

Since the `mulsi3_test.c` wasn't actually RISC-V-specific, this patch also
moves it out of the `riscv` directory. It now only depends on
`librt_has_mulsi3` to run.

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




More information about the All-commits mailing list