9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
[parent not found: <a27dc8e08d6f5936960797156b50a514@plan9.ucalgary.ca>]
* [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] <85082ec2f1cbf83a5db6ecf7ff111f3b@plan9.ucalgary.ca>
2005-05-06 20:34 ` [9fans] 8c dying with out of fixed registers "Nils O. Selåsdal"
2005-05-06 21:00   ` andrey mirtchovski
2005-05-06 21:08     ` andrey mirtchovski
     [not found] <a27dc8e08d6f5936960797156b50a514@plan9.ucalgary.ca>
2005-05-06 21:17 ` "Nils O. Selåsdal"
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).