File tree Expand file tree Collapse file tree 3 files changed +46
-19
lines changed
compiler-rt/lib/builtins/riscv Expand file tree Collapse file tree 3 files changed +46
-19
lines changed Original file line number Diff line number Diff line change 1+ //===-- int_mul_impl.inc - Integer multiplication -------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2 .0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+ //
9+ // Helpers used by __mulsi3, __muldi3.
10+ //
11+ //===----------------------------------------------------------------------===//
12+
13+ #if !defined(__riscv_mul)
14+ .text
15+ .align 2
16+
17+ .globl __mulxi3
18+ .type __mulxi3, @function
19+ __mulxi3:
20+ mv a2 , a0
21+ mv a0 , zero
22+ .L1:
23+ andi a3 , a1 , 1
24+ beqz a3 , .L2
25+ add a0 , a0 , a2
26+ .L2:
27+ srli a1 , a1 , 1
28+ slli a2 , a2 , 1
29+ bnez a1 , .L1
30+ ret
31+ #endif
Original file line number Diff line number Diff line change 1+ //===--- muldi3.S - Integer multiplication routines -----------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ //===----------------------------------------------------------------------===//
8+ #if __riscv_xlen == 64
9+ #define __mulxi3 __muldi3
10+ #include "int_mul_impl.inc"
11+ #endif
Original file line number Diff line number Diff line change 1- //===--- mulsi3.S - Integer multiplication routines routines ---===//
1+ //===--- mulsi3.S - Integer multiplication routines -------------------- ---===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77//===----------------------------------------------------------------------===//
88
9- #if !defined(__riscv_mul) && __riscv_xlen == 32
10- .text
11- .align 2
12-
13- .globl __mulsi3
14- .type __mulsi3, @function
15- __mulsi3:
16- mv a2 , a0
17- mv a0 , zero
18- .L1:
19- andi a3 , a1 , 1
20- beqz a3 , .L2
21- add a0 , a0 , a2
22- .L2:
23- srli a1 , a1 , 1
24- slli a2 , a2 , 1
25- bnez a1 , .L1
26- ret
9+ #if __riscv_xlen == 32
10+ #define __mulxi3 __mulsi3
11+ #include "int_mul_impl.inc"
2712#endif
You can’t perform that action at this time.
0 commit comments