From c0a5daf898dc55d179a56cd718f52b7220e56ede Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 30 Mar 2017 19:03:46 -0400 Subject: [PATCH] WIP --- srfi/60.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/srfi/60.scm b/srfi/60.scm index 03fb2b48..7a4256ff 100644 --- a/srfi/60.scm +++ b/srfi/60.scm @@ -226,6 +226,28 @@ // } return_closcall1(data, k, obj_int2obj(bf))") +;; (define-c ash +;; "(void* data, int argc, closure _, object k, object x, object y)" +;; "Cyc_check_int(data, x); +;; Cyc_check_fixnum(data,y); +;; int shift; +;; //int result; +;; alloc_bignum(data, bn); +;; +;; if (obj_is_int(x)) { +;; Cyc_int2bignum(obj_obj2int(x), &bignum_value(bn)); +;; } else { +;; mp_copy(&bignum_value(x), &bignum_value(bn)); +;; } +;; +;; shift = (int)unbox_number(y); +;; if (shift > 0) { +;; mp_lshd(&bignum_value(bn), shift); +;; } else { +;; mp_rshd(&bignum_value(bn), abs(shift)); +;; } +;; return_closcall1(data, k, Cyc_bignum_normalize(data, bn));") + (define arithmetic-shift ash) (define (rotate-bit-field n count start end)