From: Guillermo J. Rozas Date: Sun, 15 Jul 1990 22:50:44 +0000 (+0000) Subject: Add fixnum-lsh. X-Git-Tag: 20090517-FFI~11330 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f4af656073a1f20456067726067565a8a6614cae;p=mit-scheme.git Add fixnum-lsh. --- diff --git a/v7/src/microcode/fixnum.c b/v7/src/microcode/fixnum.c index 57ece4cec..9f43f5f6d 100644 --- a/v7/src/microcode/fixnum.c +++ b/v7/src/microcode/fixnum.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fixnum.c,v 9.30 1990/06/25 18:18:20 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fixnum.c,v 9.31 1990/07/15 22:49:32 jinx Exp $ Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology @@ -300,3 +300,24 @@ DEFINE_PRIMITIVE ("FIXNUM-NOT", Prim_fixnum_not, 1, 1, 0) z = (~ (x)); return (LONG_TO_FIXNUM (z)); } + +DEFINE_PRIMITIVE ("FIXNUM-LSH", Prim_fixnum_lsh, 2, 2, 0) +{ + fast unsigned long x, z; + fast long y; + + PRIMITIVE_HEADER (2); + + x = (arg_fixnum (1)); + y = (arg_fixnum (2)); + + if (y < 0) + { + z = (x >> (- y)); + } + else + { + z = (x << y); + } + return (LONG_TO_FIXNUM (z)); +} diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index d6452e7e4..0022f4ca8 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.35 1990/06/25 18:18:34 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.36 1990/07/15 22:50:44 jinx Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -46,7 +46,7 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 35 +#define SUBVERSION 37 #endif #ifndef UCODE_TABLES_FILENAME diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 056cd6d55..f75fc59da 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.35 1990/06/25 18:18:34 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.36 1990/07/15 22:50:44 jinx Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -46,7 +46,7 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 35 +#define SUBVERSION 37 #endif #ifndef UCODE_TABLES_FILENAME