* function.c (dump_stack_clash_frame_info): New function.
[official-gcc.git] / libgcc / config / riscv / muldi3.S
blobeb3d9b0df3dfd970d998d7dbad912b2986f07312
1 /* Integer multiplication routines for RISC-V.
3    Copyright (C) 2016-2017 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24 <http://www.gnu.org/licenses/>.  */
26   .text
27   .align 2
29 #if __riscv_xlen == 32
30 /* Our RV64 64-bit routine is equivalent to our RV32 32-bit routine.  */
31 # define __muldi3 __mulsi3
32 #endif
34   .globl __muldi3
35 __muldi3:
36   mv     a2, a0
37   li     a0, 0
38 .L1:
39   andi   a3, a1, 1
40   beqz   a3, .L2
41   add    a0, a0, a2
42 .L2:
43   srli   a1, a1, 1
44   slli   a2, a2, 1
45   bnez   a1, .L1
46   ret