From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31058 invoked by alias); 20 Sep 2009 14:01:25 -0000 Received: (qmail 30811 invoked by uid 22791); 20 Sep 2009 14:01:24 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Sep 2009 14:01:18 +0000 Received: by fg-out-1718.google.com with SMTP id 16so535944fgg.8 for ; Sun, 20 Sep 2009 07:01:15 -0700 (PDT) Received: by 10.86.220.11 with SMTP id s11mr3658071fgg.47.1253455275598; Sun, 20 Sep 2009 07:01:15 -0700 (PDT) Received: from yakj.usersys.redhat.com ([85.93.118.17]) by mx.google.com with ESMTPS id l12sm2060200fgb.14.2009.09.20.07.01.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 20 Sep 2009 07:01:14 -0700 (PDT) Message-ID: <4AB635A9.10402@gnu.org> Date: Sun, 20 Sep 2009 14:01:00 -0000 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Zolt=E1n_K=F3csi?= CC: gcc@gcc.gnu.org Subject: Re: Bitfields References: <20090920233132.0a713e96@manocska.bendor.com.au> In-Reply-To: <20090920233132.0a713e96@manocska.bendor.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00382.txt.bz2 > reg.field1 = val1, reg.field2 = val2; > > would then turn into fetch, mask with a combined mask of field1 and > field2, or val1, or val2, store. You can also do the RMW yourself: declare the register volatile, but not the fields of it, and copy in/out of the register manually. volatile struct reg x; ... { struct reg mine = x; mine.field1 = true; mine.field2 = 0; mine.field3++; x = mine; } > Is it a completely brain-dead idea? If I understood it correctly, it would not be standard compliant. Paolo