Changeset 8588 in project


Ignore:
Timestamp:
02/20/08 11:44:52 (12 years ago)
Author:
felix winkelmann
Message:
  • added overflow-detecting bitwise fixnum operations
  • fixed bug in c-backend that resulted in unaligned lambda-infos
  • bumped version to 3.0.2
Location:
chicken/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/README

    r8361 r8588  
    33  (c)2000-2008 Felix L. Winkelmann
    44
    5   version 3.0.1
     5  version 3.0.2
    66
    77
  • chicken/trunk/buildsvnrevision

    r8506 r8588  
    1 8505
     18586
  • chicken/trunk/buildversion

    r7916 r8588  
    1 3.0.1
     13.0.2
  • chicken/trunk/c-backend.scm

    r8361 r8588  
    499499                ((>= n llen))
    500500              (gen #\, (char->integer (string-ref ll n))) )
    501             (do ((n (remainder llen 8) (sub1 n))) ; fill up with zeros to align following entry
     501            (do ((n (- (bitwise-and #xfffff8 (+ llen 7)) llen) (sub1 n))) ; fill up with zeros to align following entry
    502502                ((zero? n))
    503503              (gen ",0") )
  • chicken/trunk/chicken.h

    r8468 r8588  
    14991499C_fctexport C_word C_fcall C_i_o_fixnum_plus(C_word x, C_word y) C_regparm;
    15001500C_fctexport C_word C_fcall C_i_o_fixnum_difference(C_word x, C_word y) C_regparm;
     1501C_fctexport C_word C_fcall C_i_o_fixnum_and(C_word x, C_word y) C_regparm;
     1502C_fctexport C_word C_fcall C_i_o_fixnum_ior(C_word x, C_word y) C_regparm;
     1503C_fctexport C_word C_fcall C_i_o_fixnum_xor(C_word x, C_word y) C_regparm;
    15011504
    15021505C_fctexport C_word C_fcall C_i_foreign_char_argumentp(C_word x) C_regparm;
  • chicken/trunk/manual/The User's Manual

    r7916 r8588  
    33== The User's Manual
    44
    5 ''(This document describes version 3.0.1)''
     5''(This document describes version 3.0.2)''
    66
    77'''CHICKEN is a compiler that translates Scheme source files into C''', which in
  • chicken/trunk/runtime.c

    r8505 r8588  
    90739073
    90749074
    9075 /* fixnum arithmetic with overflow detection (from "Hacker's Delight" by Hank Warren) */
     9075/* fixnum arithmetic with overflow detection (from "Hacker's Delight" by Hank Warren)
     9076   These routines return #f if the operation failed due to overflow.
     9077 */
    90769078
    90779079C_regparm C_word C_fcall C_i_o_fixnum_plus(C_word n1, C_word n2)
     
    91049106}
    91059107
     9108
     9109C_regparm C_word C_fcall C_i_o_fixnum_and(C_word n1, C_word n2)
     9110{
     9111  C_uword x1, x2, r;
     9112
     9113  if((n1 & C_FIXNUM_BIT) == 0 || (n2 & C_FIXNUM_BIT) == 0) return C_SCHEME_FALSE;
     9114
     9115  x1 = C_unfix(n1);
     9116  x2 = C_unfix(n2);
     9117  r = x1 & x2;
     9118 
     9119  if(((r & C_INT_SIGN_BIT) >> 1) != (r & C_INT_TOP_BIT)) return C_SCHEME_FALSE;
     9120  else return C_fix(r);
     9121}
     9122
     9123
     9124C_regparm C_word C_fcall C_i_o_fixnum_ior(C_word n1, C_word n2)
     9125{
     9126  C_uword x1, x2, r;
     9127
     9128  if((n1 & C_FIXNUM_BIT) == 0 || (n2 & C_FIXNUM_BIT) == 0) return C_SCHEME_FALSE;
     9129
     9130  x1 = C_unfix(n1);
     9131  x2 = C_unfix(n2);
     9132  r = x1 | x2;
     9133 
     9134  if(((r & C_INT_SIGN_BIT) >> 1) != (r & C_INT_TOP_BIT)) return C_SCHEME_FALSE;
     9135  else return C_fix(r);
     9136}
     9137
     9138
     9139C_regparm C_word C_fcall C_i_o_fixnum_xor(C_word n1, C_word n2)
     9140{
     9141  C_uword x1, x2, r;
     9142
     9143  if((n1 & C_FIXNUM_BIT) == 0 || (n2 & C_FIXNUM_BIT) == 0) return C_SCHEME_FALSE;
     9144
     9145  x1 = C_unfix(n1);
     9146  x2 = C_unfix(n2);
     9147  r = x1 ^ x2;
     9148 
     9149  if(((r & C_INT_SIGN_BIT) >> 1) != (r & C_INT_TOP_BIT)) return C_SCHEME_FALSE;
     9150  else return C_fix(r);
     9151}
     9152
     9153
     9154/* decoding of literals in compressed format */
    91069155
    91079156static C_regparm C_uword C_fcall decode_size(C_char **str)
  • chicken/trunk/version.scm

    r7916 r8588  
    1 (define-constant +build-version+ "3.0.1")
     1(define-constant +build-version+ "3.0.2")
Note: See TracChangeset for help on using the changeset viewer.