aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config/avr/t-avr
blob: 3bc07186d3b55caf7ff39c2082139b2055e77d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
LIB1ASMSRC = avr/lib1funcs.S
LIB1ASMFUNCS = \
	_mulqi3 \
	_mulhi3 \
	_mulqihi3 _umulqihi3 \
	_mulpsi3 _mulsqipsi3 \
	_mulhisi3 \
	_umulhisi3 \
	_usmulhisi3 \
	_muluhisi3 \
	_mulshisi3 \
	_mulsi3 \
	_udivmodqi4 \
	_divmodqi4 \
	_udivmodhi4 \
	_divmodhi4 \
	_divmodpsi4 _udivmodpsi4 \
	_udivmodsi4 \
	_divmodsi4 \
	_divdi3 _udivdi3 \
	_muldi3 \
	_udivmod64 \
	_negsi2 _negdi2 \
	_prologue \
	_epilogue \
	_exit \
	_cleanup \
	_tablejump \
	_tablejump_elpm \
	_load_3 _load_4 \
	_xload_1 _xload_2 _xload_3 _xload_4 \
	_movmemx \
	_copy_data \
	_clear_bss \
	_ctors \
	_dtors \
	_ffssi2 \
	_ffshi2 \
	_loop_ffsqi2 \
	_ctzsi2 \
	_ctzhi2 \
	_clzdi2 \
	_clzsi2 \
	_clzhi2 \
	_paritydi2 \
	_paritysi2 \
	_parityhi2 \
	_popcounthi2 \
	_popcountsi2 \
	_popcountdi2 \
	_popcountqi2 \
	_bswapsi2 \
	_bswapdi2 \
	_ashldi3 _ashrdi3 _lshrdi3 _rotldi3 \
	_adddi3 _adddi3_s8 _subdi3 \
	_cmpdi2 _cmpdi2_s8 \
	_fmul _fmuls _fmulsu

# Fixed point routines in avr/lib1funcs-fixed.S
LIB1ASMFUNCS += \
	_fractqqsf _fractuqqsf \
	_fracthqsf _fractuhqsf _fracthasf _fractuhasf \
	_fractsasf _fractusasf _fractsqsf _fractusqsf \
	\
	_fractsfqq _fractsfuqq \
	_fractsfhq _fractsfuhq _fractsfha _fractsfuha \
	_fractsfsq _fractsfusq _fractsfsa _fractsfusa \
	_mulqq3 \
	_mulhq3 _muluhq3 \
	_mulha3 _muluha3 _muluha3_round \
	_mulsa3 _mulusa3 \
	_divqq3 _udivuqq3 _divqq_helper \
	_divhq3 _udivuhq3 \
	_divha3 _udivuha3 \
	_divsa3 _udivusa3 \
	_clr_8 \
	_ssneg_2 _ssneg_4 _ssneg_8 \
	_ssabs_2 _ssabs_4 _ssabs_8 \
	_ssadd_8 _sssub_8 \
	_usadd_8 _ussub_8

LIB2FUNCS_EXCLUDE = \
	_moddi3 _umoddi3 \
	_clz

# We do not have the DF type.
# Most of the C functions in libgcc2 use almost all registers,
# so use -mcall-prologues for smaller code size.
HOST_LIBGCC2_CFLAGS += -DDF=SF -Dinhibit_libc -mcall-prologues -Os

# Extra 16-bit integer functions.
intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2

hiintfuncs16 = $(subst XX,hi,$(intfuncs16))
siintfuncs16 = $(subst XX,si,$(intfuncs16))

iter-items := $(hiintfuncs16)
iter-labels := $(siintfuncs16)
iter-sizes := $(patsubst %,2,$(siintfuncs16)) $(patsubst %,2,$(hiintfuncs16))


include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
libgcc-objects += $(patsubst %,%$(objext),$(hiintfuncs16))

ifeq ($(enable_shared),yes)
libgcc-s-objects += $(patsubst %,%_s$(objext),$(hiintfuncs16))
endif


# Filter out supported conversions from fixed-bit.c
# Also filter out TQ and UTQ.

conv_XY=$(conv)$(mode1)$(mode2)
func_X=$(func)$(mode)

# Conversions supported by the compiler

convf_modes =	 QI UQI QQ UQQ \
		 HI UHI HQ UHQ HA UHA \
		 SI USI SQ USQ SA USA \
		 DI UDI DQ UDQ DA UDA \
		 TI UTI TQ UTQ TA UTA

LIB2FUNCS_EXCLUDE += \
	$(foreach conv,_fract _fractuns,\
	$(foreach mode1,$(convf_modes),\
	$(foreach mode2,$(convf_modes),$(conv_XY))))

# Conversions supported by lib1funcs-fixed.S

conv_to_sf_modes   = QQ UQQ HQ UHQ HA UHA SQ USQ SA USA
conv_from_sf_modes = QQ UQQ HQ UHQ HA UHA        SA USA

LIB2FUNCS_EXCLUDE += \
	$(foreach conv,_fract, \
	$(foreach mode1,$(conv_to_sf_modes), \
	$(foreach mode2,SF,$(conv_XY))))

LIB2FUNCS_EXCLUDE += \
	$(foreach conv,_fract,\
	$(foreach mode1,SF,\
	$(foreach mode2,$(conv_from_sf_modes),$(conv_XY))))

# Arithmetik supported by the compiler

allfix_modes = QQ UQQ HQ UHQ HA UHA SQ USQ SA USA DA UDA DQ UDQ TQ UTQ TA UTA

LIB2FUNCS_EXCLUDE += \
	$(foreach func,_add _sub,\
	$(foreach mode,$(allfix_modes),$(func_X)))

LIB2FUNCS_EXCLUDE += \
	$(foreach func,_lshr _ashl _ashr _cmp,\
	$(foreach mode,$(allfix_modes),$(func_X)))


usat_modes = UQQ UHQ UHA USQ USA UDQ UDA UTQ UTA
ssat_modes =  QQ  HQ  HA  SQ  SA  DQ  DA  TQ  TA

LIB2FUNCS_EXCLUDE += \
	$(foreach func,_ssadd _sssub _ssneg _ssabs,\
	$(foreach mode,$(ssat_modes),$(func_X)))

LIB2FUNCS_EXCLUDE += \
	$(foreach func,_usadd _ussub _usneg,\
	$(foreach mode,$(usat_modes),$(func_X)))


smul_modes =  QQ  HQ  HA  SA
umul_modes = UQQ UHQ UHA USA
sdiv_modes =  QQ  HQ  HA  SA
udiv_modes = UQQ UHQ UHA USA

LIB2FUNCS_EXCLUDE += \
	$(foreach func,_mul,\
	$(foreach mode,$(smul_modes) $(umul_modes),$(func_X)))

LIB2FUNCS_EXCLUDE += \
	$(foreach func,_div,\
	$(foreach mode,$(sdiv_modes) $(udiv_modes),$(func_X)))