View | Details | Return to bug 92055 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/common/config/avr/avr-common.c (+26 lines)
Lines 23-28 Link Here
23
#include "tm.h"
23
#include "tm.h"
24
#include "common/common-target.h"
24
#include "common/common-target.h"
25
#include "common/common-target-def.h"
25
#include "common/common-target-def.h"
26
#include "opts.h"
26
27
27
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
28
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
28
static const struct default_options avr_option_optimization_table[] =
29
static const struct default_options avr_option_optimization_table[] =
Lines 41-46 static const struct default_options avr_ Link Here
41
    { OPT_LEVELS_NONE, 0, NULL, 0 }
42
    { OPT_LEVELS_NONE, 0, NULL, 0 }
42
  };
43
  };
43
44
45
46
/* Implement `TARGET_HANDLE_OPTION'.  */
47
48
static bool
49
avr_handle_option (struct gcc_options*, struct gcc_options*,
50
                   const struct cl_decoded_option *decoded, location_t)
51
{
52
  size_t code = decoded->opt_index;
53
54
  switch (code)
55
    {
56
    case OPT_mdouble64:
57
      // Only accept -mdouble64 if configured --with-double64.
58
#if !defined (WITH_DOUBLE64)
59
      return false;
60
#endif
61
      break;
62
    }
63
64
  return true;
65
}
66
67
#undef TARGET_HANDLE_OPTION
68
#define TARGET_HANDLE_OPTION avr_handle_option
69
44
#undef TARGET_OPTION_OPTIMIZATION_TABLE
70
#undef TARGET_OPTION_OPTIMIZATION_TABLE
45
#define TARGET_OPTION_OPTIMIZATION_TABLE avr_option_optimization_table
71
#define TARGET_OPTION_OPTIMIZATION_TABLE avr_option_optimization_table
46
72
(-)gcc/config/avr/avr.h (-2 / +6 lines)
Lines 140-147 These two properties are reflected by bu Link Here
140
#define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
140
#define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32)
141
#define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64)
141
#define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64)
142
#define FLOAT_TYPE_SIZE 32
142
#define FLOAT_TYPE_SIZE 32
143
#define DOUBLE_TYPE_SIZE 32
143
#if defined (WITH_DOUBLE64)
144
#define LONG_DOUBLE_TYPE_SIZE 32
144
#define DOUBLE_TYPE_SIZE (avr_double64 ? 64 : FLOAT_TYPE_SIZE)
145
#else
146
#define DOUBLE_TYPE_SIZE FLOAT_TYPE_SIZE
147
#endif
148
#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
145
#define LONG_LONG_ACCUM_TYPE_SIZE 64
149
#define LONG_LONG_ACCUM_TYPE_SIZE 64
146
150
147
#define DEFAULT_SIGNED_CHAR 1
151
#define DEFAULT_SIGNED_CHAR 1
(-)gcc/config/avr/avr.opt (+4 lines)
Lines 115-120 mabsdata Link Here
115
Target Report Mask(ABSDATA)
115
Target Report Mask(ABSDATA)
116
Assume that all data in static storage can be accessed by LDS / STS.  This option is only useful for reduced Tiny devices.
116
Assume that all data in static storage can be accessed by LDS / STS.  This option is only useful for reduced Tiny devices.
117
117
118
mdouble64
119
Target Report Var(avr_double64) Init(0)
120
Use 64-bit double type.
121
118
nodevicelib
122
nodevicelib
119
Driver Target Report RejectNegative
123
Driver Target Report RejectNegative
120
Do not link against the device-specific library lib<MCU>.a.
124
Do not link against the device-specific library lib<MCU>.a.
(-)gcc/config/avr/genmultilib.awk (-2 / +19 lines)
Lines 38-43 BEGIN { Link Here
38
    dir_rcall = "short-calls"
38
    dir_rcall = "short-calls"
39
    opt_rcall = "mshort-calls"
39
    opt_rcall = "mshort-calls"
40
40
41
    dir_double64 = "double64"
42
    opt_double64 = "mdouble64"
43
41
    #    awk Variable         Makefile Variable  
44
    #    awk Variable         Makefile Variable  
42
    #  ------------------------------------------
45
    #  ------------------------------------------
43
    #    m_options     <->    MULTILIB_OPTIONS
46
    #    m_options     <->    MULTILIB_OPTIONS
Lines 47-52 BEGIN { Link Here
47
    m_options    = "\nMULTILIB_OPTIONS = "
50
    m_options    = "\nMULTILIB_OPTIONS = "
48
    m_dirnames   = "\nMULTILIB_DIRNAMES ="
51
    m_dirnames   = "\nMULTILIB_DIRNAMES ="
49
    m_required   = "\nMULTILIB_REQUIRED ="
52
    m_required   = "\nMULTILIB_REQUIRED ="
53
54
    with_double64 = (with_double64 == "WITH_DOUBLE64")
50
}
55
}
51
56
52
##################################################################
57
##################################################################
Lines 130-136 BEGIN { Link Here
130
	# leading "mmcu=avr2/" in order not to confuse genmultilib.
135
	# leading "mmcu=avr2/" in order not to confuse genmultilib.
131
	gsub (/^mmcu=avr2\//, "", opts)
136
	gsub (/^mmcu=avr2\//, "", opts)
132
	if (opts != "mmcu=avr2")
137
	if (opts != "mmcu=avr2")
138
	{
133
	    m_required = m_required " \\\n\t" opts
139
	    m_required = m_required " \\\n\t" opts
140
	    if (with_double64)
141
		m_required = m_required " \\\n\t" opts "/" opt_double64
142
	}
134
    }
143
    }
135
}
144
}
136
145
Lines 144-151 END { Link Here
144
    ############################################################
153
    ############################################################
145
154
146
    # Intended Target: ./gcc/config/avr/t-multilib
155
    # Intended Target: ./gcc/config/avr/t-multilib
156
    if (with_double64)
157
    {
158
	print m_options  " " opt_tiny " " opt_rcall " " opt_double64
159
	print m_dirnames " " dir_tiny " " dir_rcall " " dir_double64
160
    }
161
    else
162
    {
163
	print m_options  " " opt_tiny " " opt_rcall
164
	print m_dirnames " " dir_tiny " " dir_rcall
165
    }
147
166
148
    print m_options  " " opt_tiny " " opt_rcall
149
    print m_dirnames " " dir_tiny " " dir_rcall
150
    print m_required
167
    print m_required
151
}
168
}
(-)gcc/config/avr/t-avr (-1 / +3 lines)
Lines 16-21 Link Here
16
# along with GCC; see the file COPYING3.  If not see
16
# along with GCC; see the file COPYING3.  If not see
17
# <http://www.gnu.org/licenses/>.
17
# <http://www.gnu.org/licenses/>.
18
18
19
WITH_DOUBLE64 = $(findstring WITH_DOUBLE64, $(tm_defines))
20
19
PASSES_EXTRA += $(srcdir)/config/avr/avr-passes.def
21
PASSES_EXTRA += $(srcdir)/config/avr/avr-passes.def
20
22
21
driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
23
driver-avr.o: $(srcdir)/config/avr/driver-avr.c \
Lines 98-101 s-mlib: $(srcdir)/config/avr/t-multilib Link Here
98
100
99
$(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \
101
$(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \
100
				 $(AVR_MCUS)
102
				 $(AVR_MCUS)
101
	$(AWK) -f $< $< $(AVR_MCUS) > $@
103
	$(AWK) -v with_double64=$(WITH_DOUBLE64) -f $< $< $(AVR_MCUS) > $@
(-)gcc/config/avr/t-multilib (-3 / +21 lines)
Lines 21-46 Link Here
21
# along with GCC; see the file COPYING3.  If not see
21
# along with GCC; see the file COPYING3.  If not see
22
# <http://www.gnu.org/licenses/>.
22
# <http://www.gnu.org/licenses/>.
23
23
24
MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega3/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7/mmcu=avrtiny msp8 mshort-calls
24
MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega3/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7/mmcu=avrtiny msp8 mshort-calls mdouble64
25
25
26
MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny tiny-stack short-calls
26
MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny tiny-stack short-calls double64
27
27
28
MULTILIB_REQUIRED = \
28
MULTILIB_REQUIRED = \
29
	msp8 \
29
	msp8 \
30
	msp8/mdouble64 \
30
	mmcu=avr25 \
31
	mmcu=avr25 \
32
	mmcu=avr25/mdouble64 \
31
	mmcu=avr25/msp8 \
33
	mmcu=avr25/msp8 \
34
	mmcu=avr25/msp8/mdouble64 \
32
	mmcu=avr3 \
35
	mmcu=avr3 \
36
	mmcu=avr3/mdouble64 \
33
	mmcu=avr31 \
37
	mmcu=avr31 \
38
	mmcu=avr31/mdouble64 \
34
	mmcu=avr35 \
39
	mmcu=avr35 \
40
	mmcu=avr35/mdouble64 \
35
	mmcu=avr4 \
41
	mmcu=avr4 \
42
	mmcu=avr4/mdouble64 \
36
	mmcu=avr5 \
43
	mmcu=avr5 \
44
	mmcu=avr5/mdouble64 \
37
	mmcu=avr51 \
45
	mmcu=avr51 \
46
	mmcu=avr51/mdouble64 \
38
	mmcu=avr6 \
47
	mmcu=avr6 \
48
	mmcu=avr6/mdouble64 \
39
	mmcu=avrxmega2 \
49
	mmcu=avrxmega2 \
50
	mmcu=avrxmega2/mdouble64 \
40
	mmcu=avrxmega3/mshort-calls \
51
	mmcu=avrxmega3/mshort-calls \
52
	mmcu=avrxmega3/mshort-calls/mdouble64 \
41
	mmcu=avrxmega3 \
53
	mmcu=avrxmega3 \
54
	mmcu=avrxmega3/mdouble64 \
42
	mmcu=avrxmega4 \
55
	mmcu=avrxmega4 \
56
	mmcu=avrxmega4/mdouble64 \
43
	mmcu=avrxmega5 \
57
	mmcu=avrxmega5 \
58
	mmcu=avrxmega5/mdouble64 \
44
	mmcu=avrxmega6 \
59
	mmcu=avrxmega6 \
60
	mmcu=avrxmega6/mdouble64 \
45
	mmcu=avrxmega7 \
61
	mmcu=avrxmega7 \
46
	mmcu=avrtiny
62
	mmcu=avrxmega7/mdouble64 \
63
	mmcu=avrtiny \
64
	mmcu=avrtiny/mdouble64
(-)gcc/config.gcc (+3 lines)
Lines 1287-1292 avr-*-*) Link Here
1287
	    tm_file="${tm_file} ${cpu_type}/avrlibc.h"
1287
	    tm_file="${tm_file} ${cpu_type}/avrlibc.h"
1288
	    tm_defines="${tm_defines} WITH_AVRLIBC"
1288
	    tm_defines="${tm_defines} WITH_AVRLIBC"
1289
	fi
1289
	fi
1290
	if test x${with_double64} = xyes; then
1291
	    tm_defines="${tm_defines} WITH_DOUBLE64"
1292
	fi
1290
	tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
1293
	tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
1291
	use_gcc_stdint=wrap
1294
	use_gcc_stdint=wrap
1292
	extra_gcc_objs="driver-avr.o avr-devices.o"
1295
	extra_gcc_objs="driver-avr.o avr-devices.o"
(-)libgcc/config/avr/t-avr (-2 / +11 lines)
Lines 1-3 Link Here
1
WITH_DOUBLE64 = $(findstring WITH_DOUBLE64, $(libgcc_tm_defines))
2
1
LIB1ASMSRC = avr/lib1funcs.S
3
LIB1ASMSRC = avr/lib1funcs.S
2
LIB1ASMFUNCS = \
4
LIB1ASMFUNCS = \
3
	_mulqi3 \
5
	_mulqi3 \
Lines 112-121 LIB2FUNCS_EXCLUDE = \ Link Here
112
	_clrsbdi2 \
114
	_clrsbdi2 \
113
115
114
116
115
# We do not have the DF type.
116
# Most of the C functions in libgcc2 use almost all registers,
117
# Most of the C functions in libgcc2 use almost all registers,
117
# so use -mcall-prologues for smaller code size.
118
# so use -mcall-prologues for smaller code size.
118
HOST_LIBGCC2_CFLAGS += -DDF=SF -Dinhibit_libc -mcall-prologues -Os
119
HOST_LIBGCC2_CFLAGS += -Dinhibit_libc -mcall-prologues -Os
120
121
ifeq ($(double_type_size),32)
122
# We do not have the DF type.
123
HOST_LIBGCC2_CFLAGS += -DDF=SF
124
else
125
DPBIT :=
126
DPBIT_FUNCS :=
127
endif
119
128
120
# Extra 16-bit integer functions.
129
# Extra 16-bit integer functions.
121
intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2
130
intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _clrsbXX2
(-)libgcc/config/avr/t-avrlibc (+21 lines)
Lines 64-66 LIB2FUNCS_EXCLUDE += \ Link Here
64
	_fixunssfsi _fixsfdi \
64
	_fixunssfsi _fixsfdi \
65
	_fixunssfdi \
65
	_fixunssfdi \
66
	_floatdisf _floatundisf
66
	_floatdisf _floatundisf
67
68
ifeq ($(double_type_size),64)
69
70
# Just copy from the double=float multilib; we would remove any DFmode
71
# bits from this multilib variant, anyway, because the current assumption
72
# is that avr-libc hosts *all* IEEE-double stuff.
73
74
LIB2FUNCS_EXCLUDE := %
75
LIB1ASMFUNCS :=
76
libgcc-objects :=
77
objects :=
78
79
t-copy-libgcc.dep: $(srcdir)/config/avr/t-copy-libgcc
80
	-rm -f libgcc.a
81
	-rm -f libgcov.a
82
	cp $< $@
83
84
libgcc.a libgcov.a libgcc_tm.h: t-copy-libgcc.dep
85
86
endif
87
(-)libgcc/config/avr/t-copy-libgcc (+13 lines)
Line 0 Link Here
1
# Only used with --with-avrlibc --with-double64 -mdouble64
2
#
3
# Inserted at the end of Makefile by magic[tm].
4
# We need this *after* Makefile's rules so we can override them.
5
6
libgcc.a: ../../libgcc/libgcc.a
7
	cp $< $@
8
9
libgcov.a: ../../libgcc/libgcov.a
10
	@:
11
ifeq ($(enable_gcov),yes)
12
	cp $< $@
13
endif
(-)libgcc/config.host (+3 lines)
Lines 499-504 arm*-*-eabi* | arm*-*-symbianelf* | arm* Link Here
499
	unwind_header=config/arm/unwind-arm.h
499
	unwind_header=config/arm/unwind-arm.h
500
	;;
500
	;;
501
avr-*-*)
501
avr-*-*)
502
	if test x${with_double64} = xyes; then
503
	    tm_defines="${tm_defines} WITH_DOUBLE64"
504
	fi
502
	# Make HImode functions for AVR
505
	# Make HImode functions for AVR
503
	tmake_file="${cpu_type}/t-avr t-fpbit"
506
	tmake_file="${cpu_type}/t-avr t-fpbit"
504
	if test x${with_avrlibc} != xno; then
507
	if test x${with_avrlibc} != xno; then

Return to bug 92055