]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/builtins/riscv/mulsi3.S
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / builtins / riscv / mulsi3.S
1 //===--- mulsi3.S - Integer multiplication routines routines ---===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #if !defined(__riscv_mul) && __riscv_xlen == 32
11         .text
12         .align 2
13
14         .globl __mulsi3
15         .type  __mulsi3, @function
16 __mulsi3:
17         mv     a2, a0
18         mv     a0, zero
19 .L1:
20         andi   a3, a1, 1
21         beqz   a3, .L2
22         add    a0, a0, a2
23 .L2:
24         srli   a1, a1, 1
25         slli   a2, a2, 1
26         bnez   a1, .L1
27         ret
28 #endif