Merge lp:~ams-codesourcery/gcc-linaro/eabi-half-precision into lp:gcc-linaro/4.6

Proposed by Andrew Stubbs
Status: Rejected
Rejected by: Andrew Stubbs
Proposed branch: lp:~ams-codesourcery/gcc-linaro/eabi-half-precision
Merge into: lp:gcc-linaro/4.6
Diff against target: 226 lines (+71/-19)
11 files modified
ChangeLog.linaro (+31/-0)
gcc/config/arm/arm.c (+4/-4)
gcc/config/arm/fp16.c (+16/-9)
gcc/config/arm/libgcc-bpabi.ver (+7/-0)
gcc/config/arm/sfp-machine.h (+2/-2)
gcc/config/arm/t-bpabi (+2/-3)
gcc/config/arm/t-symbian (+1/-1)
gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C (+2/-0)
gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C (+2/-0)
gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c (+2/-0)
gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c (+2/-0)
To merge this branch: bzr merge lp:~ams-codesourcery/gcc-linaro/eabi-half-precision
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+57696@code.launchpad.net

Description of the change

Add ARM EABI conforming half-precision conversion routine names.

This patch is awaiting upstream review here:
 http://<email address hidden>/msg03210.html

To post a comment you must log in.
Revision history for this message
Ira Rosen (irar) wrote :

I am out of the office until 17/04/2011.

Note: This is an automated response to your message "[Merge]
lp:~ams-codesourcery/gcc-linaro/eabi-half-precision into
lp:gcc-linaro/4.6" sent on 14/4/2011 18:12:13.

This is the only notification you will receive while this person is away.

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r106733 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.6+bzr106733~ams-codesourcery~eabi-half-precision.tar.xdelta3.xz

and will be built on the following builders:
 a8-builder a9-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.6+bzr106733~ams-codesourcery~eabi-half-precision
cbuild-ancestor: lp:gcc-linaro/4.6+bzr106732
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote :

The return value of some externally visible functions has changed:

-unsigned short
+unsigned int
 __gnu_f2h_alternative(unsigned int x)

Is this change binary compatible? Does it matter?

Note that this patch is being reviewed on mainline and shouldn't be committed until the review is done and patch landed.

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on i686-lucid-cbuild109-scorpius-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106733~ams-codesourcery~eabi-half-precision/logs/i686-lucid-cbuild109-scorpius-i686r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106732.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106733~ams-codesourcery~eabi-half-precision/logs/i686-lucid-cbuild109-scorpius-i686r1/gcc-testsuite.txt

cbuild-checked: i686-lucid-cbuild109-scorpius-i686r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on x86_64-maverick-cbuild109-crucis-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106733~ams-codesourcery~eabi-half-precision/logs/x86_64-maverick-cbuild109-crucis-x86_64r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro/4.6+bzr106732.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106733~ams-codesourcery~eabi-half-precision/logs/x86_64-maverick-cbuild109-crucis-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-maverick-cbuild109-crucis-x86_64r1

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

> The return value of some externally visible functions has changed:
>
> -unsigned short
> +unsigned int
> __gnu_f2h_alternative(unsigned int x)
>
> Is this change binary compatible? Does it matter?

Return values are always passed in a register, and are therefore always de facto int type; the unsigned types will have the same bit pattern in registers. I don't believe this change should have any impact.

Revision history for this message
Richard Sandiford (rsandifo) wrote :

For the record, although it's my week roster-wise, I don't
feel comfortable enough with the EABI to review this one.

Unmerged revisions

106733. By Andrew Stubbs

EABI half-precision function names.

