guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-10-226-g1


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-10-226-g1b68d62
Date: Mon, 31 May 2010 22:44:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=1b68d6276260f68b07103fc6a792effcc135c063

The branch, master has been updated
       via  1b68d6276260f68b07103fc6a792effcc135c063 (commit)
       via  daccfef47b6b226226754ccbb515a56cafea58b2 (commit)
       via  31d328de607a4a0e150146348c332e0d47f88148 (commit)
      from  715416f68d0971fc03b7fca654c046b10e5df43b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1b68d6276260f68b07103fc6a792effcc135c063
Author: Ludovic Courtès <address@hidden>
Date:   Tue Jun 1 00:42:58 2010 +0200

    Fix `VM_VALIDATE_BYTEVECTOR' macro wrt. trailing semicolons.
    
    * libguile/vm-i-scheme.c (VM_VALIDATE_BYTEVECTOR): Enclose in "do { }
      while (0)".

commit daccfef47b6b226226754ccbb515a56cafea58b2
Author: Ludovic Courtès <address@hidden>
Date:   Tue Jun 1 00:40:00 2010 +0200

    Fix unaligned accesses by the bytevector instructions.
    
    * libguile/vm-i-scheme.c (ALIGNED_P): New macro.
      (BV_FIXABLE_INT_REF, BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET,
      BV_INT_SET, BV_FLOAT_SET): Check the alignment of the pointer instead
      of checking "i % size == 0".  This fixes bus errors on
      `sparc64-linux-gnu'.
    
    * libguile/vm.c: Include <alignof.h>.

