mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 17:27:33 +02:00
WIP
This commit is contained in:
parent
ffb9fd9e22
commit
c0a5daf898
1 changed files with 22 additions and 0 deletions
22
srfi/60.scm
22
srfi/60.scm
|
@ -226,6 +226,28 @@
|
||||||
// }
|
// }
|
||||||
return_closcall1(data, k, obj_int2obj(bf))")
|
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 arithmetic-shift ash)
|
||||||
|
|
||||||
(define (rotate-bit-field n count start end)
|
(define (rotate-bit-field n count start end)
|
||||||
|
|
Loading…
Add table
Reference in a new issue