1;   Copyright (C) 2012-2019 Free Software Foundation, Inc.
2;   Contributed by Red Hat.
3;
4; This file is free software; you can redistribute it and/or modify it
5; under the terms of the GNU General Public License as published by the
6; Free Software Foundation; either version 3, or (at your option) any
7; later version.
8;
9; This file is distributed in the hope that it will be useful, but
10; WITHOUT ANY WARRANTY; without even the implied warranty of
11; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12; General Public License for more details.
13;
14; Under Section 7 of GPL version 3, you are granted additional
15; permissions described in the GCC Runtime Library Exception, version
16; 3.1, as published by the Free Software Foundation.
17;
18; You should have received a copy of the GNU General Public License and
19; a copy of the GCC Runtime Library Exception along with this program;
20; see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
21; <http://www.gnu.org/licenses/>.
22
23	.text
24
25/* Logical Left Shift - R12 -> R12 */
26
27	.macro	_slli n
28	.global __mspabi_slli_\n
29__mspabi_slli_\n:
30	ADD.W	R12,R12
31	.endm
32
33	_slli	15
34	_slli	14
35	_slli	13
36	_slli	12
37	_slli	11
38	_slli	10
39	_slli	9
40	_slli	8
41	_slli	7
42	_slli	6
43	_slli	5
44	_slli	4
45	_slli	3
46	_slli	2
47	_slli	1
48#ifdef __MSP430X_LARGE__
49	RETA
50#else
51	RET
52#endif
53
541:	ADD.W	#-1,R13
55	ADD.W	R12,R12
56	.global	__mspabi_slli
57__mspabi_slli:
58	CMP	#0,R13
59	JNZ	1b
60#ifdef __MSP430X_LARGE__
61	RETA
62#else
63	RET
64#endif
65
66/* Logical Left Shift - R12:R13 -> R12:R13 */
67
68	.macro	_slll	n
69	.global	__mspabi_slll_\n
70__mspabi_slll_\n:
71	ADD.W	R12,R12
72	ADDC.W	R13,R13
73	.endm
74
75	_slll	15
76	_slll	14
77	_slll	13
78	_slll	12
79	_slll	11
80	_slll	10
81	_slll	9
82	_slll	8
83	_slll	7
84	_slll	6
85	_slll	5
86	_slll	4
87	_slll	3
88	_slll	2
89	_slll	1
90#ifdef __MSP430X_LARGE__
91	RETA
92#else
93	RET
94#endif
95
961:	ADD.W	#-1,R14
97	ADD.W	R12,R12
98	ADDC.W	R13,R13
99	.global	__mspabi_slll
100__mspabi_slll:
101	CMP	#0,R14
102	JNZ	1b
103#ifdef __MSP430X_LARGE__
104	RETA
105#else
106	RET
107#endif
108
109