commit 31d328de607a4a0e150146348c332e0d47f88148
Author: Ludovic Courtès <address@hidden>
Date:   Tue Jun 1 00:02:35 2010 +0200

    Upgrade manual to GFDLv1.3+.
    
    * doc/ref/fdl.texi: Upgrade to GFDLv1.3.
    
    * doc/ref/guile.texi: Change copying notice to "Version 1.3 or any later
      version".
      (GNU Free Documentation License): New node, formerly in `fdl.texi'.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/fdl.texi       |   90 ++++++++++++++++++++-----
 doc/ref/guile.texi     |    5 +-
 libguile/vm-i-scheme.c |  170 ++++++++++++++++++++++++++++++------------------
 libguile/vm.c          |    1 +
 4 files changed, 183 insertions(+), 83 deletions(-)

diff --git a/doc/ref/fdl.texi b/doc/ref/fdl.texi
index 17fe148..8805f1a 100644
--- a/doc/ref/fdl.texi
+++ b/doc/ref/fdl.texi
@@ -1,13 +1,12 @@
address@hidden The GNU Free Documentation License.
address@hidden Version 1.3, 3 November 2008
 
address@hidden GNU Free Documentation License
address@hidden GNU Free Documentation License
-
address@hidden FDL, GNU Free Documentation License
address@hidden Version 1.2, November 2002
address@hidden This file is intended to be included within another document,
address@hidden hence no sectioning command or @node.
 
 @display
-Copyright @copyright{} 2000,2001,2002, 2006 Free Software Foundation, Inc.
-51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, 
Inc.
address@hidden://fsf.org/}
 
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
@@ -112,6 +111,9 @@ formats which do not have any title page as such, ``Title 
Page'' means
 the text near the most prominent appearance of the work's title,
 preceding the beginning of the body of the text.
 
+The ``publisher'' means any person or entity that distributes copies
+of the Document to the public.
+
 A section ``Entitled XYZ'' means a named subunit of the Document whose
 title either is precisely XYZ or contains XYZ in parentheses following
 text that translates XYZ in another language.  (Here XYZ stands for a
@@ -380,13 +382,30 @@ title.
 @item
 TERMINATION
 
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License.  Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License.  However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
 
 @item
 FUTURE REVISIONS OF THIS LICENSE
@@ -404,11 +423,46 @@ following the terms and conditions either of that 
specified version or
 of any later version that has been published (not as a draft) by the
 Free Software Foundation.  If the Document does not specify a version
 number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
+as a draft) by the Free Software Foundation.  If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
address@hidden
+RELICENSING
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works.  A
+public wiki that anybody can edit is an example of such a server.  A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
 @end enumerate
 
 @page
address@hidden ADDENDUM: How to use this License for your documents
address@hidden ADDENDUM: How to use this License for your documents
 
 To use this License in a document you have written, include a copy of
 the License in the document and put the following copyright and
@@ -418,7 +472,7 @@ license notices just after the title page:
 @group
   Copyright (C)  @var{year}  @var{your name}.
   Permission is granted to copy, distribute and/or modify this document
-  under the terms of the GNU Free Documentation License, Version 1.2
+  under the terms of the GNU Free Documentation License, Version 1.3
   or any later version published by the Free Software Foundation;
   with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
   Texts.  A copy of the license is included in the section entitled ``GNU
@@ -427,7 +481,7 @@ license notices just after the title page:
 @end smallexample
 
 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with...Texts.'' line with this:
+replace the address@hidden'' line with this:
 
 @smallexample
 @group
diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi
index 32cf1d6..06bb9bf 100644
--- a/doc/ref/guile.texi
+++ b/doc/ref/guile.texi
@@ -17,7 +17,7 @@ Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2009, 2010 Free
 Software Foundation.
 
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with
 no Invariant Sections, with the Front-Cover Texts being ``A GNU
 Manual,'' and with the Back-Cover Text ``You are free to copy and
@@ -423,6 +423,9 @@ merely familiar with Scheme to being a real hacker.
 
 @include autoconf.texi
 
address@hidden GNU Free Documentation License
address@hidden GNU Free Documentation License
+
 @include fdl.texi
 
 @iftex
diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
index fb1af11..2b0c782 100644
--- a/libguile/vm-i-scheme.c
+++ b/libguile/vm-i-scheme.c
@@ -543,11 +543,16 @@ VM_DEFINE_INSTRUCTION (171, slot_set, "slot-set", 0, 3, 0)
 /*
  * Bytevectors
  */
-#define VM_VALIDATE_BYTEVECTOR(x)               \
-  if (SCM_UNLIKELY (!SCM_BYTEVECTOR_P (x)))     \
-    { finish_args = x;                          \
-      goto vm_error_not_a_bytevector;           \
-    }
+#define VM_VALIDATE_BYTEVECTOR(x)              \
+  do                                           \
+    {                                          \
+      if (SCM_UNLIKELY (!SCM_BYTEVECTOR_P (x)))        \
+       {                                       \
+         finish_args = x;                      \
+         goto vm_error_not_a_bytevector;       \
+       }                                       \
+    }                                          \
+  while (0)
 
 #define BV_REF_WITH_ENDIANNESS(stem, fn_stem)                           \
 {                                                                       \
@@ -562,6 +567,10 @@ VM_DEFINE_INSTRUCTION (171, slot_set, "slot-set", 0, 3, 0)
   }                                                                     \
 }
 
+/* Return true (non-zero) if PTR has suitable alignment for TYPE.  */
+#define ALIGNED_P(ptr, type)                   \
+  ((scm_t_uintptr) (ptr) % alignof (type) == 0)
+
 VM_DEFINE_FUNCTION (172, bv_u16_ref, "bv-u16-ref", 3)
 BV_REF_WITH_ENDIANNESS (u16, u16)
 VM_DEFINE_FUNCTION (173, bv_s16_ref, "bv-s16-ref", 3)
@@ -583,15 +592,19 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_FIXABLE_INT_REF(stem, fn_stem, type, size)                  \
 {                                                                      \
-  long i = 0;                                                          \
+  long i;                                                              \
+  const scm_t_ ## type *int_ptr;                                       \
   ARGS2 (bv, idx);                                                     \
+                                                                       \
   VM_VALIDATE_BYTEVECTOR (bv);                                         \
+  i = SCM_I_INUM (idx);                                                        
\
+  int_ptr = (scm_t_ ## type *) (SCM_BYTEVECTOR_CONTENTS (bv) + i);     \
+                                                                       \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                    \
-                  && ((i = SCM_I_INUM (idx)) >= 0)                     \
+                  && (i >= 0)                                          \
                   && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))          \
-                  && (i % size == 0)))                                 \
-    RETURN (SCM_I_MAKINUM (*(scm_t_##type*)                            \
-                           (SCM_BYTEVECTOR_CONTENTS (bv) + i)));       \
+                  && (ALIGNED_P (int_ptr, scm_t_ ## type))))           \
+    RETURN (SCM_I_MAKINUM (*int_ptr));                                 \
   else                                                                 \
     {                                                                  \
       SYNC_REGISTER ();                                                        
\
@@ -601,14 +614,20 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_INT_REF(stem, type, size)                                   \
 {                                                                      \
-  long i = 0;                                                          \
+  long i;                                                              \
+  const scm_t_ ## type *int_ptr;                                       \
   ARGS2 (bv, idx);                                                     \
+                                                                       \
   VM_VALIDATE_BYTEVECTOR (bv);                                         \
+  i = SCM_I_INUM (idx);                                                        
\
+  int_ptr = (scm_t_ ## type *) (SCM_BYTEVECTOR_CONTENTS (bv) + i);     \
+                                                                       \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                    \
-                  && ((i = SCM_I_INUM (idx)) >= 0)                     \
+                  && (i >= 0)                                          \
                   && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))          \
-                  && (i % size == 0)))                                 \
-    { scm_t_##type x = (*(scm_t_##type*)(SCM_BYTEVECTOR_CONTENTS (bv) + i)); \
+                  && (ALIGNED_P (int_ptr, scm_t_ ## type))))           \
+    {                                                                  \
+      scm_t_ ## type x = *int_ptr;                                     \
       if (SCM_FIXABLE (x))                                             \
         RETURN (SCM_I_MAKINUM (x));                                    \
       else                                                             \
@@ -626,15 +645,20 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_FLOAT_REF(stem, fn_stem, type, size)                                
\
 {                                                                      \
-  long i = 0;                                                          \
+  long i;                                                              \
+  const type *float_ptr;                                               \
   ARGS2 (bv, idx);                                                     \
+                                                                       \
   VM_VALIDATE_BYTEVECTOR (bv);                                         \
+  i = SCM_I_INUM (idx);                                                        
\
+  float_ptr = (type *) (SCM_BYTEVECTOR_CONTENTS (bv) + i);             \
+                                                                       \
   SYNC_REGISTER ();                                                    \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                    \
-                  && ((i = SCM_I_INUM (idx)) >= 0)                     \
+                  && (i >= 0)                                          \
                   && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))          \
-                  && (i % size == 0)))                                 \
-    RETURN (scm_from_double ((*(type*)(SCM_BYTEVECTOR_CONTENTS (bv) + i)))); \
+                  && (ALIGNED_P (float_ptr, type))))                   \
+    RETURN (scm_from_double (*float_ptr));                             \
   else                                                                 \
     RETURN (scm_bytevector_ ## fn_stem ## _native_ref (bv, idx));      \
 }
@@ -706,52 +730,70 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
 
 #undef BV_SET_WITH_ENDIANNESS
 
-#define BV_FIXABLE_INT_SET(stem, fn_stem, type, min, max, size)         \
-{                                                                       \
-  long i = 0, j = 0;                                                    \
-  SCM bv, idx, val; POP (val); POP (idx); POP (bv);                     \
-  VM_VALIDATE_BYTEVECTOR (bv);                                          \
-  if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
-                  && ((i = SCM_I_INUM (idx)) >= 0)                      \
-                  && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))           \
-                  && (i % size == 0)                                    \
-                  && (SCM_I_INUMP (val))                                \
-                  && ((j = SCM_I_INUM (val)) >= min)                    \
-                  && (j <= max)))                                       \
-    *(scm_t_##type*) (SCM_BYTEVECTOR_CONTENTS (bv) + i) = (scm_t_##type)j; \
-  else                                                                  \
-    scm_bytevector_##fn_stem##_set_x (bv, idx, val);                    \
-  NEXT;                                                                 \
-}
-
-#define BV_INT_SET(stem, type, size)                                    \
-{                                                                       \
-  long i = 0;                                                           \
-  SCM bv, idx, val; POP (val); POP (idx); POP (bv);                     \
-  VM_VALIDATE_BYTEVECTOR (bv);                                          \
-  if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
-                  && ((i = SCM_I_INUM (idx)) >= 0)                      \
-                  && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))           \
-                  && (i % size == 0)))                                  \
-    *(scm_t_##type*) (SCM_BYTEVECTOR_CONTENTS (bv) + i) = scm_to_##type (val); 
\
-  else                                                                  \
-    scm_bytevector_##stem##_native_set_x (bv, idx, val);                \
-  NEXT;                                                                 \
-}
-
-#define BV_FLOAT_SET(stem, fn_stem, type, size)                         \
-{                                                                       \
-  long i = 0;                                                           \
-  SCM bv, idx, val; POP (val); POP (idx); POP (bv);                     \
-  VM_VALIDATE_BYTEVECTOR (bv);                                          \
-  if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
-                  && ((i = SCM_I_INUM (idx)) >= 0)                      \
-                  && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))           \
-                  && (i % size == 0)))                                  \
-    *(type*) (SCM_BYTEVECTOR_CONTENTS (bv) + i) = scm_to_double (val);  \
-  else                                                                  \
-    scm_bytevector_##fn_stem##_native_set_x (bv, idx, val);             \
-  NEXT;                                                                 \
+#define BV_FIXABLE_INT_SET(stem, fn_stem, type, min, max, size)                
\
+{                                                                      \
+  long i, j = 0;                                                       \
+  SCM bv, idx, val;                                                    \
+  scm_t_ ## type *int_ptr;                                             \
+                                                                       \
+  POP (val); POP (idx); POP (bv);                                      \
+  VM_VALIDATE_BYTEVECTOR (bv);                                         \
+  i = SCM_I_INUM (idx);                                                        
\
+  int_ptr = (scm_t_ ## type *) (SCM_BYTEVECTOR_CONTENTS (bv) + i);     \
+                                                                       \
+  if (SCM_LIKELY (SCM_I_INUMP (idx)                                    \
+                  && (i >= 0)                                          \
+                  && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))          \
+                  && (ALIGNED_P (int_ptr, scm_t_ ## type))             \
+                  && (SCM_I_INUMP (val))                               \
+                  && ((j = SCM_I_INUM (val)) >= min)                   \
+                  && (j <= max)))                                      \
+    *int_ptr = (scm_t_ ## type) j;                                     \
+  else                                                                 \
+    scm_bytevector_ ## fn_stem ## _set_x (bv, idx, val);               \
+  NEXT;                                                                        
\
+}
+
+#define BV_INT_SET(stem, type, size)                                   \
+{                                                                      \
+  long i = 0;                                                          \
+  SCM bv, idx, val;                                                    \
+  scm_t_ ## type *int_ptr;                                             \
+                                                                       \
+  POP (val); POP (idx); POP (bv);                                      \
+  VM_VALIDATE_BYTEVECTOR (bv);                                         \
+  i = SCM_I_INUM (idx);                                                        
\
+  int_ptr = (scm_t_ ## type *) (SCM_BYTEVECTOR_CONTENTS (bv) + i);     \
+                                                                       \
+  if (SCM_LIKELY (SCM_I_INUMP (idx)                                    \
+                  && (i >= 0)                                          \
+                  && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))          \
+                  && (ALIGNED_P (int_ptr, scm_t_ ## type))))           \
+    *int_ptr = scm_to_ ## type (val);                                  \
+  else                                                                 \
+    scm_bytevector_ ## stem ## _native_set_x (bv, idx, val);           \
+  NEXT;                                                                        
\
+}
+
+#define BV_FLOAT_SET(stem, fn_stem, type, size)                        \
+{                                                              \
+  long i = 0;                                                  \
+  SCM bv, idx, val;                                            \
+  type *float_ptr;                                             \
+                                                               \
+  POP (val); POP (idx); POP (bv);                              \
+  VM_VALIDATE_BYTEVECTOR (bv);                                 \
+  i = SCM_I_INUM (idx);                                                \
+  float_ptr = (type *) (SCM_BYTEVECTOR_CONTENTS (bv) + i);     \
+                                                               \
+  if (SCM_LIKELY (SCM_I_INUMP (idx)                            \
+                  && (i >= 0)                                  \
+                  && (i + size <= SCM_BYTEVECTOR_LENGTH (bv))  \
+                  && (ALIGNED_P (float_ptr, type))))           \
+    *float_ptr = scm_to_double (val);                          \
+  else                                                         \
+    scm_bytevector_ ## fn_stem ## _native_set_x (bv, idx, val);        \
+  NEXT;                                                                \
 }
 
 VM_DEFINE_INSTRUCTION (198, bv_u8_set, "bv-u8-set", 0, 3, 0)
diff --git a/libguile/vm.c b/libguile/vm.c
index 972abf8..7a250d4 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -22,6 +22,7 @@
 
 #include <stdlib.h>
 #include <alloca.h>
+#include <alignof.h>
 #include <string.h>
 
 #include "libguile/bdw-gc.h"


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]