Merged from Linaro GCC 4.5.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-04-07 10:52:12 +0000
3+++ ChangeLog.linaro 2011-04-14 15:33:00 +0000
4@@ -1,3 +1,34 @@
5+2011-04-14 Andrew Stubbs <ams@codesourcery.com>
6+
7+ gcc/
8+ * config/arm/arm.c (arm_init_libfuncs): Change __gnu_f2h_ieee to
9+ __aeabi_f2h, __gnu_f2h_alternative to __aeabi_f2h_alt, __gnu_h2f_ieee
10+ to __aeabi_h2f, and __gnu_h2f_alternative to __aeabi_h2f_alt.
11+ * config/arm/fp16.c (__gnu_f2h_internal): Change return type to
12+ unsigned int. Change 'sign' variable likewise.
13+ (__gnu_h2f_internal): Set to static inline.
14+ Change return type to unsigned int. Change 'sign' variable likewise.
15+ (ALIAS): New define.
16+ (__gnu_f2h_ieee): Change unsigned short to unsigned int.
17+ (__gnu_h2f_ieee): Likewise.
18+ (__gnu_f2h_alternative): Likewise.
19+ (__gnu_h2f_alternative): Likewise.
20+ (__aeabi_f2h, __aeabi_h2f): New aliases.
21+ (__aeabi_f2h_alt, __aeabi_h2f_alt): Likewise.
22+ * config/arm/sfp-machine.h (__extendhfsf2): Set to __aeabi_h2f.
23+ (__truncsfhf2): Set to __aeabi_f2h.
24+ * config/arm/t-bpabi (LIB2FUNCS_STATIC_EXTRA): Move fp16.c ...
25+ (LIB2FUNCS_EXTRA): ... to here.
26+ * config/arm/t-symbian (LIB2FUNCS_STATIC_EXTRA): Move fp16.c ...
27+ (LIB2FUNCS_EXTRA): ... to here.
28+
29+ gcc/testsuite/
30+ * g++.dg/ext/arm-fp16/arm-fp16-ops-5.C: Check for __aeabi_h2f
31+ and __aeabi_f2h.
32+ * g++.dg/ext/arm-fp16/arm-fp16-ops-6.C: Likewise.
33+ * gcc.dg/torture/arm-fp16-ops-5.c: Likewise.
34+ * gcc.dg/torture/arm-fp16-ops-6.c: Likewise.
35+
36 2011-04-07 Andrew Stubbs <ams@codesourcery.com>
37
38 Merge from FSF GCC 4.6 (svn branches/gcc-4_6-branch 171921).
39
40=== modified file 'gcc/config/arm/arm.c'
41--- gcc/config/arm/arm.c 2011-03-02 11:38:43 +0000
42+++ gcc/config/arm/arm.c 2011-04-14 15:33:00 +0000
43@@ -1190,12 +1190,12 @@
44 /* Conversions. */
45 set_conv_libfunc (trunc_optab, HFmode, SFmode,
46 (arm_fp16_format == ARM_FP16_FORMAT_IEEE
47- ? "__gnu_f2h_ieee"
48- : "__gnu_f2h_alternative"));
49+ ? "__aeabi_f2h"
50+ : "__aeabi_f2h_alt"));
51 set_conv_libfunc (sext_optab, SFmode, HFmode,
52 (arm_fp16_format == ARM_FP16_FORMAT_IEEE
53- ? "__gnu_h2f_ieee"
54- : "__gnu_h2f_alternative"));
55+ ? "__aeabi_h2f"
56+ : "__aeabi_h2f_alt"));
57
58 /* Arithmetic. */
59 set_optab_libfunc (add_optab, HFmode, NULL);
60
61=== modified file 'gcc/config/arm/fp16.c'
62--- gcc/config/arm/fp16.c 2009-06-18 11:26:37 +0000
63+++ gcc/config/arm/fp16.c 2011-04-14 15:33:00 +0000
64@@ -22,10 +22,10 @@
65 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
66 <http://www.gnu.org/licenses/>. */
67
68-static inline unsigned short
69+static inline unsigned int
70 __gnu_f2h_internal(unsigned int a, int ieee)
71 {
72- unsigned short sign = (a >> 16) & 0x8000;
73+ unsigned int sign = (a >> 16) & 0x8000;
74 int aexp = (a >> 23) & 0xff;
75 unsigned int mantissa = a & 0x007fffff;
76 unsigned int mask;
77@@ -95,10 +95,10 @@
78 return sign | (((aexp + 14) << 10) + (mantissa >> 13));
79 }
80
81-unsigned int
82-__gnu_h2f_internal(unsigned short a, int ieee)
83+static inline unsigned int
84+__gnu_h2f_internal(unsigned int a, int ieee)
85 {
86- unsigned int sign = (unsigned int)(a & 0x8000) << 16;
87+ unsigned int sign = (a & 0x00008000) << 16;
88 int aexp = (a >> 10) & 0x1f;
89 unsigned int mantissa = a & 0x3ff;
90
91@@ -120,26 +120,33 @@
92 return sign | (((aexp + 0x70) << 23) + (mantissa << 13));
93 }
94
95-unsigned short
96+#define ALIAS(src, dst) \
97+ typeof (src) dst __attribute__ ((alias (#src)));
98+
99+unsigned int
100 __gnu_f2h_ieee(unsigned int a)
101 {
102 return __gnu_f2h_internal(a, 1);
103 }
104+ALIAS (__gnu_f2h_ieee, __aeabi_f2h)
105
106 unsigned int
107-__gnu_h2f_ieee(unsigned short a)
108+__gnu_h2f_ieee(unsigned int a)
109 {
110 return __gnu_h2f_internal(a, 1);
111 }
112+ALIAS (__gnu_h2f_ieee, __aeabi_h2f)
113
114-unsigned short
115+unsigned int
116 __gnu_f2h_alternative(unsigned int x)
117 {
118 return __gnu_f2h_internal(x, 0);
119 }
120+ALIAS (__gnu_f2h_alternative, __aeabi_f2h_alt)
121
122 unsigned int
123-__gnu_h2f_alternative(unsigned short a)
124+__gnu_h2f_alternative(unsigned int a)
125 {
126 return __gnu_h2f_internal(a, 0);
127 }
128+ALIAS (__gnu_h2f_alternative, __aeabi_h2f_alt)
129
130=== modified file 'gcc/config/arm/libgcc-bpabi.ver'
131--- gcc/config/arm/libgcc-bpabi.ver 2009-04-21 18:03:23 +0000
132+++ gcc/config/arm/libgcc-bpabi.ver 2011-04-14 15:33:00 +0000
133@@ -106,3 +106,10 @@
134 GCC_4.3.0 {
135 _Unwind_Backtrace
136 }
137+
138+GCC_4.7.0 {
139+ __aeabi_f2h
140+ __aeabi_f2h_alt
141+ __aeabi_h2f
142+ __aeabi_h2f_alt
143+}
144
145=== modified file 'gcc/config/arm/sfp-machine.h'
146--- gcc/config/arm/sfp-machine.h 2009-06-18 11:26:37 +0000
147+++ gcc/config/arm/sfp-machine.h 2011-04-14 15:33:00 +0000
148@@ -99,7 +99,7 @@
149 #define __fixdfdi __aeabi_d2lz
150 #define __fixunsdfdi __aeabi_d2ulz
151 #define __floatdidf __aeabi_l2d
152-#define __extendhfsf2 __gnu_h2f_ieee
153-#define __truncsfhf2 __gnu_f2h_ieee
154+#define __extendhfsf2 __aeabi_h2f
155+#define __truncsfhf2 __aeabi_f2h
156
157 #endif /* __ARM_EABI__ */
158
159=== modified file 'gcc/config/arm/t-bpabi'
160--- gcc/config/arm/t-bpabi 2009-06-18 11:26:37 +0000
161+++ gcc/config/arm/t-bpabi 2011-04-14 15:33:00 +0000
162@@ -21,9 +21,8 @@
163
164 # Add the BPABI C functions.
165 LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \
166- $(srcdir)/config/arm/unaligned-funcs.c
167-
168-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
169+ $(srcdir)/config/arm/unaligned-funcs.c \
170+ $(srcdir)/config/arm/fp16.c
171
172 UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
173 LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
174
175=== modified file 'gcc/config/arm/t-symbian'
176--- gcc/config/arm/t-symbian 2009-06-21 19:48:15 +0000
177+++ gcc/config/arm/t-symbian 2011-04-14 15:33:00 +0000
178@@ -36,7 +36,7 @@
179 LIB2ADDEHDEP = $(UNWIND_H)
180
181 # Include half-float helpers.
182-LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
183+LIB2FUNCS_EXTRA += $(srcdir)/config/arm/fp16.c
184
185 # Create a multilib for processors with VFP floating-point, and a
186 # multilib for those without -- using the soft-float ABI in both
187
188=== modified file 'gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C'
189--- gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C 2010-05-24 18:36:31 +0000
190+++ gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C 2011-04-14 15:33:00 +0000
191@@ -13,3 +13,5 @@
192 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
193 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
194 /* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
195+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
196+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */
197
198=== modified file 'gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C'
199--- gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C 2010-05-24 18:36:31 +0000
200+++ gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C 2011-04-14 15:33:00 +0000
201@@ -13,3 +13,5 @@
202 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
203 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
204 /* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
205+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
206+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */
207
208=== modified file 'gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c'
209--- gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c 2010-05-24 18:36:31 +0000
210+++ gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c 2011-04-14 15:33:00 +0000
211@@ -13,3 +13,5 @@
212 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
213 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
214 /* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
215+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
216+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */
217
218=== modified file 'gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c'
219--- gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c 2010-05-24 18:36:31 +0000
220+++ gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c 2011-04-14 15:33:00 +0000
221@@ -13,3 +13,5 @@
222 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
223 /* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
224 /* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
225+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
226+/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */

Subscribers

People subscribed via source and target branches