From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Henderson To: egcs@cygnus.com Subject: Re: asm and "cc" "memory" volatile etc.. (slightly offtopic) Date: Tue, 11 Nov 1997 12:13:00 -0000 Message-id: <19971111120117.41339@dot.cygnus.com> References: <19971111102912.23695@atrey.karlin.mff.cuni.cz> <12014.879271161@hurl.cygnus.com> X-SW-Source: 1997-11/msg00419.html On Tue, Nov 11, 1997 at 10:59:21AM -0700, Jeffrey A Law wrote: > > Is there some way to say gcc, that is just updates given block of memory > > (rtl expression for memcpy dont say clobbers:memory but says set BLK... > > is there any way to write this in asm?) > I'm not aware of any way to selectively tell gcc that only a certain block > of memory is read/clobbered by an asm (or any BLKmode instruction). The following has been found to be effective. struct large_struct { unsigned long buf[1234]; }; #define m(x) (*(struct large_struct *)(x)) extern inline int test_bit(int nr, void *addr) { int ret; __asm__("btl %2,%1\n\tsbbl %0,%0" : "=r"(ret) : "m"(m(addr)), "ir"(nr)); return ret; } r~