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
=== modified file 'ChangeLog.linaro'
--- ChangeLog.linaro 2011-04-07 10:52:12 +0000
+++ ChangeLog.linaro 2011-04-14 15:33:00 +0000
@@ -1,3 +1,34 @@
12011-04-14 Andrew Stubbs <ams@codesourcery.com>
2
3 gcc/
4 * config/arm/arm.c (arm_init_libfuncs): Change __gnu_f2h_ieee to
5 __aeabi_f2h, __gnu_f2h_alternative to __aeabi_f2h_alt, __gnu_h2f_ieee
6 to __aeabi_h2f, and __gnu_h2f_alternative to __aeabi_h2f_alt.
7 * config/arm/fp16.c (__gnu_f2h_internal): Change return type to
8 unsigned int. Change 'sign' variable likewise.
9 (__gnu_h2f_internal): Set to static inline.
10 Change return type to unsigned int. Change 'sign' variable likewise.
11 (ALIAS): New define.
12 (__gnu_f2h_ieee): Change unsigned short to unsigned int.
13 (__gnu_h2f_ieee): Likewise.
14 (__gnu_f2h_alternative): Likewise.
15 (__gnu_h2f_alternative): Likewise.
16 (__aeabi_f2h, __aeabi_h2f): New aliases.
17 (__aeabi_f2h_alt, __aeabi_h2f_alt): Likewise.
18 * config/arm/sfp-machine.h (__extendhfsf2): Set to __aeabi_h2f.
19 (__truncsfhf2): Set to __aeabi_f2h.
20 * config/arm/t-bpabi (LIB2FUNCS_STATIC_EXTRA): Move fp16.c ...
21 (LIB2FUNCS_EXTRA): ... to here.
22 * config/arm/t-symbian (LIB2FUNCS_STATIC_EXTRA): Move fp16.c ...
23 (LIB2FUNCS_EXTRA): ... to here.
24
25 gcc/testsuite/
26 * g++.dg/ext/arm-fp16/arm-fp16-ops-5.C: Check for __aeabi_h2f
27 and __aeabi_f2h.
28 * g++.dg/ext/arm-fp16/arm-fp16-ops-6.C: Likewise.
29 * gcc.dg/torture/arm-fp16-ops-5.c: Likewise.
30 * gcc.dg/torture/arm-fp16-ops-6.c: Likewise.
31
12011-04-07 Andrew Stubbs <ams@codesourcery.com>322011-04-07 Andrew Stubbs <ams@codesourcery.com>
233
3 Merge from FSF GCC 4.6 (svn branches/gcc-4_6-branch 171921).34 Merge from FSF GCC 4.6 (svn branches/gcc-4_6-branch 171921).
435
=== modified file 'gcc/config/arm/arm.c'
--- gcc/config/arm/arm.c 2011-03-02 11:38:43 +0000
+++ gcc/config/arm/arm.c 2011-04-14 15:33:00 +0000
@@ -1190,12 +1190,12 @@
1190 /* Conversions. */1190 /* Conversions. */
1191 set_conv_libfunc (trunc_optab, HFmode, SFmode,1191 set_conv_libfunc (trunc_optab, HFmode, SFmode,
1192 (arm_fp16_format == ARM_FP16_FORMAT_IEEE1192 (arm_fp16_format == ARM_FP16_FORMAT_IEEE
1193 ? "__gnu_f2h_ieee"1193 ? "__aeabi_f2h"
1194 : "__gnu_f2h_alternative"));1194 : "__aeabi_f2h_alt"));
1195 set_conv_libfunc (sext_optab, SFmode, HFmode, 1195 set_conv_libfunc (sext_optab, SFmode, HFmode,
1196 (arm_fp16_format == ARM_FP16_FORMAT_IEEE1196 (arm_fp16_format == ARM_FP16_FORMAT_IEEE
1197 ? "__gnu_h2f_ieee"1197 ? "__aeabi_h2f"
1198 : "__gnu_h2f_alternative"));1198 : "__aeabi_h2f_alt"));
1199 1199
1200 /* Arithmetic. */1200 /* Arithmetic. */
1201 set_optab_libfunc (add_optab, HFmode, NULL);1201 set_optab_libfunc (add_optab, HFmode, NULL);
12021202
=== modified file 'gcc/config/arm/fp16.c'
--- gcc/config/arm/fp16.c 2009-06-18 11:26:37 +0000
+++ gcc/config/arm/fp16.c 2011-04-14 15:33:00 +0000
@@ -22,10 +22,10 @@
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */23 <http://www.gnu.org/licenses/>. */
2424
25static inline unsigned short25static inline unsigned int
26__gnu_f2h_internal(unsigned int a, int ieee)26__gnu_f2h_internal(unsigned int a, int ieee)
27{27{
28 unsigned short sign = (a >> 16) & 0x8000;28 unsigned int sign = (a >> 16) & 0x8000;
29 int aexp = (a >> 23) & 0xff;29 int aexp = (a >> 23) & 0xff;
30 unsigned int mantissa = a & 0x007fffff;30 unsigned int mantissa = a & 0x007fffff;
31 unsigned int mask;31 unsigned int mask;
@@ -95,10 +95,10 @@
95 return sign | (((aexp + 14) << 10) + (mantissa >> 13));95 return sign | (((aexp + 14) << 10) + (mantissa >> 13));
96}96}
9797
98unsigned int98static inline unsigned int
99__gnu_h2f_internal(unsigned short a, int ieee)99__gnu_h2f_internal(unsigned int a, int ieee)
100{100{
101 unsigned int sign = (unsigned int)(a & 0x8000) << 16;101 unsigned int sign = (a & 0x00008000) << 16;
102 int aexp = (a >> 10) & 0x1f;102 int aexp = (a >> 10) & 0x1f;
103 unsigned int mantissa = a & 0x3ff;103 unsigned int mantissa = a & 0x3ff;
104104
@@ -120,26 +120,33 @@
120 return sign | (((aexp + 0x70) << 23) + (mantissa << 13));120 return sign | (((aexp + 0x70) << 23) + (mantissa << 13));
121}121}
122122
123unsigned short123#define ALIAS(src, dst) \
124 typeof (src) dst __attribute__ ((alias (#src)));
125
126unsigned int
124__gnu_f2h_ieee(unsigned int a)127__gnu_f2h_ieee(unsigned int a)
125{128{
126 return __gnu_f2h_internal(a, 1);129 return __gnu_f2h_internal(a, 1);
127}130}
131ALIAS (__gnu_f2h_ieee, __aeabi_f2h)
128132
129unsigned int133unsigned int
130__gnu_h2f_ieee(unsigned short a)134__gnu_h2f_ieee(unsigned int a)
131{135{
132 return __gnu_h2f_internal(a, 1);136 return __gnu_h2f_internal(a, 1);
133}137}
138ALIAS (__gnu_h2f_ieee, __aeabi_h2f)
134139
135unsigned short140unsigned int
136__gnu_f2h_alternative(unsigned int x)141__gnu_f2h_alternative(unsigned int x)
137{142{
138 return __gnu_f2h_internal(x, 0);143 return __gnu_f2h_internal(x, 0);
139}144}
145ALIAS (__gnu_f2h_alternative, __aeabi_f2h_alt)
140146
141unsigned int147unsigned int
142__gnu_h2f_alternative(unsigned short a)148__gnu_h2f_alternative(unsigned int a)
143{149{
144 return __gnu_h2f_internal(a, 0);150 return __gnu_h2f_internal(a, 0);
145}151}
152ALIAS (__gnu_h2f_alternative, __aeabi_h2f_alt)
146153
=== modified file 'gcc/config/arm/libgcc-bpabi.ver'
--- gcc/config/arm/libgcc-bpabi.ver 2009-04-21 18:03:23 +0000
+++ gcc/config/arm/libgcc-bpabi.ver 2011-04-14 15:33:00 +0000
@@ -106,3 +106,10 @@
106GCC_4.3.0 {106GCC_4.3.0 {
107 _Unwind_Backtrace107 _Unwind_Backtrace
108}108}
109
110GCC_4.7.0 {
111 __aeabi_f2h
112 __aeabi_f2h_alt
113 __aeabi_h2f
114 __aeabi_h2f_alt
115}
109116
=== modified file 'gcc/config/arm/sfp-machine.h'
--- gcc/config/arm/sfp-machine.h 2009-06-18 11:26:37 +0000
+++ gcc/config/arm/sfp-machine.h 2011-04-14 15:33:00 +0000
@@ -99,7 +99,7 @@
99#define __fixdfdi __aeabi_d2lz99#define __fixdfdi __aeabi_d2lz
100#define __fixunsdfdi __aeabi_d2ulz100#define __fixunsdfdi __aeabi_d2ulz
101#define __floatdidf __aeabi_l2d101#define __floatdidf __aeabi_l2d
102#define __extendhfsf2 __gnu_h2f_ieee102#define __extendhfsf2 __aeabi_h2f
103#define __truncsfhf2 __gnu_f2h_ieee103#define __truncsfhf2 __aeabi_f2h
104104
105#endif /* __ARM_EABI__ */105#endif /* __ARM_EABI__ */
106106
=== modified file 'gcc/config/arm/t-bpabi'
--- gcc/config/arm/t-bpabi 2009-06-18 11:26:37 +0000
+++ gcc/config/arm/t-bpabi 2011-04-14 15:33:00 +0000
@@ -21,9 +21,8 @@
2121
22# Add the BPABI C functions.22# Add the BPABI C functions.
23LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \23LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \
24 $(srcdir)/config/arm/unaligned-funcs.c24 $(srcdir)/config/arm/unaligned-funcs.c \
2525 $(srcdir)/config/arm/fp16.c
26LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
2726
28UNWIND_H = $(srcdir)/config/arm/unwind-arm.h27UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
29LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \28LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
3029
=== modified file 'gcc/config/arm/t-symbian'
--- gcc/config/arm/t-symbian 2009-06-21 19:48:15 +0000
+++ gcc/config/arm/t-symbian 2011-04-14 15:33:00 +0000
@@ -36,7 +36,7 @@
36LIB2ADDEHDEP = $(UNWIND_H)36LIB2ADDEHDEP = $(UNWIND_H)
3737
38# Include half-float helpers.38# Include half-float helpers.
39LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c39LIB2FUNCS_EXTRA += $(srcdir)/config/arm/fp16.c
4040
41# Create a multilib for processors with VFP floating-point, and a41# Create a multilib for processors with VFP floating-point, and a
42# multilib for those without -- using the soft-float ABI in both42# multilib for those without -- using the soft-float ABI in both
4343
=== modified file 'gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C'
--- gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C 2010-05-24 18:36:31 +0000
+++ gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-5.C 2011-04-14 15:33:00 +0000
@@ -13,3 +13,5 @@
13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
16/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
17/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */
1618
=== modified file 'gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C'
--- gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C 2010-05-24 18:36:31 +0000
+++ gcc/testsuite/g++.dg/ext/arm-fp16/arm-fp16-ops-6.C 2011-04-14 15:33:00 +0000
@@ -13,3 +13,5 @@
13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
16/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
17/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */
1618
=== modified file 'gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c'
--- gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c 2010-05-24 18:36:31 +0000
+++ gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c 2011-04-14 15:33:00 +0000
@@ -13,3 +13,5 @@
13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
16/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
17/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */
1618
=== modified file 'gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c'
--- gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c 2010-05-24 18:36:31 +0000
+++ gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c 2011-04-14 15:33:00 +0000
@@ -13,3 +13,5 @@
13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */13/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */14/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */15/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
16/* { dg-final { scan-assembler-not "\tbl\t__aeabi_h2f" } } */
17/* { dg-final { scan-assembler-not "\tbl\t__aeabi_f2h" } } */

Subscribers

People subscribed via source and target branches