Optimize 'string-hash'.
[bpt/guile.git] / libguile / vm-i-scheme.c
index dd2150d..162efab 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -362,7 +362,7 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
       {                                                                        \
        scm_t_signed_bits rlo, rhi;                                     \
        asm ("smull %0, %1, %2, %3\n"                                   \
-            : "=r" (rlo), "=r" (rhi)                                   \
+            : "=&r" (rlo), "=&r" (rhi)                                 \
             : "r" (SCM_UNPACK (x) - scm_tc2_int),                      \
               "r" (SCM_I_INUM (y)));                                   \
        if (SCM_LIKELY (SCM_SRS (rlo, 31) == rhi))                      \
@@ -505,7 +505,9 @@ VM_DEFINE_FUNCTION (159, ash, "ash", 2)
               && ((scm_t_bits)
                   (SCM_SRS (nn, (SCM_I_FIXNUM_BIT-1 - bits_to_shift)) + 1)
                   <= 1))
-            RETURN (SCM_I_MAKINUM (nn << bits_to_shift));
+            RETURN (SCM_I_MAKINUM (nn < 0
+                                   ? -(-nn << bits_to_shift)
+                                   : (nn << bits_to_shift)));
           /* fall through */
         }
       /* fall through */