[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sx164 with matrox mga2



"Thomas Evans" <tom@23palmer.net> writes:

> Does GCC support some sort of "unaligned" type modifier?
> 
> I know Compaq's C compilers supported defining a pointer
> as "unaligned" hence forcing the proper instruction
> sequence to be generated for optimal unaligned accesses.

You can do something like this:

struct ul { unsigned l __attribute__((packed)); };
unsigned uldl(unsigned *p) { return ((struct ul *) p)->l; }
void ustl(unsigned s, unsigned *p) { ((struct ul *) p->l = l; }

memcpy(d, s, 4) should also generate reasonable code, I would have
thought, but actually, it doesn't... I'll check that...

But these are just ugly kludges, unaligned accesses should simply be
avoided.

-- 
	Falk


-- 
To UNSUBSCRIBE, email to debian-alpha-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: