From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.devel Subject: Re: Attempting to unbox struct fields Date: Mon, 29 Feb 2016 16:09:01 -0500 Message-ID: References: <8737scubaj.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87h9gscgpt.fsf@netris.org> <87lh6376p2.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1456780148 30187 80.91.229.3 (29 Feb 2016 21:09:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Feb 2016 21:09:08 +0000 (UTC) Cc: guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 29 22:09:07 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aaV3y-0001u1-Tc for guile-devel@m.gmane.org; Mon, 29 Feb 2016 22:09:07 +0100 Original-Received: from localhost ([::1]:39170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaV3x-0001B9-SZ for guile-devel@m.gmane.org; Mon, 29 Feb 2016 16:09:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaV3v-0001B4-Jd for guile-devel@gnu.org; Mon, 29 Feb 2016 16:09:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaV3u-0006BO-La for guile-devel@gnu.org; Mon, 29 Feb 2016 16:09:03 -0500 Original-Received: from mail-yk0-x234.google.com ([2607:f8b0:4002:c07::234]:35028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaV3u-0006BK-G3 for guile-devel@gnu.org; Mon, 29 Feb 2016 16:09:02 -0500 Original-Received: by mail-yk0-x234.google.com with SMTP id r207so68961051ykd.2 for ; Mon, 29 Feb 2016 13:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=AlgCf6WxDlxJq0XwNwcWTRwQl8rVAAIBFJw0QzuoyQQ=; b=GGycz7yTBjfcWGuUF7rRs+mv4PftBRK4otiHShfCJduI9zsjC/kto8p+qEe22do5Qx c4T8vnx5sdU7XbSQcEieUdGJmKGQ20GQYVdSEgLVFQJNRZF2Absxwehj69Hf62DuFpkj rcZqKJJ/b/A5aoyeaO9cjiZFWayfb4nhgQloH3uXnJJ0uYPEESHitFjwfNshQnz6GtzQ 8sTg0dGgfU9emL9r7l9UoGIuEv51hirKoBYsbKUpx4aEDTmxs3zGa/3URb0ProAUYSPz xnRRHbX2rGasGCQJshQTfS/QaBRZHaw086BRyZ472+NXqitavEpguVbGJCrbx8pUBq10 WkGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=AlgCf6WxDlxJq0XwNwcWTRwQl8rVAAIBFJw0QzuoyQQ=; b=P/9vdA18ojksnut/kn+Y85ZwauKY7zOaZudfaYsLIHbZaKfAyBQTTDl8XY0aQyiezw vfXl0/xk9z5Xtq/BSxyeacFR8O1tI024oGztf5bdqW0PBSpMx+coZwPZr4yS3UCmoCce Xk3u9kLgfMqomM9fM47DDe3aMSz3M/T+d58HYahuAg60zpQ3ZsUeYge70ALqv7wc2epG 4/yOy/mNS/UrpoieKIFMsixBXmWchufdimK38wr+8rylq1sKTooHAeC5yxYJcmVfOVBj odqtX/PuSZ6g2sll3x7u1rsgHYHMigtmloUCpBM7MI0J7wLANbtpBLNcwgHAV4/lgCJd 2V/A== X-Gm-Message-State: AD7BkJImzOnQRm1G5fkXMZvjHRPfT0zzeFK4nZoYPsbzJKpv3gZfqpp+KbWpadqNHKPcpQECXC2xw6L+ai7Hpw== X-Received: by 10.37.25.212 with SMTP id 203mr9880393ybz.163.1456780142023; Mon, 29 Feb 2016 13:09:02 -0800 (PST) Original-Received: by 10.37.25.86 with HTTP; Mon, 29 Feb 2016 13:09:01 -0800 (PST) In-Reply-To: <87lh6376p2.fsf@netris.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c07::234 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:18201 Archived-At: On Mon, Feb 29, 2016 at 12:43 PM, Mark H Weaver wrote: > "Thompson, David" writes: > >>> The first thing I noticed is that the patch assumes that doubles are the >>> same size as pointers. Obviously this is not the case on 32-bit >>> systems. What's the plan for those systems? >> >> Yeah, I just hacked this together on my x86_64 system and paid no mind >> to portability. I was hoping that you or Andy or Ludovic would have >> an idea for how to address portability issues. :) > > I think the approach we need to take is that for 32-bit systems, doubles > will need to use two consecutive slots. Furthermore, those slots will > either need to be aligned (i.e. the first slot must have an even index) > or else the code that accesses 'double' struct fields will need to > perform the access carefully, perhaps by copying each half separately > into a local 'union' and then copying the double from there. After talking with Andy on #guile for a bit, it has become apparent that unboxing these fields will only be of limited utility. For example, it would be nice to eventually handle arrays of unboxed data like in C with an array of structs, but unboxing struct fields doesn't get us any closer to such a goal. Thus, I am going to drop this work and find another optimization to focus on. Thanks anyway. It's been an educational experience. - Dave