Patchwork [RFC,go] : Port to ALPHA arch - sysinfo.go fixup

login
register
mail settings
Submitter Uros Bizjak
Date July 6, 2011, 5:11 p.m.
Message ID <CAFULd4ZtyJasOWpB=zmrvb6BmVNy1yNxggx7yhSD9dYZFi=vdg@mail.gmail.com>
Download mbox | patch
Permalink /patch/103541/
State New
Headers show

Comments

Uros Bizjak - July 6, 2011, 5:11 p.m.
On Tue, Jul 5, 2011 at 7:17 PM, Mike Stump <mikestump@comcast.net> wrote:

>> Please note that we set
>> -mieee flag to compile .go files from library and also we add this
>> flag to default testsuite compile flags.
>
>>
> Ick, I think this patch might be expedient, but, wrong.  Ian will have to think about it and decide.

This is something I come up with after a lot of staring into build system:

2011-07-06  Uros Bizjak  <ubizjak@gmail.com>

	* mt-alphaieee (GOCFLAGS_FOR_TARGET): Add -mieee.

This patch by itself does not fix go testsuite failures, although the
library is now OK. Additional patch is needed to pass GOCFLAGS to the
compiler when checking the package. I will submit it separately.

Tested on alphaev68-pc-linux-gnu. OK for mainline?

Uros.
Ian Taylor - July 6, 2011, 5:34 p.m.
Uros Bizjak <ubizjak@gmail.com> writes:

> On Tue, Jul 5, 2011 at 7:17 PM, Mike Stump <mikestump@comcast.net> wrote:
>
>>> Please note that we set
>>> -mieee flag to compile .go files from library and also we add this
>>> flag to default testsuite compile flags.
>>
>>>
>> Ick, I think this patch might be expedient, but, wrong.  Ian will have to think about it and decide.
>
> This is something I come up with after a lot of staring into build system:
>
> 2011-07-06  Uros Bizjak  <ubizjak@gmail.com>
>
> 	* mt-alphaieee (GOCFLAGS_FOR_TARGET): Add -mieee.
>
> This patch by itself does not fix go testsuite failures, although the
> library is now OK. Additional patch is needed to pass GOCFLAGS to the
> compiler when checking the package. I will submit it separately.
>
> Tested on alphaev68-pc-linux-gnu. OK for mainline?
>
> Uros.
>
> Index: config/mt-alphaieee
> ===================================================================
> --- config/mt-alphaieee	(revision 175904)
> +++ config/mt-alphaieee	(working copy)
> @@ -1,2 +1,3 @@
>  CFLAGS_FOR_TARGET += -mieee
>  CXXFLAGS_FOR_TARGET += -mieee
> +GOCFLAGS_FOR_TARGET += -mieee


This seems like a reasonable patch to me, but technically speaking it is
incomplete.  Go should have IEEE floating point behaviour by default.  I
believe Java is the same.  Ideally there would be a target-independent
way for a frontend to request this mode by default.  It's a little bit
odd because as far as I know every other backend does default to proper
IEEE arithmetic, and only deviates when using -ffast-math or equivalent.

Anyhow, it's hard for me to care all that much about the Alpha, so I
will approve this patch.  It's clearly better than the current
situation, and it follows what other languages are doing.

Thanks.

Ian
Uros Bizjak - July 6, 2011, 5:42 p.m.
On Wed, Jul 6, 2011 at 7:34 PM, Ian Lance Taylor <iant@google.com> wrote:

> This seems like a reasonable patch to me, but technically speaking it is
> incomplete.  Go should have IEEE floating point behaviour by default.  I
> believe Java is the same.  Ideally there would be a target-independent
> way for a frontend to request this mode by default.  It's a little bit
> odd because as far as I know every other backend does default to proper
> IEEE arithmetic, and only deviates when using -ffast-math or equivalent.

sh*-*-* also needs -mieee to handle NaN & Inf, spu-*-* simply doesn't
support them.

Uros.

Patch

Index: config/mt-alphaieee
===================================================================
--- config/mt-alphaieee	(revision 175904)
+++ config/mt-alphaieee	(working copy)
@@ -1,2 +1,3 @@ 
 CFLAGS_FOR_TARGET += -mieee
 CXXFLAGS_FOR_TARGET += -mieee
+GOCFLAGS_FOR_TARGET += -mieee