From b539c4340dda0442fe125153f5b90aa789ff5a33 Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Fri, 7 Nov 1997 19:24:07 +0000 Subject: [PATCH] Add support for dumping and loading complex-float vectors. --- code/load.lisp | 15 ++++++++++++++- compiler/dump.lisp | 30 +++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/code/load.lisp b/code/load.lisp index 505978679..9ced0646b 100644 --- a/code/load.lisp +++ b/code/load.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.65 1997/11/01 22:58:16 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.66 1997/11/07 19:24:04 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -905,6 +905,19 @@ (read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2)) result)) +#+complex-float +(define-fop (fop-complex-single-float-vector 86) + (let* ((length (read-arg 4)) + (result (make-array length :element-type '(complex single-float)))) + (read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2)) + result)) + +#+complex-float +(define-fop (fop-complex-double-float-vector 87) + (let* ((length (read-arg 4)) + (result (make-array length :element-type '(complex double-float)))) + (read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2 2)) + result)) ;;; FOP-INT-VECTOR -- Internal ;;; diff --git a/compiler/dump.lisp b/compiler/dump.lisp index a86762524..7c83383f1 100644 --- a/compiler/dump.lisp +++ b/compiler/dump.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/dump.lisp,v 1.65 1997/11/01 22:58:28 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/dump.lisp,v 1.66 1997/11/07 19:24:07 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1312,6 +1312,14 @@ ((simple-array double-float (*)) (dump-double-float-vector simple-version file) (eq-save-object x file)) + #+complex-float + ((simple-array (complex single-float) (*)) + (dump-complex-single-float-vector simple-version file) + (eq-save-object x file)) + #+complex-float + ((simple-array (complex double-float) (*)) + (dump-complex-double-float-vector simple-version file) + (eq-save-object x file)) (t (dump-i-vector simple-version file) (eq-save-object x file))))) @@ -1434,6 +1442,26 @@ (dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2) (* vm:word-bytes 2) file))) +;;; DUMP-COMPLEX-SINGLE-FLOAT-VECTOR -- internal. +;;; +#+complex-float +(defun dump-complex-single-float-vector (vec file) + (let ((length (length vec))) + (dump-fop 'lisp::fop-complex-single-float-vector file) + (dump-unsigned-32 length file) + (dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2) + vm:word-bytes file))) + +;;; DUMP-COMPLEX-DOUBLE-FLOAT-VECTOR -- internal. +;;; +#+complex-float +(defun dump-complex-double-float-vector (vec file) + (let ((length (length vec))) + (dump-fop 'lisp::fop-complex-double-float-vector file) + (dump-unsigned-32 length file) + (dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2 2) + (* vm:word-bytes 2) file))) + ;;; DUMP-DATA-BITS-MAYBE-BYTE-SWAPPING -- internal. ;;; ;;; Dump BYTES of data from DATA-VECTOR (which must be some unboxed vector) -- GitLab