Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  linux/arch/arm/lib/muldi3.S
0004  *
0005  *  Author:     Nicolas Pitre
0006  *  Created:    Oct 19, 2005
0007  *  Copyright:  Monta Vista Software, Inc.
0008  */
0009 
0010 #include <linux/linkage.h>
0011 #include <asm/assembler.h>
0012 
0013 #ifdef __ARMEB__
0014 #define xh r0
0015 #define xl r1
0016 #define yh r2
0017 #define yl r3
0018 #else
0019 #define xl r0
0020 #define xh r1
0021 #define yl r2
0022 #define yh r3
0023 #endif
0024 
0025 ENTRY(__muldi3)
0026 ENTRY(__aeabi_lmul)
0027 
0028     mul xh, yl, xh
0029     mla xh, xl, yh, xh
0030     mov ip, xl, lsr #16
0031     mov yh, yl, lsr #16
0032     bic xl, xl, ip, lsl #16
0033     bic yl, yl, yh, lsl #16
0034     mla xh, yh, ip, xh
0035     mul yh, xl, yh
0036     mul xl, yl, xl
0037     mul ip, yl, ip
0038     adds    xl, xl, yh, lsl #16
0039     adc xh, xh, yh, lsr #16
0040     adds    xl, xl, ip, lsl #16
0041     adc xh, xh, ip, lsr #16
0042     ret lr
0043 
0044 ENDPROC(__muldi3)
0045 ENDPROC(__aeabi_lmul)