9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] 8c dying with out of fixed registers
       [not found] <a27dc8e08d6f5936960797156b50a514@plan9.ucalgary.ca>
@ 2005-05-06 21:17 ` "Nils O. Selåsdal"
  0 siblings, 0 replies; 5+ messages in thread
From: "Nils O. Selåsdal" @ 2005-05-06 21:17 UTC (permalink / raw)
  To: 9fans

andrey mirtchovski wrote:
>>It only uses u.h, and I see nothing funny, thats even near a 32K limit, even
>>after cpp.
>>
>>Or did I just not understand your statement correctly. (*confused*)
> 
> 
> without an lstk() of the broken 8c binary everything is just
> speculation.  i didn't know any context, so i just suggested one bug
> that i know of as a possibility.  it wasn't even an educated guess
> (hence i omitted 9fans from the recipients list)

You can compile the snippet and lstk the broken 8c. That's why I tried to
massage it down to a single little sweet function, so others could try it
if they're up to the task ;-)
(Or is it only for me the piece originally posted suicides ?)


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

* Re: [9fans] 8c dying with out of fixed registers
  2005-05-06 21:00   ` andrey mirtchovski
@ 2005-05-06 21:08     ` andrey mirtchovski
  0 siblings, 0 replies; 5+ messages in thread
From: andrey mirtchovski @ 2005-05-06 21:08 UTC (permalink / raw)
  To: 9fans

> perhaps you should run cpp on the code to find out what it devolves to.

here's a one-liner in ffmpeg that went through a couple of macro
expansions (ultimately making it > 32K chars):

http://pages.cpsc.ucalgary.ca/~mirtchov/screenshots/ffmpeg.gif



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

* Re: [9fans] 8c dying with out of fixed registers
  2005-05-06 20:34 ` "Nils O. Selåsdal"
@ 2005-05-06 21:00   ` andrey mirtchovski
  2005-05-06 21:08     ` andrey mirtchovski
  0 siblings, 1 reply; 5+ messages in thread
From: andrey mirtchovski @ 2005-05-06 21:00 UTC (permalink / raw)
  To: 9fans

> andrey mirtchovski wrote:
>> 8c has a 32K char limit for each line of code it processes.  i had a
>> copy somewhere with that limit increased to 128K, but that's just a
>> partial solution.
> That isn't the problem here though, as far as I can see.
> The snippet I mailed is a total of 569 bytes :-)
> ( the original code was also way below 32K.)

perhaps you should run cpp on the code to find out what it devolves to.



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

* Re: [9fans] 8c dying with out of fixed registers
       [not found] <85082ec2f1cbf83a5db6ecf7ff111f3b@plan9.ucalgary.ca>
@ 2005-05-06 20:34 ` "Nils O. Selåsdal"
  2005-05-06 21:00   ` andrey mirtchovski
  0 siblings, 1 reply; 5+ messages in thread
From: "Nils O. Selåsdal" @ 2005-05-06 20:34 UTC (permalink / raw)
  To: 9fans

andrey mirtchovski wrote:
> 8c has a 32K char limit for each line of code it processes.  i had a
> copy somewhere with that limit increased to 128K, but that's just a
> partial solution.
That isn't the problem here though, as far as I can see.
The snippet I mailed is a total of 569 bytes :-)
( the original code was also way below 32K.)



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

* [9fans] 8c dying with out of fixed registers
@ 2005-05-06 19:59 "Nils O. Selåsdal"
  0 siblings, 0 replies; 5+ messages in thread
From: "Nils O. Selåsdal" @ 2005-05-06 19:59 UTC (permalink / raw)
  To: 9fans

Hello,
I've been trying to compile some crypto code, and it seems 8c
isn't always too happy about it. I eventually got the monster ting
reduced to the below (now very-nonsense code) snippet which dies with;
a.c:22 out of fixed registers
8c 2655: suicide: sys: trap: fault read addr=0x0 pc=0x00036d93

So, for anyone that's bored, and wants to fix the compiler:
#include <u.h>

static uvlong T7[256];

void f(unsigned char *key)
{
	uvlong K1;
	int r;
	uvlong *S = T7;

	for (r = 1; r < 16; r++) {
		K1 =
		    T7[S[(int)(K1 >> 56)       ] & 0xff] ^
		    T7[(int)S[(int)(K1 >> 48) & 0xff] & 0xff] ^
		    T7[(int)S[(int)(K1 >> 40) & 0xff] & 0xff] ^
		    T7[(int)S[(int)(K1 >> 32) & 0xff] & 0xff] ^
		    T7[(int)S[(int)(K1 >> 24) & 0xff] & 0xff] ^
		    T7[(int)S[(int)(K1 >> 16) & 0xff] & 0xff] ^
		    T7[(int)S[(int)(K1 >>  8) & 0xff] & 0xff] ^
		    T7[(int)S[(int)(K1      ) & 0xff] & 0xff];
	}
}


In the mean time, I'll rewrite the piece of code...

--
Nils O. Selåsdal


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

end of thread, other threads:[~2005-05-06 21:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <a27dc8e08d6f5936960797156b50a514@plan9.ucalgary.ca>
2005-05-06 21:17 ` [9fans] 8c dying with out of fixed registers "Nils O. Selåsdal"
     [not found] <85082ec2f1cbf83a5db6ecf7ff111f3b@plan9.ucalgary.ca>
2005-05-06 20:34 ` "Nils O. Selåsdal"
2005-05-06 21:00   ` andrey mirtchovski
2005-05-06 21:08     ` andrey mirtchovski
2005-05-06 19:59 "Nils O. Selåsdal"

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