9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 15:29 [9fans] ARM compiler shortcoming? Lucio De Re
@ 2011-10-29 15:25 ` erik quanstrom
  2011-10-29 16:18   ` Lucio De Re
  2011-10-29 15:32 ` Charles Forsyth
  2011-10-29 15:54 ` Charles Forsyth
  2 siblings, 1 reply; 11+ messages in thread
From: erik quanstrom @ 2011-10-29 15:25 UTC (permalink / raw)
  To: lucio, 9fans

; 9diff com64.c
/n/sources/plan9//sys/src/cmd/cc/com64.c:275,281 - com64.c:275,280
  		case OAS:
  		case OIND:
  		case OLIST:
- 		case OCOMMA:
  			return 1;
  		case OADD:
  			a = nodaddv;

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [9fans] ARM compiler shortcoming?
@ 2011-10-29 15:29 Lucio De Re
  2011-10-29 15:25 ` erik quanstrom
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Lucio De Re @ 2011-10-29 15:29 UTC (permalink / raw)
  To: 9fans

My guess is that the ARM compiler does not like 64-bit values in
conditional expressions.  The following C snippet:

	typedef unsigned long long	uvlong;

	uvlong uvinf    = ((uvlong)0x7FF00000<<32)|0x00000000;
	uvlong uvneginf = ((uvlong)0xFFF00000<<32)|0x00000000;

	double u2d(uvlong v);

	double
	__Inf(int sign)
	{
		return u2d(sign < 0 ? uvneginf : uvinf);
	}

compiled with 8c seems OK, but with 5c causes an error:

	% 5c -FTVw /tmp/nan64.c
	/tmp/nan64.c:11 unknown vlong LIST

Using an if statement seems to get rid of the problem.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 15:29 [9fans] ARM compiler shortcoming? Lucio De Re
  2011-10-29 15:25 ` erik quanstrom
@ 2011-10-29 15:32 ` Charles Forsyth
  2011-10-29 16:09   ` Lucio De Re
  2011-10-29 15:54 ` Charles Forsyth
  2 siblings, 1 reply; 11+ messages in thread
From: Charles Forsyth @ 2011-10-29 15:32 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

i've got a 5[acl] tucked away that does 64-bit operations, although
i think that particular case can be fixed more simply.

On 29 October 2011 16:29, Lucio De Re <lucio@proxima.alt.za> wrote:
> My guess is that the ARM compiler does not like 64-bit values in
> conditional expressions.  The following C snippet:
>
>        typedef unsigned long long      uvlong;
>
>        uvlong uvinf    = ((uvlong)0x7FF00000<<32)|0x00000000;
>        uvlong uvneginf = ((uvlong)0xFFF00000<<32)|0x00000000;
>
>        double u2d(uvlong v);
>
>        double
>        __Inf(int sign)
>        {
>                return u2d(sign < 0 ? uvneginf : uvinf);
>        }
>
> compiled with 8c seems OK, but with 5c causes an error:
>
>        % 5c -FTVw /tmp/nan64.c
>        /tmp/nan64.c:11 unknown vlong LIST
>
> Using an if statement seems to get rid of the problem.
>
> ++L
>
>
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 15:29 [9fans] ARM compiler shortcoming? Lucio De Re
  2011-10-29 15:25 ` erik quanstrom
  2011-10-29 15:32 ` Charles Forsyth
@ 2011-10-29 15:54 ` Charles Forsyth
  2011-10-29 16:08   ` Lucio De Re
  2 siblings, 1 reply; 11+ messages in thread
From: Charles Forsyth @ 2011-10-29 15:54 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

i've tried this example with a cc that has com64.c unchanged from sources
(ie, without the change erik suggested),
and a 5c that has no relevant changes at all, and it was fine.

On 29 October 2011 16:29, Lucio De Re <lucio@proxima.alt.za> wrote:
> My guess is that the ARM compiler does not like 64-bit values in
> conditional expressions.  The following C snippet:
>
>        typedef unsigned long long      uvlong;
>
>        uvlong uvinf    = ((uvlong)0x7FF00000<<32)|0x00000000;
>        uvlong uvneginf = ((uvlong)0xFFF00000<<32)|0x00000000;
>
>        double u2d(uvlong v);
>
>        double
>        __Inf(int sign)
>        {
>                return u2d(sign < 0 ? uvneginf : uvinf);
>        }
>
> compiled with 8c seems OK, but with 5c causes an error:
>
>        % 5c -FTVw /tmp/nan64.c
>        /tmp/nan64.c:11 unknown vlong LIST
>
> Using an if statement seems to get rid of the problem.
>
> ++L
>
>
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 15:54 ` Charles Forsyth
@ 2011-10-29 16:08   ` Lucio De Re
  0 siblings, 0 replies; 11+ messages in thread
From: Lucio De Re @ 2011-10-29 16:08 UTC (permalink / raw)
  To: 9fans

> i've tried this example with a cc that has com64.c unchanged from sources
> (ie, without the change erik suggested),
> and a 5c that has no relevant changes at all, and it was fine.

I'm too stupid to reach the right conclusion from what you are saying:
does this mean that I have a dated 5c?  I'm not sure what Erik's
change is intended for, but I doubt it will fix the problem.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 16:09   ` Lucio De Re
@ 2011-10-29 16:09     ` Charles Forsyth
  2011-10-29 16:40       ` Lucio De Re
  0 siblings, 1 reply; 11+ messages in thread
