From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: The mysterious =?utf-8?Q?=E2=80=98SCM=5FF=5FBYTEVECTOR=5FCONTIGUO?= =?utf-8?Q?US=E2=80=99?= Date: Wed, 11 Jan 2023 18:39:52 +0100 Message-ID: <87tu0xj7h3.fsf@gnu.org> References: <20230111150015.10219-1-ludo@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35518"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: Andy Wingo To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jan 11 18:40:20 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFf5H-0008sV-Ud for guile-devel@m.gmane-mx.org; Wed, 11 Jan 2023 18:40:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFf4v-0003KQ-4W; Wed, 11 Jan 2023 12:39:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFf4t-0003KC-EW for guile-devel@gnu.org; Wed, 11 Jan 2023 12:39:55 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFf4t-0002yf-5y; Wed, 11 Jan 2023 12:39:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=DL/wo65qw4qgVOxWQRn1Ns5eezPW9GsBvD5SDhPqfQg=; b=rzD/3Wj3tW5cR9ntobOK O81y5THcWG0M2yMeQfkHvoxJPqi5Xcw3M7/3djjlPG1lZMTY2gJjvhrs4FzQ3jDaf5kiFpdp5HnV2 NUJgOMiU3AG0F6FDjNWMyW/yJeOqa6vRqVM6k2N6ECcy3QC3gNBPeb3BmRN+7yUmzF7U/91UN2waY ku6Y+wiNRILmaAxH8z1GB5Nd7w8vrzIEw6eSinZIUvs09tb2UcdpbYs3tDeChpx/+9Ac9q9CFJCb4 aKJKArxcouFayX69mXc3d6CngLtUiWK2oLwcuZKQz84E3VpRJv5/+351B+KKkYhlE6QLyJbmopu1A 9MtRqEzYrbJPSw==; Original-Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFf4s-0004pj-33; Wed, 11 Jan 2023 12:39:54 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 22 =?utf-8?Q?Niv=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Sel X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: <20230111150015.10219-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cou?= =?utf-8?Q?rt=C3=A8s=22's?= message of "Wed, 11 Jan 2023 16:00:15 +0100") X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21562 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skribis: > This is an updated version of the =E2=80=98bytevector-slice=E2=80=99 prim= itive I used in > the linker/assembler patch series=C2=B9 that I think is ready to go. While working on this, I noticed I might have to pay attention to =E2=80=98SCM_F_BYTEVECTOR_CONTIGUOUS=E2=80=99, as noted in the patch. But it turns out that flag isn=E2=80=99t really used. I found two places t= hat should add it and do not: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index 6b920c88a..fd7fdad0b 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -274,7 +274,8 @@ make_bytevector_from_buffer (size_t len, void *contents, c_len = len * (scm_i_array_element_type_sizes[element_type] / 8); - SCM_SET_BYTEVECTOR_FLAGS (ret, element_type); + SCM_SET_BYTEVECTOR_FLAGS (ret, + element_type | SCM_F_BYTEVECTOR_CONTIGUOUS); SCM_BYTEVECTOR_SET_LENGTH (ret, c_len); SCM_BYTEVECTOR_SET_CONTENTS (ret, contents); SCM_BYTEVECTOR_SET_PARENT (ret, SCM_BOOL_F); diff --git a/module/system/repl/debug.scm b/module/system/repl/debug.scm diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm index 165976363..61e0460ff 100644 --- a/module/system/vm/assembler.scm +++ b/module/system/vm/assembler.scm @@ -1857,8 +1857,9 @@ should be .data or .rodata), and return the resulting linker object. (define tc7-program #x45) (define tc7-bytevector #x4d) - ;; This flag is intended to be left-shifted by 7 bits. + ;; These flags are intended to be left-shifted by 7 bits. (define bytevector-immutable-flag #x200) + (define bytevector-contiguous-flag #x100) (define tc7-array #x5d) @@ -2026,6 +2027,7 @@ should be .data or .rodata), and return the resulting linker object. ;; Bytevector immutable flag also shifted ;; left. (ash (logior bytevector-immutable-flag + bytevector-contiguous-flag (array-type-code obj)) 7))))) (case word-size --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable There are probably more. Fundamentally, I=E2=80=99m not sure what this flag is supposed to mean. AF= AICS, there=E2=80=99s no way to create a non-contiguous bytevector (or SRFI-4 vec= tor). This flag was added in 7ed54fd36d2e381aa46ef8a7d2fc13a6776b573a. My guess is that it was part of plan that wasn=E2=80=99t carried out in the en= d. Andy, thoughts? :-) Thanks, Ludo=E2=80=99. --=-=-=--