9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 8c(pcc)
@ 2005-02-07  7:13 tapique
  2005-02-08  4:55 ` Russ Cox
  0 siblings, 1 reply; 6+ messages in thread
From: tapique @ 2005-02-07  7:13 UTC (permalink / raw)
  To: 9fans

pcc complains:
	sigsetjmp: DoPlot: not defined

i found the following in /sys/src/ape/lib/ap/plan9/signal.c
/* BAD CODE - see /sys/src/ape/lib/ap/$objtype/setjmp.s for real code

does it mean i need to recompile libap.a before i can use it? Or what am
i missing??

Thanks a lot,
++pac.




--------------------------
Posílejte SMS přes internet zdarma a bez reklamy. Pouze s TISCALI.
Více na http://www.tiscali.cz





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

* Re: [9fans] 8c(pcc)
  2005-02-07  7:13 [9fans] 8c(pcc) tapique
@ 2005-02-08  4:55 ` Russ Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Russ Cox @ 2005-02-08  4:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

like the comment says, the code is in /sys/src/ape/lib/ap/386/setjmp.s.

g% nm /386/lib/ape/libap.a |grep sigsetjmp
setjmp.8:         T sigsetjmp
g% 

check yours.
russ


On Mon, 7 Feb 2005 08:13:24 +0100, tapique@tiscali.cz
<tapique@tiscali.cz> wrote:
> pcc complains:
>         sigsetjmp: DoPlot: not defined
> 
> i found the following in /sys/src/ape/lib/ap/plan9/signal.c
> /* BAD CODE - see /sys/src/ape/lib/ap/$objtype/setjmp.s for real code
> 
> does it mean i need to recompile libap.a before i can use it? Or what am
> i missing??
> 
> Thanks a lot,
> ++pac.
> 
> --------------------------
> Posílejte SMS přes internet zdarma a bez reklamy. Pouze s TISCALI.
> Více na http://www.tiscali.cz
> 
>


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

* Re: [9fans] 8c (pcc)
  2005-01-21  7:18 [9fans] 8c (pcc) cej
  2005-01-21  7:27 ` Russ Cox
@ 2005-01-23 20:35 ` Bruce Ellis
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce Ellis @ 2005-01-23 20:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I cant reproduce this - after trying several combinations of types.

What are the types of the variables?  This example compiles fine.
-----

#include	<u.h>
#include	<libc.h>

long	result;
long	col, plane1, plane2;
uchar	tuplerow1[100][100], tuplerow2[100][100];

void
foo(void)
{
	result = (int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] ?
(int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2] :
(int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];
}

On Fri, 21 Jan 2005 08:18:36 +0100, cej@gli.cas.cz <cej@gli.cas.cz> wrote:
> 
> //1:
>  result = MIN(tuplerow1[col][plane1], tuplerow2[col][plane2]);
> //2:
>   x=tuplerow1[col][plane1];
>   y=tuplerow2[col][plane2];
>   result = MIN(x, y);
>   if((int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] )
>    result =  (int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2];
>   else
>    result =  (int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];
> //1:
> result =  (int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] ? (int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2] : (int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];
> 
> //2:
>   if((int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] )
>    result =  (int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2];
>   else
>    result =  (int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];
> 
> 1's die with error message : <eof> out of fixed registers, while 2's are OK.
> Could someone explain, why?
> Thanks, regards,
> ++pac.
> 
>


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

* Re: [9fans] 8c (pcc)
  2005-01-21  7:27 ` Russ Cox
@ 2005-01-21 22:42   ` Bruce Ellis
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Ellis @ 2005-01-21 22:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

i'm presuming that MIN() is the usual macro involving ? : and
that i could probably fix this - tho i have no time at the moment.
8c generally avoids running out of registers rather well, though
i dare you to follow the logic.  as ? : is not common in plan9
code and not highly regarded i guess this case was missed.

brucee

On Fri, 21 Jan 2005 02:27:56 -0500, Russ Cox <russcox@gmail.com> wrote:
> > 1's die with error message : <eof> out of fixed registers, while 2's are OK.
> > Could someone explain, why?
> > Thanks, regards,
> > ++pac.
> 
> apparently the register allocator used for expressions
> is not doing a good job when it runs out of registers.
> when you rewrote the expressions to use explicit
> temporaries, you simplified its job.
> 
> russ
>


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

* Re: [9fans] 8c (pcc)
  2005-01-21  7:18 [9fans] 8c (pcc) cej
@ 2005-01-21  7:27 ` Russ Cox
  2005-01-21 22:42   ` Bruce Ellis
  2005-01-23 20:35 ` Bruce Ellis
  1 sibling, 1 reply; 6+ messages in thread
From: Russ Cox @ 2005-01-21  7:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> 1's die with error message : <eof> out of fixed registers, while 2's are OK.
> Could someone explain, why?
> Thanks, regards,
> ++pac.

apparently the register allocator used for expressions
is not doing a good job when it runs out of registers.
when you rewrote the expressions to use explicit 
temporaries, you simplified its job.

russ


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

* [9fans] 8c (pcc)
@ 2005-01-21  7:18 cej
  2005-01-21  7:27 ` Russ Cox
  2005-01-23 20:35 ` Bruce Ellis
  0 siblings, 2 replies; 6+ messages in thread
From: cej @ 2005-01-21  7:18 UTC (permalink / raw)
  To: 9fans


//1:
  result = MIN(tuplerow1[col][plane1], tuplerow2[col][plane2]);
//2:
   x=tuplerow1[col][plane1];
   y=tuplerow2[col][plane2];
   result = MIN(x, y);
   if((int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] ) 
    result =  (int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2];
   else
    result =  (int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];
//1:
result =  (int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] ? (int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2] : (int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];

//2:
   if((int)tuplerow1[col][plane1] > (int)tuplerow2[col][plane2] ) 
    result =  (int)tuplerow1[col][plane1] - (int)tuplerow2[col][plane2];
   else
    result =  (int)tuplerow2[col][plane2] - (int)tuplerow1[col][plane1];

1's die with error message : <eof> out of fixed registers, while 2's are OK.
Could someone explain, why?
Thanks, regards,
++pac.

 

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

end of thread, other threads:[~2005-02-08  4:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07  7:13 [9fans] 8c(pcc) tapique
2005-02-08  4:55 ` Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2005-01-21  7:18 [9fans] 8c (pcc) cej
2005-01-21  7:27 ` Russ Cox
2005-01-21 22:42   ` Bruce Ellis
2005-01-23 20:35 ` Bruce Ellis

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).