From: Charles Forsyth @ 2011-10-29 16:09 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

sorry, i was misleading. i meant a 5c that does vlongs more directly,
not a 5c that does the new arm 64-bit operations. that compiler would
have a different name.

> i've got a 5[acl] tucked away that does 64-bit operations



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 15:32 ` Charles Forsyth
@ 2011-10-29 16:09   ` Lucio De Re
  2011-10-29 16:09     ` Charles Forsyth
  0 siblings, 1 reply; 11+ messages in thread
From: Lucio De Re @ 2011-10-29 16:09 UTC (permalink / raw)
  To: 9fans

> i've got a 5[acl] tucked away that does 64-bit operations, although
> i think that particular case can be fixed more simply.

Will you please upload what you can find somewhere public?

I don't know the ARM at all, but the convergence of Go, Android and
64-bit ARM chips in mobile phones can't be too distant.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 15:25 ` erik quanstrom
@ 2011-10-29 16:18   ` Lucio De Re
  2011-10-29 16:28     ` Charles Forsyth
  0 siblings, 1 reply; 11+ messages in thread
From: Lucio De Re @ 2011-10-29 16:18 UTC (permalink / raw)
  To: 9fans

> /sys/src/cmd/cc/com64.c:275,281

The context is:

int
com64(Node *n)
{
	...
		switch(n->op) {
		default:
			diag(n, "unknown vlong %O", n->op);
		case OFUNC:
			n->complex = FNX;
		case ORETURN:
		case OAS:
		case OIND:
		case OLIST:
		case OCOMMA:
			return 1;
		case OADD:
			a = nodaddv;
			goto setbop;
		case OSUB:
	...
}

and it seems to me that a better answer would be to change the error
message to something like:

	"undefined 64-bit operation: %O"

I can't see much reason to stick to vlong when it is clear that 64-bit
handling is involved.

I do wonder why 8c isn't plagued by the same problem.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 16:18   ` Lucio De Re
@ 2011-10-29 16:28     ` Charles Forsyth
  2011-10-29 16:42       ` Lucio De Re
  0 siblings, 1 reply; 11+ messages in thread
From: Charles Forsyth @ 2011-10-29 16:28 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

i've just copied across and compiled cc and 5c from sources,and that
code you posted earlier compiled without fuss.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 16:09     ` Charles Forsyth
@ 2011-10-29 16:40       ` Lucio De Re
  0 siblings, 0 replies; 11+ messages in thread
From: Lucio De Re @ 2011-10-29 16:40 UTC (permalink / raw)
  To: 9fans

> sorry, i was misleading. i meant a 5c that does vlongs more directly,
> not a 5c that does the new arm 64-bit operations. that compiler would
> have a different name.

I seem to recall that ARM 64-bit emulation is one of Go's open TODOs.
I think thie plethora of (sub-)architectures is terribly confusing,
but it seems that what you have ought to be available, even if only
for inspection.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] ARM compiler shortcoming?
  2011-10-29 16:28     ` Charles Forsyth
@ 2011-10-29 16:42       ` Lucio De Re
  0 siblings, 0 replies; 11+ messages in thread
From: Lucio De Re @ 2011-10-29 16:42 UTC (permalink / raw)
  To: 9fans

> i've just copied across and compiled cc and 5c from sources,and that
> code you posted earlier compiled without fuss.

Hm, that needs investigating, I know I have messed around with 5[acl]
for the Sheeva, but I expected regular replicas to take care of that.
Mind you, that's bad thinking, as replica does not extend outside the
386 architecture for binaries.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-10-29 16:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-29 15:29 [9fans] ARM compiler shortcoming? Lucio De Re
2011-10-29 15:25 ` erik quanstrom
2011-10-29 16:18   ` Lucio De Re
2011-10-29 16:28     ` Charles Forsyth
2011-10-29 16:42       ` Lucio De Re
2011-10-29 15:32 ` Charles Forsyth
2011-10-29 16:09   ` Lucio De Re
2011-10-29 16:09     ` Charles Forsyth
2011-10-29 16:40       ` Lucio De Re
2011-10-29 15:54 ` Charles Forsyth
2011-10-29 16:08   ` Lucio De Re

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).