summaryrefslogtreecommitdiff
path: root/patches/gcc/3.4.6/arm-softfloat.patch
blob: b0ef61492f168824cb28d7b3e4bd4681370a5e59 (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
diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h
--- gcc-3.4.6.orig/gcc/config/arm/coff.h	2004-02-24 15:25:22.000000000 +0100
+++ gcc-3.4.6/gcc/config/arm/coff.h	2007-08-15 23:10:54.000000000 +0200
@@ -31,11 +31,16 @@
 #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
 
 #undef  TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
+#define TARGET_DEFAULT		\
+	( ARM_FLAG_SOFT_FLOAT	\
+	| ARM_FLAG_VFP		\
+	| ARM_FLAG_APCS_32	\
+	| ARM_FLAG_APCS_FRAME	\
+	| ARM_FLAG_MMU_TRAPS )
 
 #ifndef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
+  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
 #endif
 
 /* This is COFF, but prefer stabs.  */
diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h
--- gcc-3.4.6.orig/gcc/config/arm/elf.h	2004-02-24 15:25:22.000000000 +0100
+++ gcc-3.4.6/gcc/config/arm/elf.h	2007-08-15 23:10:54.000000000 +0200
@@ -46,7 +46,9 @@
 
 #ifndef SUBTARGET_ASM_FLOAT_SPEC
 #define SUBTARGET_ASM_FLOAT_SPEC "\
-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
+%{mapcs-float:-mfloat} \
+%{mhard-float:-mfpu=fpa} \
+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
 #endif
 
 #ifndef ASM_SPEC
@@ -106,12 +108,17 @@
 #endif
 
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
+#define TARGET_DEFAULT		\
+	( ARM_FLAG_SOFT_FLOAT	\
+	| ARM_FLAG_VFP		\
+	| ARM_FLAG_APCS_32	\
+	| ARM_FLAG_APCS_FRAME	\
+	| ARM_FLAG_MMU_TRAPS )
 #endif
 
 #ifndef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
+  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
 #endif
 
 #define TARGET_ASM_FILE_START_APP_OFF true
diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
--- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 23:07:00.000000000 +0200
+++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:10:54.000000000 +0200
@@ -44,12 +44,26 @@
 #define TARGET_LINKER_EMULATION "armelf_linux"
 #endif
 
-/* Default is to use APCS-32 mode.  */
+/*
+ * Default is to use APCS-32 mode with soft-vfp.
+ * The old Linux default for floats can be achieved with -mhard-float
+ * or with the configure --with-float=hard option.
+ * If -msoft-float or --with-float=soft is used then software float 
+ * support will be used just like the default but with the legacy
+ * big endian word ordering for double float representation instead.
+ */
 #undef  TARGET_DEFAULT
-#define TARGET_DEFAULT \
-		( ARM_FLAG_APCS_32 | \
-		  ARM_FLAG_MMU_TRAPS | \
-		  TARGET_ENDIAN_DEFAULT )
+#define TARGET_DEFAULT		\
+	( ARM_FLAG_APCS_32	\
+	| ARM_FLAG_SOFT_FLOAT	\
+	| TARGET_ENDIAN_DEFAULT	\
+	| ARM_FLAG_VFP		\
+	| ARM_FLAG_MMU_TRAPS )
+
+#undef  SUBTARGET_EXTRA_ASM_SPEC
+#define SUBTARGET_EXTRA_ASM_SPEC "\
+%{mhard-float:-mfpu=fpa} \
+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
 
 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
 
@@ -57,7 +71,7 @@
 
 #undef  MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
-	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
+	{ "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
 
 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
 
@@ -72,7 +86,7 @@
    %{shared:-lc} \
    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
 
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"
 
 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux
--- gcc-3.4.6.orig/gcc/config/arm/t-linux	2003-09-20 23:09:07.000000000 +0200
+++ gcc-3.4.6/gcc/config/arm/t-linux	2007-08-15 23:10:54.000000000 +0200
@@ -4,7 +4,10 @@
 LIBGCC2_DEBUG_CFLAGS = -g0
 
 LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
+	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+	_fixsfsi _fixunssfsi
 
 # MULTILIB_OPTIONS = mhard-float/msoft-float
 # MULTILIB_DIRNAMES = hard-float soft-float
diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h
--- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h	2004-02-24 15:25:22.000000000 +0100
+++ gcc-3.4.6/gcc/config/arm/unknown-elf.h	2007-08-15 23:10:54.000000000 +0200
@@ -30,7 +30,12 @@
 
 /* Default to using APCS-32 and software floating point.  */
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT	(ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
+#define TARGET_DEFAULT		\
+	( ARM_FLAG_SOFT_FLOAT	\
+	| ARM_FLAG_VFP		\
+	| ARM_FLAG_APCS_32	\
+	| ARM_FLAG_APCS_FRAME	\
+	| ARM_FLAG_MMU_TRAPS )
 #endif
 
 /* Now we define the strings used to build the spec file.  */
diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h
--- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h	2003-07-02 01:26:43.000000000 +0200
+++ gcc-3.4.6/gcc/config/arm/xscale-elf.h	2007-08-15 23:10:54.000000000 +0200
@@ -49,11 +49,12 @@
 		     endian, regardless of the endian-ness of the memory
 		     system.  */
 		     
-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
-  %{mhard-float:-mfpu=fpa} \
-  %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
+#define SUBTARGET_EXTRA_ASM_SPEC "\
+%{!mcpu=*:-mcpu=xscale} \
+%{mhard-float:-mfpu=fpa} \
+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
 
 #ifndef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
-  { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
+  { "mlittle-endian", "mno-thumb-interwork", "marm" }
 #endif